The DS18B20 is a digital temperature sensor which returns results directly in Centigrade and has a resolution to 0.0625C. The DS18B20 connects to a single PICAXE I/O line for use.
Because the reading from the sensor is digital and directly in Centigrade it is often easier to use, and without calibration, than a thermistor.
DS18B20 Digital Temperature
Schematic
PCB
Read a temperature
This program will read a DS18B20 temperature sensor connected to input pin C.0 and report the temperature reading in the 'b1' variable.
- Code Example:
-
main: readtemp C.0, b1 ; Read the DS18B20 temperature debug ; Display the reading pause 1000 ; Wait a while goto main ; Repeat
Copy Code Submit an Example
Create Module
The DS18B20 create module provides an digital temperature reading for the PICAXE on the motherboard.
Bill of Materials
Description | Code | Qty | |
---|---|---|---|
DS18B20 temperature sensor | ICO011 | 1 | Buy Now |
4k7 resistor (pack 100) | RES4K7 | 1 | Buy Now |
Simulation
Submit Your Own Code!
You must be logged in to submit code examples. Login now.
Share