Introduction: PICAXE Pitcher Perfect Thermometer
Sometimes, silly seems to work. I was finishing the software for a digital thermometer with all of the pieces on the workbench and it occurred to me that I had not even given any consideration to an enclosure. This is unusual for me since I generally order a project box, plastic or aluminum, when I order parts. Maybe my friends are correct and it is just Mr. Old Age creeping up on me, but as long as I can remember to unplug my soldering iron, I'm not going to dwell on the issue!
I continued with coding. Yesterday I found myself in Wal-Mart and I was looking for a cutting board in the kitchenware section (to use for a base of a Morse Code Key.) And there it was, the perfect enclosure for the perfect price, under $2. So, sit back boys and girls and lets build the pitcher perfect kitchen thermometer... build it for a gift, build it for your mother, or build it for yourself and be the envy of your neighbors.
Step 1: Getting It All Together
This is a PICAXE microcontroller, uC, project which means the code is written in PICAXE Basic. There are several places on the Internet to acquire the parts, but the places listed below are the suppliers I used and have used repeatedly without issue. Consistently good service is one of the things I think about and I put this before being thrifty to extremes. For example, I have been waiting for a few parts from mainland China... since July! (I do believe there really are slow boats...) On the other hand, I ordered some parts Monday from phanderson.com and received them today, two days later. Do what you need to do to stay within your budget, but even if you have to buy everything, you are in the sub-$20 range (of course, you may have to pay a little more because of minimum quantities and shipping but you will have some parts left-over for another project.)
Bill Of Materials:
Item Long Description Suggested Source Note
- PICAXE PICAXE-08M2 (8-pin DIP) http://www.phanderson.com/picaxe/
- Thermistor 10K neg temp coeff http://www.phanderson.com/picaxe/picaxe_thermistor.html
- Protoboard* AXE021 - PICAXE-08 Kit http://www.phanderson.com/picaxe/ ONLY for PC with SERIAL PORT
- Protoboard* PICAXE USB Protoboard http://www.phanderson.com/picaxe/ NEEDED only for USB chip programming
- 6V battery 6V Lantern Carbon/Zinc Harbor Freight / Wal-Mart / Sporting Center
- 7805 5V voltage regulator http://www.radioshack.com/product/index.jsp?productId=2062599
- 470uF cap Electrolytic capacitor http://www.radioshack.com/product/index.jsp?productId=2103624 (see text)
- 100nF cap ceramic or polyester Comes with phanderson's protoboards or procure from Radio Shack
- 10K x 2 1/4W resistors 5% http://www.radioshack.com/product/index.jsp?productId=2062347
- 22K 1/4W resistor 5 % http://www.radioshack.com/product/index.jsp?productId=2062331
- LCD** Dual 2 line x 16 character http://www.ebay.com/itm/Lcd-Display-16-x-4-Lines-Serial-Cable-Micro-/350219967924?pt=LH_DefaultDomain_0&hash=item518abc9db4
- Pitcher 1G MainStays 1 Gallon Wal-Mart 73149-49009 about $2
- Misc Wire, solder, hobby knife, soldering pencil
* If you purchase your PICAXE chip from phanderson.com it will come with one 22K and one 10K resistor. If you purchase the serial port protoboard, it will come with one 22K and one 10K resistor, an IC socket, and the small bypass capacitor. If you purchase the USB protoboard and programmer, it too will come with the 22K and 10K resistor. Please note that if you intend on using the USB programmer you will still need to purchase the AXE021 protoboard or you will have to utilize some other protoboard for circuit construction and inclusion in the project or purchase something like this: http://www.sparkfun.com/products/9260
If you do not wish enclose the project as shown, then only one of the protoboard is required. I used one of these: http://store.fungizmos.com/index.php?main_page=product_info&products_id=189&zenid=4a48db672a7555696946b3443533d84d
** You will need to use a solder pencil and some solder-wicking braid or vacuum sucker to remove a solder pad on the LCD as described in the LCD description on eBay: "...remove the solder from J3 then it is 4800 8N1" The PICAXE code requires this modification! I have, using modified code, used both a SparkFun 9600 Baud and a Scott Edwards 9600 Baud display, both 2-line x 16-characters.
Step 2: Electronic Construction
Once all of the parts have been gathered and cataloged, I would suggest building the PICAXE circuit before moving on to the more mechanical fitting of the display, etc.
PICAXE chips come "blank" without a program; therefore they must be programmed with the Pitcher Perfect Thermometer code. This requires a free programming tool from the manufacturer in the UK. You will need to download and install the program on your PC. Here is the link for Windows users:http://www.picaxe.com/Software/PICAXE/PICAXE-Programming-Editor
Using either the USB or the Serial programming protoboard, load the basic code into the editor, select the correct communication port, and program the PICAXE. The editor will provide you a status of the programming and identify any errors encountered. If you get into trouble, search for PICAXE projects on Instructables... there are many that go into great detail about the programming setup and requirements.
Once the PICAXE is programmed, disconnect the power. You will want to connect the 7805 (or 78L05) on the protoboard. If using the larger 7805, you can solder short, solid wires to the IC and use those wires for insertion into the protoboard. A 78L05 should fit somewhere in the empty area of the protoboard. Essentially, the "input" will got to the 6V positive of the lantern battery, the output will go to the PICAXE board for +5V and the GND connection will be common to the PICAXE and to the battery negative "-" terminal. If you got a screw-down battery, the connections will be easy, if you got a spring-contact battery, you will need to solder the wires to the springs. No switch is uses since this is an always-on circuit, but you can add a switch if you like in the wiring between the battery + terminal and the input to the 7805/78L05. Here is how it is all connected: http://t2.gstatic.com/images?q=tbn:ANd9GcTNahVOfCj7-6kIHfjXnXJtyLZKU2FxpIvBKf-NCz7abudvh3gt EXCEPT in our case, we will NOT use the 100nf capacitor between pin 1 and pin 2 and we are using a larger electrolytic capacitor because it is readily available at Radio Shack but feel free to use almost any value of electrolytic between 10uF and 500uF provided the voltage is rated at greater than 10V.
The temperature "sensing" component is the 10K thermistor. The 5% precision 10K resistor and the 10K thermistor form a voltage-divider and the junction of these two devices is connected to the PICAXE physical PIN #3 (count from the top-left down and from the bottom-right up.) One end of the thermistor is grounded and one end of the resistor is at +5V. PIN #3 is known to the software as port C.4 and this input port is configured in the PICAXE as an analog to digital converter. What will happen is that the PICAXE will generate a binary number for every change in the voltage on the junction of the resistor and thermistor. As the temperature gets hotter, the resistance value of the thermistor becomes lower (voltage drop becomes smaller, that is the voltage is smaller and closer to Ground or 0V.) The internal analog to digital converter provides a numerically lower number the higher the temperature. In thermistor language, the thermistor is said to have negative temperature coefficient (NTC).
Here is the big picture (or is that pitcher?)
- Junction voltage at resistor-thermistor is converted to a binary number
- The binary number is analyzed using a look-up table of temperatures stored in the uC EEPROM
- The temperature is converted to an integer (whole) number and a decimal (digit) number as 2 variables
- The variables are displayed on the LCD with a decimal between them to give the traditional "NN.N" format
- Variables in software hold the high value and the low value since power-on as history
- The process is repeated about 1 each second
The circuit with LCD draws about 0.009A or 9 mA. So, the 6V lantern battery should last a while before requiring changing. If you wish and are so inclined, a nice addition would be a photocell on physical pin #5 (lower-right) which would drive a voltage to the port C.2 (also used for calibration) to disable the display when the light level were too dark to read same. (Yes, you will need to do some coding to implement this functionality.)
I have mentioned calibration a couple of times. When the PICAXE is programmed, a value that I derived as a "generally good" number is included in the code. This number will give an approximate temperature or one that is in the ball-park. If you like things to be absolutely perfect, below is how it is done... you will need a 10K variable resistor of the "linear" variety and a few jumper clips and wires. (Updated 20110923 to enhance calibration)
- Power off the PICAXE
- Add a jumper wire between physical pin #4 (port C.3) and connect the other end to ground / GND
- Connect one end of the 10K linear potentiometer to GND
- Connect the other end of the 10K potentiometer to +5V
- Connect the 10K potentiometer wiper (variable) to physical pin #5, port C.2 (another AD input)
- Power on the PICAXE
- Using another thermometer turn the potentiometer until the temperature on the LCD is correct
- If a value of "0" does not bring down the temperature enough, wait 5 seconds on "0"
- If a value of "255" does not bring up the temperature enough, wait 5 seconds on "255"
- Let the display stabilize for at least 10 seconds
- When the temperature reading is correct, pull the jumper wire off of pin #4
- When the jumper is removed, a new calibration is written into the PICAXE EEPROM
- Power off the circuit
- Return everything the way it was (remove jumper and potentiometer)
- Upon power-on, the new value will be utilized and the thermometer should be within 1/2 degree of accurate
- If the reading does not agree, repeat until accurate
Step 3: Physical Construction
OK, if you are prone to cutting yourself with sharp objects, you may wish to enlist the assistance of someone with strong, sturdy, steady hands. The use of the utility knife to cut the plastic pitcher may create several hazards - a non-extensive list would include breaking of the utility knife blade, slipping of the blade, flying metal pieces of the blade, and so forth. Therefore, exercise caution, wear eye protection, and wear safety gloves. When cutting the plastic, many repeated, slight strokes of nominal pressure will gradually cut the plastic without undue pressure or stress on the blade.
- Create a template from clear plastic - I used an old overhead projection sheet
- Align the plastic on the pitcher and pin or tape
- Score the plastic with the utility knife using a new blade
- Go slowly and carefully and avoid over-run of the desired size
- Check often using the real LCD
Note: A small number of pre-programmed PICAXE 08M2 are available for those individuals that do not wish to invest in the programming environment/hardware. Please send an email to email@example.com if you wish information.