GeekPort Projects
MrThermistor v1.0
(for BeOS Preview Release)
by Brian P. Wagner, Tegra Software
August 1997 Be Masters
Honorable Mention Winner!
BeBox Zone Note:
This software was written for long outdated versions of BeOS, and has not
necessarily been tested with recent versions of BeOS. You can download a
version of the MrThermistor software here, but
we take no responsibility if you blow up your BeBox, or electrocute your cat in
using the software.
Introduction:
MrThermistor is a freeware program brought to you be me, Brian
P. Wagner. It was written completely on a dual-66 original BeBox.
It uses the BeBox GeekPort to measure temperature and display it
on the screen. This is my first BeOS program and it was loads of
fun to program.
Installation:
In order to run MrThermistor you will first need to download
and un-zip the files. Since this is a GeekPort program, it is
assumed that a BeBox is what you are running, although it will
probably work on a Mac running BeOS, you will only see Error!.
Just put the program anywhere you want, it'll run.
You will also need to get and install a copy of libprefs.so in
boot/home/config/lib. This is a preference library written by
John Watte and it is located on the Be ftp server. Click
here to download libprefs. [BeBox Zone: With the demise of Be Inc, you can now download libprefs from the BeBox Zone.]
One final detail, you will have to make a BeBox GeekPort
thermistor sensor circuit. This is easy and fun, and if you have
no soldering experience, then it is about time you get some.
The Circuit:
As you can see the circuit is a basic voltage
divider. When two resistors (in our case one resistor and
a thermistor) are in series between 5V and ground, the
node between the resistors varies between 0 and 5 volts.
This node is what the A2D converter reads. The a/d ref
pin is simply tied to ground. Parts list (total should
cost ($5.00) :
1 10K (1%) resistor
1 RadioShack p/n 271-110A thermistor (you can us other
thermistors, we will get to this later.
1 37 pin D-Sub geek port plug with solder cups -
Jameco p/n DC37P (1-800-831-4242)
1 37 pin D-Sub hood to protect your circuit - Jameco
p/n DC37H (1-800-831-4242)
some misc. hookup wire, solder, etc.
|
Circuit Theory:
As previously stated, the circuit above is a voltage divider
where the Vnode = RThermistor/(10,000+RThermistor)*Vin where Vin
is 5 V. Now the problem is that a thermistor is a non-linear
device, i.e. the temperature vs. resistance curve does not follow
a straight line. What to do?
Simple, what I did was create a Excel spreadsheet which plots
Temp vs. Voltage and Excel does the gaussian fit of the data to a
fourth order polynomial. whew! In other words excel gave me a
formula of C Vs V in a form that I could use.
Here is a copy of the spreadsheet (it was done using Excel for
MSOffice97) MrThermistor.xls. If
you play with the numbers in the spreadsheet, you will notice
that you change the formula based on the sample data. If you want
greater accuracy in one range, then just stuff more numbers into
the spreadsheet. Someday, I will get around to writing a 4th
order gaussian fit program.
If you want to use another thermistor, all you have to do is
find it's characteristic curve! Put Mr.Thermistor in port voltage
mode, measure lots of sample temperatures (using another
thermometer) plug the values into the spreadsheet and walla!
e-mail me if you have problems doing this.
MrThermistor Screens:
There are two main windows associated with MrThermistor. The
first one is just a display screen for the temp. On this screen
you will notice a small Button in the lower right. Push it and a
preferences screen will appear. use this screen to set A2D port,
update speed, display options, and the thermistor curve
variables. Press apply to save your preferences. Mr Thermistor
also remembers where your windows were last located. Play with
the settings, they won't bite!
About the Author:
MrThermistor was written by me, Brian P. Wagner. I have a
small consulting company called Tegra Software, where I do
database programming in MS Access. I have a degree in EE and CS
and I love electronics and programming. I hope to extend the
capabilities of MrThermistor to a full GeekPort weatherstation. I
also have some ideas about how to give other BeOS capable
machines access to GeekPort type stuff, cheap!. I hope you have
enjoyed this program.
Brian P. Wagner
2430 Dove Lane
Chattanooga, TN 37421
bpwagner@chattanooga.net
http://chattanooga.net/~bpwagner
Credits:
MrThermistor uses libprefs.so by John Watte. This is a
fantastic piece of code and I would like to encourage anyone to
use it. It makes the task of saving/retrieving options a piece of
cake! Thanks hplus.
MrThermistor also used Interface Elements by Attilla Mezei.
This is also a great piece of work, and it comes highly
recommended. Let me know where I can send my shareware check!
Thanks.
Mr Thermistor also used MessageBoy as a debugging tool in the
AA_PR version. If you have MessageBoy, turn it on and watch the
MrThermistor action. Message Boy does a good job at simple
debugging. Thanks to Casey Fleser. Can't wait for the PR Version!
Use this program at your own risk. It has been thoroughly
tested and does not cause any problems on my machine, but your
mileage may vary. I did blow a GeekPort fuse once. The Author
assumes no liability...
This page was last revised 08/09/97
|