Sunday, December 22, 2024

Digital Thermometer-Cum-Controller

The software

The software for the temperature controller is compiled using Bascom51 version. The demo version of Bascom-8051 is available on MCS Electronics.

First, define the crystal speed and include the header file for microcontroller. Initialise all ports to ‘0.’ Timer-0 is used as an internal counter and increments by a second. This is used here for timing delays. Pin P3.0 of the microcontroller is configured for single-wire communication. Normally, DQ pin (single-wire bus) of DS1821 is high. Through DQ, the device gets its power to perform tasks.

- Advertisement -

When the microcontroller waits for the event through single-wire bus, it issues a reset command. Then DQ goes low for some time. This resets the device and it acknowledges a pulse and then follows the microcontroller. The communication on the single-wire bus is initiated by the microcontroller, and issued by low time slots on a normally-high DQ line, issued by the device.

Declare the variables as bits, bytes and words. Define the various port pins as per the connections. Set the maximum temperature to ‘40’ as default. Subroutines ‘dispset’ and ‘disptemp’ are used for display preset and real temperature, respectively. The source program is well commented for easy understanding.

- Advertisement -

Download PCB and component layout PDFs: click here

Download Source code: click here

10 COMMENTS

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Truly Innovative Electronics

Electronics News

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics