Temperature Displayer uses Propeller Demo Board, an ADC0831, a LM34 sensor and
Well here it is my first real completed Propeller project that actually does something useful . I have been working with the Propeller demo board for a few months now, learning spin and playing with sensors, but I actually put more effort into this one to make it useful to share. Others may find a trick or two and learn something as well. All the code is commented and I drew a proper schematic diagram for the project. When I get done building and playing with my Penguin kit, I may add the Parallax Humidity sensor and/or the Pressure sensor to this project. Then I will have the start of a nice little weather station. If anybody takes this project and beats me to it I would love to see what you have done with it.
As a side note of interest, this project includes 2 spin objects that you can use in your own projects. One is a simple driver for the ADC0831 A to D Converter chip and the other is a not as simple but fairly robust and easy to use driver for the Parallax LCD Displays. Both are included in this project and are also in the Object Exchange Library. There is also a nice little method in the main file that converts Binary variables to regular Numeric (base 10). So I hope this is fun for everybody and that some beginner to mid-range Propeller enthusiasts can learn a thing or too and maybe my Objects will be of use to an even broader range of people.
This project was developed on a Mac and built on a Propeller demo board. Here is a list of parts used with their Parallax part numbers;
Propeller demo board
32100
LM34 Temperature Sensor
604-00011
ADC0831 A to D Converter chip --- ADC0831
LCD Display*
27979
1uF Capacitor
201-01050
270 ohm Resistor
150-02710
1K ohm Resistor
150-01020
10K ohm Potentiometer
152-01031
*Note: The LCD Driver Object used in this project will also support the 27977 and 27976 LCD Displays
Here is a small picture of the schematic used (I started with one I borrowed from a project by Larry Freeze):
Once you have built the circuit and loaded the spin code into the Propeller to run it, all that's left is to calibrate it. I used a regular small glass (made of glass not plastic or ceramic) filled with ice which I placed as close to the LM34 as possible. Actually touching it would be ideal. After a minute or so to let the temperature of the glass lower the temperature of the LM34, I turned the 10K pot until the display read about 33. Yes I know water freezes at about 32 degrees, but this depends on what altitude you are at and the air in the room will heat the exposed part of the LM34 a little. If you know a better way (short of using an actual thermometer, which all I could find were digital ones meant for using on people) feel free to share it.
So that's all there is to it. A simple but fun little project useful and ready to be expanded on. You can post any feedback here of course or you can reach me via email I would love to hear from you.
Before I go, a small word about the code. I have been a programmer for over 30 years and started on an Apple II+ with 6502 Assembly Language, from there I have learned all the different flavors of C, some other Assembly Languages, Perl, Java, Basic and a few others. I have developed under Windows, Linux, Mac and a few other environments. Through these years I have adopted a style of code to where I try to make it Modular, Readable, Maintainable and of course bug free. This style of code has proven to be good for both personal and team use. So I fully realize when you read my code you might have or use ways to code that are shorter, fancier, more efficient or generate smaller code. Use whatever style you chose that's part of the fun in coding, you mostly get to do it your way. Rest assured that if needed, I know how to write tight, efficient or small code and will throw out the other things I mentioned in favor of doing whats needed. Of course I will write this kind of code anyways if it fits in with the other aspects of coding I mentioned before. Nothing better than writing a nice elegant piece of code. But I will hammer it out in brute force if I have a good reason to. Enough said on that *gets down off his soap box*.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Often the joy is not so much in the having, its in the building...
Post Edited (Macore) : 3/2/2010 11:55:29 PM GMT
As a side note of interest, this project includes 2 spin objects that you can use in your own projects. One is a simple driver for the ADC0831 A to D Converter chip and the other is a not as simple but fairly robust and easy to use driver for the Parallax LCD Displays. Both are included in this project and are also in the Object Exchange Library. There is also a nice little method in the main file that converts Binary variables to regular Numeric (base 10). So I hope this is fun for everybody and that some beginner to mid-range Propeller enthusiasts can learn a thing or too and maybe my Objects will be of use to an even broader range of people.
This project was developed on a Mac and built on a Propeller demo board. Here is a list of parts used with their Parallax part numbers;
Propeller demo board
32100
LM34 Temperature Sensor
604-00011
ADC0831 A to D Converter chip --- ADC0831
LCD Display*
27979
1uF Capacitor
201-01050
270 ohm Resistor
150-02710
1K ohm Resistor
150-01020
10K ohm Potentiometer
152-01031
*Note: The LCD Driver Object used in this project will also support the 27977 and 27976 LCD Displays
Here is a small picture of the schematic used (I started with one I borrowed from a project by Larry Freeze):
Once you have built the circuit and loaded the spin code into the Propeller to run it, all that's left is to calibrate it. I used a regular small glass (made of glass not plastic or ceramic) filled with ice which I placed as close to the LM34 as possible. Actually touching it would be ideal. After a minute or so to let the temperature of the glass lower the temperature of the LM34, I turned the 10K pot until the display read about 33. Yes I know water freezes at about 32 degrees, but this depends on what altitude you are at and the air in the room will heat the exposed part of the LM34 a little. If you know a better way (short of using an actual thermometer, which all I could find were digital ones meant for using on people) feel free to share it.
So that's all there is to it. A simple but fun little project useful and ready to be expanded on. You can post any feedback here of course or you can reach me via email I would love to hear from you.
Before I go, a small word about the code. I have been a programmer for over 30 years and started on an Apple II+ with 6502 Assembly Language, from there I have learned all the different flavors of C, some other Assembly Languages, Perl, Java, Basic and a few others. I have developed under Windows, Linux, Mac and a few other environments. Through these years I have adopted a style of code to where I try to make it Modular, Readable, Maintainable and of course bug free. This style of code has proven to be good for both personal and team use. So I fully realize when you read my code you might have or use ways to code that are shorter, fancier, more efficient or generate smaller code. Use whatever style you chose that's part of the fun in coding, you mostly get to do it your way. Rest assured that if needed, I know how to write tight, efficient or small code and will throw out the other things I mentioned in favor of doing whats needed. Of course I will write this kind of code anyways if it fits in with the other aspects of coding I mentioned before. Nothing better than writing a nice elegant piece of code. But I will hammer it out in brute force if I have a good reason to. Enough said on that *gets down off his soap box*.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Often the joy is not so much in the having, its in the building...
Post Edited (Macore) : 3/2/2010 11:55:29 PM GMT
Comments
There is another way to calibrate the readings as the output voltage is linear to the temperature and the internal calibration of the LM34 or -35 is already done by the factory. Use a digital multimeter to measure the voltage output on the LM and then adjust the Pot until your display shows the same as your multimeter.
A really do enjoy to read about useful projects!
Hey, thanks for the tip, I thought it might work that was after reading the data sheet for the two product but I wasn't sure.
Now you see I post this project for others to learn from and lo and behold I am the first one that learns something!
Thanks, I will try it!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Often the joy is not so much in the having, its in the building...