Dallas DS18B20 Temperature Sensor
PICAXE-18M2 with Dallas DS18B20 Temperature Sensor
The Dallas Semiconductor DS18B20 Centigrade temperature sensor is accurate, cheap, and easy to use. This fits perfectly with a PICAXE micorcontroller with built in routines to operate the component. A single input pin is all that's needed. The program below displays the temperature on a terminal. Note that the PICAXE-18M2 does not do decimal points.
The best applications include a simple heat controller operating a solid sate relay, etc. Also, PICAXE-18M2 Pin Connections.
#picaxe 18m2 ; type chip used ; set internal frequency of PICAXE to 4 mHz. ; setfreq m4 ; All M2 - k31, k250, k500, m1, m2, m4, m8,m16, m32 ; set terminal 4800, must be run at 4 mHz.; readtemp page 184 symbol sensor_pin = B.7 symbol temperature_value = b0 main: pause 1000 ; 700 mSec delay between readings readtemp sensor_pin, temperature_value sertxd("T C : ", #temperature_value, " deg.", 13, 10) goto main
Picaxe Micro-controller Projects!
The PICAXE series of micro-controllers rank as the easiest and most cost effective way to use Microchip processors. I wanted an easier and less expensive way to introduce my students to the "PIC" micro-controller. Here I hope to get those starting out past poorly written literature and lack of simple working code examples.
- PICAXE Related videos Oct. 2016:
- Tutorial: Programming-Using PICAXE-18M2 Microcontroller
- How to setup PICAXE Pulse Width Modulation
- PICAXE TA8050P H-Bridge with Motor Control
- PICAXE TA8050P H-Bridge with Motor Speed Control
- PICAXE-18M2 Operates MOSFET H-Bridge
- PICAXE-18M2 Uses MCP23016 GPIO Expander
- Solar Panel Charge Controller Using PICAXE Microcontroller
- Exploring the PICAXE Micro-Controller
- Understanding Micro-Controller Input/Output Ports
- Using the 74HC165 Shift Register with the PICAXE Micro-Controller
- Connecting the 74HC595 Shift Register to PICAXE Micro-controller
- Using 7-Segment Displays with the PICAXE Micro-Controller
- Potentiometers and Analog-to-Digital Conversion with the PICAXE
- Pulse-Width Modulation Motor Speed Control and the PICAXE Micro-Controller
- Connecting the PICAXE to the DS1307 Real Time Clock
- Connecting the PICAXE to an External EEPROM (24LC08)
- Connecting a Servo to a PICAXE
- Connecting the TLC548 to the PICAXE
- Connecting the Ad5220 Digital Potentiometer to the PICAXE
See How I got into Electronics