LM34 to computer

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Mike
Posts: 1813
Joined: Thu Mar 06, 2003 1:01 am
Location: Illinois
Contact:

LM34 to computer

Post by Mike »

I need to make a temperature sensor for my tech class at school. The device needs to connect to a computer, and display the temperature on the screen (I can program it with Visual Basic, just need help with the code).<p>Is there a way I can plug it into a computer and have it detect a voltage and turn that into the temperature readout?
hp
Posts: 245
Joined: Sat Aug 09, 2003 1:01 am
Location: Friendswood, TX
Contact:

Re: LM34 to computer

Post by hp »

The LM34 isn't a good choice for an interface to a computer unless you have some sort of data acquisition board on your computer. You could also use a pic with built a built in adc.<p>I would recommend a digital thermometer for your temperature measuring needs. An example project using a digital thermometer chip (DS 1621) is located at http://www.riccibitti.com/pc_therm.htm. That site includes a nice schematic, description, and vb source. It looks to be an all in one solution for your needs.<p>Harrison<p>[ October 08, 2004: Message edited by: hp ]<p>[ October 08, 2004: Message edited by: hp ]</p>
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: LM34 to computer

Post by rshayes »

You might be able to use the game port on the computer, if there is one. This uses an external resistors (normally the potentiometers in a joystick) to generate a pulse using a 555 timer type of circuit. The maximum potentiometer resistance is 100K.<p>Radio Shack used to sell a thermistor that was 10K at 25 C. This could probably connected to the game port directly. The thermistor response is nonlinear. This could be corrected by software.<p>The Current passing through the LM14 is proportional to temperature. The LM14 could replace the joystick potentiometer. The timing waveform would change from an exponential waveform to a linear ramp. The pulse width then is inverse proportional to current, rather than proportional to resistance. Again, this can be corrected by software.<p>The LM134 series generates a current based on absolute temperature, and can be used in a similar way. Another possibility is the AD590, made by Analog Devices. This is also a temperature controlled current source.<p>The game port can read four separate potentiometers, so as many as temperature sensors could be connected.
wd5gnr
Posts: 104
Joined: Wed Dec 19, 2001 1:01 am
Contact:

Re: LM34 to computer

Post by wd5gnr »

If you really need to read an LM34, consider a PC-connected A/D converter. For example:
the GP-3 adds several A/D, some digital I/O, PWM, etc. and programs in VB, Java, C, JavaScript, VBA, etc.<p>If you want to use the joystick port as someone else suggested, consider just using a thermistor.
Tommy volts
Posts: 149
Joined: Tue Oct 29, 2002 1:01 am
Location: Arizona
Contact:

Re: LM34 to computer

Post by Tommy volts »

Mike,<p>I built a very simple serial port I/O interface between a thermistor and 486 PC. I wrote the program in BASIC. A couple of resistors, a transistor, and a thermistor was all it took. Total cost was about $5.<p>Let me know if you are interseted.
Engineer1138
Posts: 458
Joined: Thu Feb 05, 2004 1:01 am
Location: Minneapolis, MN
Contact:

Re: LM34 to computer

Post by Engineer1138 »

The simplest DIY method is to use one of the Dallas digital temperature chips mentioned.<p>I have on my website some temperature to RS232 devices for sale, but they're really designed for people who need a solution that's "ready to wear" and don't want to tinker too much with it. The Dallas parts are much cheaper than what I have.
Mike
Posts: 1813
Joined: Thu Mar 06, 2003 1:01 am
Location: Illinois
Contact:

Re: LM34 to computer

Post by Mike »

Tommy, I am very interested in your project.<p>Please tell me how it was connected and how the code was written<p>Thanks!
Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

Re: LM34 to computer

Post by Will »

Doesn't the LM 34 have a 9 bit serial output which is a representation (The word 'analogy' doesn't seem to fit here) of the temperature - hence no ADC needed - or do I have the wrong chip
BB
hp
Posts: 245
Joined: Sat Aug 09, 2003 1:01 am
Location: Friendswood, TX
Contact:

Re: LM34 to computer

Post by hp »

The lm34 puts out 10mv per deg F. It is an analog device that would require an ADC for computer interfacing.<p>Harrison
Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

Re: LM34 to computer

Post by Will »

Then which is the similar devive which measures temperature and, in additoon to the mV/Deg C/F signal which it outputs - it outputs a nine bit serial signal which also is analagous to temperature ?
BB
Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

Re: LM34 to computer

Post by Will »

Ok - I was screwed up (I can hear all of the Sutprise ! Surprises !) - the device I was thinking of does not have an analog output like the LM 34 - but it has a nine bit serial output representing the temperature range -55 to + 125 Deg C so that it will communicate directly with a computer via the RS 232 serial port. It is the LM75 from ON Semiconductor (Formerly Motorola I think) It is complete with three bit digital address so that a computer can address up to eight LM75's on the same serial cable pair. If you are further interested and can't find an address I can probably dig one up for you.
BB
Mike
Posts: 1813
Joined: Thu Mar 06, 2003 1:01 am
Location: Illinois
Contact:

Re: LM34 to computer

Post by Mike »

I have 2 Maxim MAX6502 chips. The interface is logic.<p>Can I connect this to a computer serial port?<p>Here is the website:
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1767<p>and here is the datasheet:
http://pdfserv.maxim-ic.com/en/ds/MAX6501-MAX6504.pdf<p>I have the TO220 version.
hp
Posts: 245
Joined: Sat Aug 09, 2003 1:01 am
Location: Friendswood, TX
Contact:

Re: LM34 to computer

Post by hp »

The MAX6502 only switches on when a certain temperature has been met. So you won't be able to measure the temperature unless all you want to do is trigger something when a certain temperature has been reached.<p>And yes, you can connect that sensor/switch to the serial port. Connect the sensor out to a serial port pin (such as the CTS or RI pin). Then use the mscomm control and use the com event to detect when the pin goes high / low.<p>Harrison
Mike
Posts: 1813
Joined: Thu Mar 06, 2003 1:01 am
Location: Illinois
Contact:

Re: LM34 to computer

Post by Mike »

That will be good as I want it to only warn of an overheat.<p>Can I connect two chips? So one that turns on at one time to say the condition is good, and the other to warn of an overheat?<p>And can I write a program for this in visual basic? Just to say on the screen if all is OK or not.
hp
Posts: 245
Joined: Sat Aug 09, 2003 1:01 am
Location: Friendswood, TX
Contact:

Re: LM34 to computer

Post by hp »

Of course you can use two chips. You can use any two of the RI, CTS, and the DCD pins. Make sure you use some sort of buffer between the serial port and the sensors. A 1k or so resistor should do.<p>The software can be easily written in vb using the mscomm control. Of course this implies that you are using vb 5 or vb 6 since vb.net does not readily have the mscomm control. Look at the MSDN documentation for the mscomm control and lookup the commevent. It will show you how to catch certain com port events.<p>Serial Port Pinout: http://www.aggsoft.com/rs232-pinout-cab ... signal.htm<p>Snippet of Code from vb6 MSDN:<p><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><hr><pre>
Private Sub MSComm_OnComm ()
Select Case MSComm1.CommEvent
' Events
Case comEvCD ' Change in the CD line.
Case comEvCTS ' Change in the CTS line.
Case comEvDSR ' Change in the DSR line.
Case comEvRing ' Change in the Ring Indicator.
End Select
End Sub
</pre><hr></blockquote><p>Harrison<p>[ October 14, 2004: Message edited by: hp ]</p>
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 33 guests