Home Getting Started My Stamp Projects Electric Eng. Projects My Robots My PIC Projects PIC Mircontrollers Downloads Links Email

Building a Basic Stamp II Temperature Logger using Visual Basic 5.

Introduction


This project will show you how to build Temperature Logger using a Stamp II connected to a PC serial port. I was planing on using the DS1620, but used a LM335 temperature sensor because it only needs a two wire interface and it is easy to waterproof. All i did to waterproof it was to put some heat srink tubing around the 3 wires then around the hole sensor.

Here is a screen shot of the Visual Basic 5 Program. The program still has some bugs, but its just error trapping things, like clicking the connect button with no com port selected will give you a error. I will fix that later, or you can do it your self. The software is available to anyone who wants it, feel free to modify it and way you wish. This program is made in Visual Basic 5, but will work fine in Visual Basic 6.



The program will update the current temperature every one second on the PC screen and will save it to a txt file on the Hard Drive every five minutes, along with the time and date. It will also display max and min temperature and max and min pressure for a 24 hour period, and plots pressure and temperature for a 24 hour period.



Weather Monitor logger Schematic


The LM335 is a presision temperature sensor, its output is a linear relationship (10mV/Kelvin). The LM335 is a zener diode that its voltage drop across increase as temperature increases. Note that there is a 2.2 Kohm current limiting resistor. Without the limiting resistor the LM335 will have to dissipate too much heat and increase the temperature reading. The formula for calculating the output of the LM335 is

Temp(in C) = (Vout*100)-273.15

To convert that to F it would be

Temp(in F) = (temp*1.8)+32

From a range of -20C(68F) to 45C(113F) the output range is about 1.3V's. However the ADC has a range of 4.096V, which is fine but if you would like to get a better resolution(more accurate temp reading) you could use a op amp circuit to make the output votlage be 0 V at -20C and 4V at 45C. Connecting it directly will, however, give you 0.1 C/1mV or .05F/1mV which is very good, but the opamp circuit would be more work, but would give you close to .01F/1mV. I dont think it really worth it , but i just thought i might mention it. I also just added a MPX4115 pressure sensor to monitor pressure as well, but i havnt updated the schematic with yet.


Note that i didnt show the connection to the PC, this is showen on the intro page.



Downloads
1 Kb BASIC Stamp II Code
3 Kb Visual Basic 5 Code
0 Kb Templogger Setup program Coming soon.
100 KbDatasheet for the LM335

Note: The Visual Basic code is the code you can edit in Visual Basic 5, the Templogger program is a setup file to install vbtemplog.exe. If you dont have Visual Basic 5 you can install this and use the Temp Logger program. You cant modifiy it though.


Conclusion

With a little more work you could use this to read up to 8 different temperatures in different areas. This would require a lot more code on the Visual Basic side of it because the string of data coming in would be 32 bits long, however not impossible. In the future i plan on adding a MPX4115 pressure sensor to this and log the pressure as well.




Home Stamp Projects EE Projects PIC projects Downloads Getting Started Links Robots
Last update: October 1/1999

Questions or comments email me at Shaunwilson19@yahoo.com
ICQ# - 11278365