A first idea for a super simple RS232 temperature probe with the temp PIC

Do you have a question? Post it now! No Registration Necessary

Threaded View
I have made it even simpler, and managed to interface the PIC to RS232 _without_
any extra parts.

Test setup:
 
ftp://panteltje.com/pub/PIC_RS232_temperature_probe_test_setup_img_1446.jpg

New diagram:
      
ftp://panteltje.com/pub/PIC_RS232_temperature_probe_2_diagram_img_1445.jpg
  

Asm code:
 http://panteltje.com/panteltje/pic/temp_pic/index.html

This is new asm code, you can select non-inverting RS232, this omits the MAX232
or transistors.
An advantage of doing RS232 in software :-)

The idea is based on DTR being positive, and supplying about 10 mA to the 5.1 V
zener.
The PIC will switch the RS232 between 0 and +5V.
This works great on the USB to RS232 adaptors I have :-)

Only 3 parts!
The cap needs to be next to the PIC, use a small one, low thermal mass,
perhaps cut of some of the PIC pins, even lower thermal mass...
Or use a smaller package perhaps.
The zener needs to be in a spot that does not heat up, for example the connector.
So this gives you a super cheap temp sensor with RS232 out... You can log temps
too.

There is also a programmable temperature alarm output on pin 2, not used in this
example.


Re: A first idea for a super simple RS232 temperature probe with the temp PIC

Quoted text here. Click to load it

Er, DTR can be up to +12 volts.  You're going to blow that zener, then
the PIC, the first time you plug it into a 12v RS-232 port.  You need
at least a drop resistor to limit current in the zener to it's
maximum.

Also, you'll fail to drive a true RS-232 port's Rx pin, as it requires
you go to -3v.  I suspect such ports are rare these days, but it's
something to keep in mind.

Otherwise it's a "cool" project :-)

Re: A first idea for a super simple RS232 temperature probe with the temp PIC
On a sunny day (13 Aug 2009 15:55:28 -0400) it happened DJ Delorie

Quoted text here. Click to load it

The RS232 spec specifies the outputs as short circuit proof.
 http://www.arcelect.com/rs232.htm

There is no max current specified, but I measure 11 V open and 10mA
short circuit current on teh PC out o nCOM 1.
I measure 7.87 V open and 15.3 mA short circuit current on DTR on the
USB to RS232 adaptor.
Neither will damage any zeners, and a zener is not even a short.

But sure add your resistro if you must, better a fuse then !!
This can be done with a very thin wire / PCB track :-)
No extra cost.

Since most RS232 (and especially the ones this is intended for) are chip
generated, nothing to worry about.

Disclaimer applies.



Quoted text here. Click to load it

I know, and I think all these things use a BJT and a diode to ground
in the base, and an input resistor.


Quoted text here. Click to load it

Yep.
Nice to monitor heatsink temp if you are testing something.
I had it up to 150°C and it was still working OK.
It goes to about -20°C too.
  

Re: A first idea for a super simple RS232 temperature probe with the temp PIC

Quoted text here. Click to load it

I was thinking, the PIC *isn't*.

Quoted text here. Click to load it

I checked the cheapest 0603 5.1v zener at digikey, it can handle 200
mW.  That's 40 mA.  To get 40mA from (12-5) volts, that's only 180
ohms.  Larger zeners mean smaller resistors (they can handle more
power).

Alternately, you could use a small LDO regulator instead of the zener,
but I suppose you'd only need it if you actually ran into an rs232
port that was too powerful.  Rare, I suppose.

Another option: for the cost of the usb-serial converter, you could
add an FT232 chip to your PIC and make it a usb-based thermometer, and
avoid all the power problems completely :-)

Quoted text here. Click to load it

It's not just about protecting the circuit that way, it's about
letting it run despite the 12 volt inputs.

Quoted text here. Click to load it

Like I said, rare.

Quoted text here. Click to load it

Good for room or outdoor temperatures.  The only temperature in my
house I monitor outside that range is the woodstove, which requires a
special thermocouple anyway.

Re: A first idea for a super simple RS232 temperature probe with the temp PIC
On a sunny day (13 Aug 2009 19:08:57 -0400) it happened DJ Delorie

Quoted text here. Click to load it

See my reply to Jon Kirwan.

Re: A first idea for a super simple RS232 temperature probe with the temp PIC
On Thu, 13 Aug 2009 22:06:39 GMT, Jan Panteltje

Quoted text here. Click to load it

Just to stir the pot a bit, both my memory and the web page you
provide says +/- 15V .... not 12V.  Look at the specs nearer the
bottom and not the author's writing earlier on.  And that's when it is
loaded by a receiver that also meets specs between 3k and 7k ohm.
(Drivers must limit short-circuit current to less than 1/2 amp.)

RS232D is supposed to use the band between -3V and +3V as a transition
region and the two bands from +3 to +5, and from -3 to -5, as their
noise margin.  Logic states of MARK and SPACE don't even begin until a
magnitude of 5V is reached (loaded.)  A lot of laptops can't even get
there, I gather.  But that's the spec.

So DTR can be up to 15V, loaded, and 25V unloaded.  Unless I missed
something.

Jon

Re: A first idea for a super simple RS232 temperature probe with the temp PIC
On a sunny day (Thu, 13 Aug 2009 23:36:31 GMT) it happened Jon Kirwan

Quoted text here. Click to load it

Yea, well, the point with 'specs' that nobody follows, is that
it is hard to find a safe area that satisfies mathematician types
that are used to calculate resistances between points in infinite resistor
matrices.

As _infinite_ resistor matrices do not exist, they are wasting their, and
everybody else's, time, and then later at higher age (if not overrun by a car as
in that cartoon)
before getting to that, lose themselves into string theory :-)

From what I have measured my USB to RS232 adaptor only outputs about 6.8V on DTR.
That leaves 1.8 V for a 78L05, so I preferred the zener.
If you are rich like Larkin you use a 78L05 and have that perfection feeling,
while of course there may exist RS232 stuff that outputs even less... needing
a more complex switch mode perhaps... or an external AC adaptor, or just
use the MAX232 that in itself  also outputs like 6,8 V....

As to the TX side, it will simply always work.

And finally this was just an example, for the poor among us, like Joerg, who
have to count
every cent, and will love the cheap zener and non-transistor,
Hell the connector is the most expensive thing in this whole design.
Tell me were you can find an temp sensor with RS232 output for less then 1 Euro
(1.5 $ no wait 1.6 $, no wait 1.7 $ oh,
well you know what I mean...


That all said, I intent to try mine with a 78L05, as it seems there is a 1
degree difference in temp
output if run from the PC or from the USB to RS232 adaptor, due to different
zener current.
Not really important, as it is not specified at 1 C accuracy, and can easily
calibrated out in software,
but just curious if the 78L05 will live up to it's dropout specs.

I am going to use this one to monitor my transmitter heat sink temperature,
maybe control a fan with it.

Somebody in China will read this, expect cheap RS232 out temp probes soon ;-)
Hey guys, make them in the millions :-)
We set the standards :-)


Re: A first idea for a super simple RS232 temperature probe with the temp PIC

Quoted text here. Click to load it
matrices.
Quoted text here. Click to load it
as in that cartoon)
Quoted text here. Click to load it
DTR.
Quoted text here. Click to load it

Thats the difference between building rock solid commercial circuits
and circuits that only work as a prototype.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
We've slightly trimmed the long signature. Click to see the full one.
Re: A first idea for a super simple RS232 temperature probe with the temp PIC
On Fri, 14 Aug 2009 17:30:49 GMT, snipped-for-privacy@puntnl.niks (Nico Coesel)

Quoted text here. Click to load it
matrices.
Quoted text here. Click to load it
as in that cartoon)
Quoted text here. Click to load it
DTR.
Quoted text here. Click to load it

Nobody follows the "rules".  When I designed the first 1488/1489
RS-232 driver/receiver set (in the early '60's), the _spec_ was ±10V

Now it is common to see 0 => +3.3V, taking advantage that the original
designed threshold was ~+0.6V (to avoid requiring split supplies for
the receiver; AND to meet the floating input response spec).

                                        ...Jim Thompson
--
| James E.Thompson, P.E.                           |    mens     |
| Analog Innovations, Inc.                         |     et      |
We've slightly trimmed the long signature. Click to see the full one.
Re: A first idea for a super simple RS232 temperature probe with the temp PIC
On Fri, 14 Aug 2009 11:28:27 GMT, Jan Panteltje

Quoted text here. Click to load it

Well, I'm just trying to stir things up, as I said.  But to continue
being argumentative:

Some older devices did actually follow them.  I even tried such a
driver (the slew rate spec was beyond my hobby skills to be certain
of, though.)  Some of those devices are still around and being used on
occasion.

Quoted text here. Click to load it
matrices.

Designing a driver for RS232D is not as simple as designing such a
receiver.  Meeting specs with the receiver is actually __NOT__ hard. I
can speak from having done one or more that I believe did meet the
spec.  (We can always argue about it, though.)

Quoted text here. Click to load it
as in that cartoon)
Quoted text here. Click to load it

Ah, but theory is fun and it does apply to other circumstances.  In
this case for example, superposition is used quite profoundly by Spice
because it works so well.  And 1st year electronics books discuss it
at length when talking about solving networks by any of at least three
common methods.

So the principles are germane and practical.

Quoted text here. Click to load it
DTR.

Have you exhaustively checked all devices?  I've seen it a lot lower,
in practice, on some laptops for example.  And higher, as well.

Quoted text here. Click to load it

Well, I would definitely feel __very__ uncomfortable using 6.8V as a
design criteria for DTR.  Not because I think the spec is met by every
device (we both know it's pretty rare), but because so many devices
I've measured don't cleave to this supposed standard of 6.8v, either.
It's all over the map and people seem these days to do what pleases
them.  Which makes this rather more complex than if folks had actually
held to the standard more.  I've seen DTRs at 3.3V on one laptop,
obviously because that's the supply they had to use conveniently.  And
that's clearly not in the spec, at all, but neither is it anything
like your 6.8V.

Quoted text here. Click to load it

Naw.  I'm poor.  Or, at least, I've still the heart of a church mouse
from times when I worked the fields to survive.

Quoted text here. Click to load it

Yes.  Much less.  If I were going for this to be broadly useful, I'd
go the extra steps.

Quoted text here. Click to load it

I can't say.  I didn't look.

Quoted text here. Click to load it
have to count
Quoted text here. Click to load it

For one-offs, I'd use what works, too.

Quoted text here. Click to load it
(1.5 $ no wait 1.6 $, no wait 1.7 $ oh,
Quoted text here. Click to load it

Um.  I was just stirring a pot, not looking for a temp sensor.

Quoted text here. Click to load it
degree difference in temp
Quoted text here. Click to load it
zener current.
Quoted text here. Click to load it
calibrated out in software,
Quoted text here. Click to load it
maybe control a fan with it.
Quoted text here. Click to load it

As far as my experience with Chinese manufacturers goes, they do what
is asked explicitly (and pretty well) and everything else that isn't
closely specified (with examples provided that they must exactly
match) they will use whatever is the absolute least expensive (nothing
at all, if possible) even if it makes the rest of the unit useless to
do so.  If you say <metal box, 4" by 4" by 3"> but fail to provide an
exact example and fail to say that the sides need to be metal as well,
you will get a slight metal frame with huge holes where the faces
should be because that saves them cost by using less metal and it will
be the cheapest metal possible.  But it will be an accurate 4"x4"x3"
size because that's what you asked for.

I'm not entirely sure what that means with your circuit, interpreted
through that light.  But I'd be leary.

Jon

Re: A first idea for a super simple RS232 temperature probe with the temp PIC
On a sunny day (Fri, 14 Aug 2009 17:30:49 GMT) it happened snipped-for-privacy@puntnl.niks

Quoted text here. Click to load it

That is very much a non-sentence.
I am not going to challenge you to come up with an example
where this does not work.
But I say that you will have a very hard time finding one.

Now the ball is in your court.

This thing is intended to be used with a laptop, or PC,
with a reasonable cable length, to measure temperatures of objects under test.
It does that just fine, and I have also decided _not_ to use a low drop
regulator.

It is in the public domain, anybody is free to use the source and add whatever
they think they need to make it usable for their purposes.

As such it is a lot more professional then a $$$$+++ black box where
you have no control over anything, other then a promise to have it
repaired for more $$$$+++++++ if it fails, but hey if you want to get ripped of
enjoy it, if you can :-)
 
It is also possible you never measure temperature, in that case what do you care.
Oh I see it now: Your professional modules overheat in spite of those extra fans
blowing on it,
but you donotwantoknow, so you reject good cheap temp sensors :-)

El Pante.

EVERYBODY SHOULD HAVE SOME OF THESE SENSORS IN THE WORKSHOP.

How to view temperatures in an xterm and log those to a file at the same time in
Linux, with this sensor:
 ptlrc -d /dev/ttyUSB1 -b 9600 | tee temp.log
You can find ptlrc here:
 http://panteltje.com/panteltje/pic/io_pic/ptlrc-0.5.tgz

Did you know the output on pin 2 of the PIC sensor can drive a power MOSFET to
control
for example a fan?
All that is needed is a resistor and capacitor to ground, and a logic level
MOSFET.
  http://panteltje.com/panteltje/pic/temp_pic/index.html

hehe
:-)
 

Re: A first idea for a super simple RS232 temperature probe with the temp PIC
Quoted text here. Click to load it

Yea, right. I was thinking along these lines long time ago and everything
worked fine until our device was connected to some brand name PC and it
stopped working.

Guess what? It required negative voltage to work properly.

Since it was 10+ years ago I do not remember the exact brand. It was
something like HP, IBM, Intel, ...

--
Andrew



Re: A first idea for a super simple RS232 temperature probe with the temp PIC


On a sunny day (Fri, 14 Aug 2009 14:47:45 -0500) it happened "Andrew"

Quoted text here. Click to load it

Yes but this one does not require negative voltage.
Anyways in an other project I use DTR and RTS to make pos and neg voltages:
 http://panteltje.com/panteltje/wap54g/max_pantel.txt
This requires the terminal program to set DTS and RTS accordingly,
I think any mouse driver does that :-)
And other advantage of using Linux, and writing your own software.
Simlpy wrote a little routine to set DTR to + / RTS to -.




Quoted text here. Click to load it

Well.... hehe those are big names....

Re: A first idea for a super simple RS232 temperature probe with the temp PIC



Quoted text here. Click to load it

He said the PC required a -ve voltage and I have had the same experience
where TTL levels would not drive the PC RXD line, also a long time ago,
probably on a Dell machine.
--

Re: A first idea for a super simple RS232 temperature probe with the temp PIC


On a sunny day (Sat, 15 Aug 2009 00:39:22 +0100) it happened nospam

Quoted text here. Click to load it

Did not Dell go out of business some time ago ;-)?

Re: A first idea for a super simple RS232 temperature probe with the temp PIC



Quoted text here. Click to load it

Are you really that ignorant of the PC world?
--

Re: A first idea for a super simple RS232 temperature probe with the temp PIC


On a sunny day (Sat, 15 Aug 2009 14:55:02 +0100) it happened nospam

Quoted text here. Click to load it

Na, everybody knows Dell went belly up years ago because it did not work with my
PIC temp sensor.
Got the joke now?

Actually all this bull about 15 year old PCs like Dell is a waste of time.
Dell will these days use the same mobo chipsets as everybody else.
Just for fun I programmed some new features in the PIC (still only a few bytes
more),
selectable baudrate down to 75 Bd, programmable hysteresis so it can really
drive a fan or heater, and selectable ORin or hard drive for a power MOSFET.
 http://panteltje.com/panteltje/pic/temp_pic/index.html
 http://panteltje.com/panteltje/pic/temp_pic/temp_pic-0.7.asm

Now what did you do, play with your Dell?

As more features are added testing becomes more involved, so bugs will also
make their way.
Testing at -20C is difficult, so I simulated that.


Re: A first idea for a super simple RS232 temperature probe with the temp PIC



Jan Panteltje wrote:
Quoted text here. Click to load it
my PIC temp sensor.
Quoted text here. Click to load it


   Yes. As always, you are the pathetic joke.


--
You can't have a sense of humor, if you have no sense!

Re: A first idea for a super simple RS232 temperature probe with the temp PIC

Quoted text here. Click to load it

Experience from the past. Try to connect a long piece of wire between
such a circuit and a computer. Then you'll find out why they choose
large signal levels and a grey area in the middle. If you release such
a circuit in the wild you'll see someone comes up with a computer
which has slightly different levels or a laptop with a noisy PSU (to
start with).

Quoted text here. Click to load it
regulator.
Quoted text here. Click to load it

There a lots of cheap temperature sensors (Microchip has many) in
small packages that can either be read by an A/D converter input or
I2C.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
We've slightly trimmed the long signature. Click to see the full one.
Re: A first idea for a super simple RS232 temperature probe with the temp PIC


On a sunny day (Fri, 14 Aug 2009 20:29:32 GMT) it happened snipped-for-privacy@puntnl.niks

Quoted text here. Click to load it

This works fine with more then a meter length on COM1.
Remember the TX drives the line hard, the PIC can source whatever
it can get from DTR, and sink many many milli amps.
Looks like nice square waves here, not that slow rise time stuff.
If problems occur: Simply lower the baudrate, it is set with a #define in the
asm source.
The PIC sends a new temp value about once per second (watchdog timeout
basically).
Communication program ptlrc goes down to 75 Baud, 150 C is 5 characters, 10 bits
x 5 = 50 bits,
less then a second ! See, you do not know what you are talking about.
The '1' or '0' needs to be true before half the bit time, that is when the UART
normally samples that line, and half a bit time at 75 Baud is 6.6666666 ms :-)
So 6 ms will be fine.
For a 10 mA sink / source to have say 4 V in 6 ms allows for a capacitance of
Q = C.U = i.t makes C = i.t / U = .01 x .006 / 4 = 15 nF.
RS232 low capacitance cable is about 100 pF per meter, so this allows for a cable
length of 150 meter if using 75 baud.

Light bulb on now :-)?

I am aware of the RS232 problem, in the long ago past I have replaced some really
long ones with optical ones (factory PC to PLC), with RS232 to optical Hirschman
modules at each end (each with their AC adaptor).


Quoted text here. Click to load it

You can do I2C (well I do it) via a par port, even over tenth of meters with
screened cable.
In any other case you need an extra micro.

Site Timeline