D T S K: Igital Emperature Ensor IT
D T S K: Igital Emperature Ensor IT
Introduction
The DS18B20 is a digital temperature sensor that will output temperatues between 55 to + 125 degrees Celsius. This makes it simple to solder to wires or printed circuit boards. The advantages of a digital temperature sensor are principally with its precision output. As the sensor outputs a calibrated digital reading, the output is an exact temperature in degrees Celsius. This means no other components, such as an analogue to digital converter, are required within the electronic circuit to calibrate or amplify the signal. This is much simpler to use than, for instance, a simple thermistor which provides a non-linear resistance change with temperature variation, which makes it very difficult for students to calibrate exact temperature thresholds within their projects. It will also fit within the thin stainless steel tubes commonly used for thermocouples, making an instantly waterproof case.
V+ DQ 0V, GND
4.5V
C1 4k7 10k V+ iButton DS18B20 sin in4 in3 1 2 3 4 8 0V out0 out1 out2
J1
D1
output
C2
08M
7 6 5
1k TR1
piezo
0V
The circuit is based around an 8 pin microcontroller, the low-cost PICAXE-08M. The circuit is fairly self-explanatory and includes the following features: temp sensor switch piezo sounder output pin output LED (input 4) for reading the signal from the DS18B20 sensor (input 3) optional digital input switch (active low) (output 2) for generating beep sounds for user feedback (output 1) for driving an output device such as solenoid or motor (output 0) indicator to show temperature value
revolution
Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 05/2010
AXE1 13.PMD
' LED on
' heater on
Sensor Test Program This PICAXE displays the temperature value constantly on-screen. main: readtemp 4,b1 debug b1 pause 250 goto main ' read temperature ' display on screen ' short pause
revolution
Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 05/2010
AXE1 13.PMD
red black
+ PWR
- +
V+ DQ 0V, GND
4k7 resistor (yellow violet red gold) 1k resistor (brown black red gold) 330 resistor (orange orange brown gold) 10k resistor (brown black orange gold) 22k resistor (red red orange gold) 1N4001 diode 100nF polyester capacitor 5mm LED BC548B transistor piezo sounder 2 pin terminal block (may be supplied as 4 way - snap into 2x2) stereo download socket PICAXE-08M microcontroller and 8 pin socket DS18B20 digital temperature sensor printed circuit board, battery snap and 4.5V battery box Note that part C2 is not required for this project.
Assembly: 1. Solder the resistors and the diode D1 in position, ensuring the white bar of the diode is to the right. 2. Solder a resistor leg as a link between the two outer + holes on jumper J1. 3. Solder the 8 pin IC socket in position and insert the microcontroller. 4. Solder the capacitor C1 into position. 5. Solder the transistor Q1 into position, ensuring correct orientation of curved edge. Solder the LED in the LED position at the left side of the board. 6. Solder the digital temperature sensor via wires to the board as shown in the digram above. Note the pads are unmarked on the board. 7. Solder the piezo in position, red wire to +, black wire to -. 8. Solder the stereo download socket into position, ensuring it clicks flat onto the PCB. 9. Solder the terminal blocks into position. connect the battery snap to the power connector CT2 (V+ red, 0V black)
revolution
Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 05/2010
AXE1 13.PMD