Summary of Quozl’s Temperature Sensor Project using PIC12C509
This article describes a low-cost, 8-pin microcontroller circuit for logging temperature data via a serial port. It supports up to four DS1820 sensors, offering high accuracy and real-time data transmission without an external power supply. The system operates at 2400 baud, displays temperatures in Celsius or Fahrenheit, and requires no special software on the host computer.
Parts used in the Temperature Logging Circuit:
- 8-pin microcontroller (PIC12C509)
- DS1820 temperature sensors
- Serial port interface
- Header pins
- PCB (Printed Circuit Board)
Introduction
Just a handful of components builds an 8-pin microcontroller based circuit for temperature logging via a serial port; small, fast, and acceptably accurate.
Features
- provides real-time data to your computer via serial port,
- interfaces up to four DS1820 temperature sensors,
- absolute accuracy near 0.5 degrees celcius (as per DS1820 specifications),
- relative accuracy near 0.01 degrees celcius,
- speaks in Centigrade or Fahrenheit (selectable by header pins),
- powered by your computer’s serial port, no extra supply to organise,
- data format easily processed, no special programs required,
- minimal parts count reduces cost,
- built-in serial number for circuit identification,
- special versions available for exotic requirements; high speed, low speed, additional sensors, long distance or pedantic serial bus.
- spare inputs can be used as single-bit digital inputs, (feature removed from final version but can be re-inserted),
Applications
A few ideas of how this circuit can be used:
- simple weather reports for web pages,
- computer power supply temperature warnings,
- redundant critical systems monitoring,
- house temperature monitoring,
- complex home automation tasks (start fan if warmer outside during winter),
- refrigerator testing,
- brewing temperature regulation,
- fish tank heater verification,
- microclimate logging (ground versus air temperature),
- daylight sensing (LDR on digital input),
- primitive locking (using serial number),
- remote monitoring of emu fat in a freezer truck,
Availability
The electronics kit maker Kitsrushas released a PCB and kit of this design. Other kit sellers also sell the kit. Here is a summary:
| Country | Organisation | Item Number | GPL Compliance | Date Checked |
|---|---|---|---|---|
| Australia | Ozitronics | K145 | Complete | 13th June 2003 |
| United States of America | Carl’s Electronics Inc | CK110 | Partial | 13th June 2003 |
| Kingston, Ontario, Canada | QKits | QK145 | Complete | 13th June 2003 |
| Hong Kong | Kitsrus | K145 | Complete | 13th June 2003 |
| Denmark | eekit.dk | 0104-K145 | Partial | 29th November 2004 |
(If you also sell this kit, and you would like to be added to the list, please write to me, including your country, organisation name, links to your web site and to the kit page. There is no reciprocal link condition. You may be asked to provide a link to this page, but that is for compliance with the software license.)
Theory of Operation
The program in the microcontroller knows two protocols; the one wire bus used by the DS1820 temperature sensor, and the serial protocol expected by your computer. Once power is applied, the program fetches data from the sensors and sends it to the serial port, repeatedly.
The data from the DS1820 arrives in a format peculiar to the sensor. The program calculates the temperature from the data and translates it into human readable ASCII digits. No special program is required on the computer.
Usage Instructions
Plug the circuit into the serial port of a computer. Persuade the computer to expect serial data at 2400 baud, 8 bits, no parity, one or two stop bits. Ask the computer to raise the DTR signal. (See below for software that will do this for you.) The microcontroller will start talking to the connected DS1820 sensors and the circuit should begin transmitting data to the computer. For example:
For more detail: Quozl’s Temperature Sensor Project using PIC12C509
- How many DS1820 sensors can this circuit interface?
The circuit interfaces up to four DS1820 temperature sensors. - Does the circuit require an external power supply?
No, it is powered by the computer's serial port. - What is the absolute accuracy of the temperature readings?
The absolute accuracy is near 0.5 degrees Celsius as per DS1820 specifications. - Can the circuit display data in Fahrenheit?
Yes, the unit speaks in Centigrade or Fahrenheit, selectable by header pins. - What serial communication settings are required?
The computer must expect serial data at 2400 baud, 8 bits, no parity, and one or two stop bits. - Does the project require special programs on the computer?
No, the data format is easily processed with no special programs required. - What protocol does the microcontroller use for sensors?
The program uses the one wire bus protocol for the DS1820 sensor. - Is there a built-in identifier for the circuit?
Yes, the circuit has a built-in serial number for identification.
