c & c++ - DS1821Thermostat Programmer

Contact
PC-compilers
last-news
PIC-microcontroller
AVR-microcontroller
Supports
weakly newsletter
c++
Counter
DS1821Thermostat Programmer
pic-asm-foundations
free links downloads
free downloads
mikroc library
PWM software
Home



 

 

DS1821 Thermostat Programmer

Introduction.

We have the ability to quickly develop a small kit which will allow a user to program DS1821s for use as thermostats. If you are interested, please contact me.

The kit will consist of a Microchip PIC, resonator and GLCD nokia 3310 display  The idea is that the user plugs in the DS1821 to be programmed and the user communicates with the PIC using a menu to set the high and low trip points and the active state. Once programmed the user removes the DS1821 and places it in service as a standalone thermostat. Typical applications might be an attic fan, ventilating a barn or greeenhouse, or freeze alarms.

The Dallas DS1821 is a three terminal device available in either a TO-220 or PR35 package. We sell these for $3.50 each as a part of one of our temperature monitor kits. However, the device may be programmed to operate as an inexpensive standalone thermostat. The big obstacle for the hobbyist is the 1-wire protocol to set the high and low trip points and place the unit in the thermostat mode. This kit reduces the programming to one of simply entering the data from a terminal.

Details.

The DS1821 in the Thermostat Mode.

When in the thermostat mode, the DQ lead on the DS1821 is the thermostat output. When the temperature goes higher than a T_H trip point, the output goes to the active state. When the temperature falls below a T_L trip point, the output goes to the opposite state. Note that the high and low trip points are programmed in EEPROM and are thus nonvolatile.

For example, in an attic ventilation application the high trip and low trip points might be programmed to 90 and 75 degrees F and the "active" state programmed as 0. Thus, when the temperature rises above 90 the DQ output goes to a logic zero (near ground) which might turn on a "hockey puck" style solid state relay which turns on a fan. The fan will stay on until the temperature falls below 75 when the DS1821 output goes to a logic one (open).

In a freeze alarm application, T_HI might be defined as 45 degrees F and T_LO as 35 degrees and the "active state" as logic one. When above 45, the output is a logic one and when it falls below 35, the output goes low. This might turn on an alarm or a heater.

Note that the logic one state is an open. By making a zero the active state, many units may be wire ored to a single alarm and the source of the alarm established by opening switches at a central point. The logic zero state is near ground with a maximum sink current of 4 mA.

The DS1821 may be powered with 3.0 to 5.5 VDC. In the thermostat mode, the unit is continually performing temperature measurements and thus the current is as high as 1000 uA which tends to rule out battery operation for any extended period. However, a wall power unit and 7805 regulator are both inexpensive and in applications where multiple thermostats are being used, three conductors may be bussed from one unit to another.

Another feature of the DS1821 are two EEPROM flag bits, temperature high flag (THF) and temperature low flag (TLF). These might be cleared during the programming. If during operation the temperature exceeds the T_H trip point or goes below the T_L trip point, the appropriate bit is set.

This might provide an extremely inexpensive monitor for temperature sensitive air or truck cargo, say bananas, strawberries or medicine. The flag bits might be programmed prior to shipment and then read prior to accepting the order or the unit might be tagged and mailed to a quality control center. Admittedly, this does not provide information as to how long the temperature was out of range, but the cost may make such montoring practical in applications where the cost of data logging is not cost effective. Note that a battery is necessary during shipment, but shipments tend to be less than a week and a 100 or 200 mAh battery is practical.

The Programmmer.

the programmer presents the user with a menu selection;

  • 1. Read and display the DS1821 data (T_H, T_L, Active State, THF and TLH)
  • 2. Set data
  • 3. Display Temperature
  • 4. Test
  • 5. Program in Thermostat Mode.
  • 6. Program in Temperature Mode.

In the test mode, the programmer unit places the DS1821 in the thermostat mode allowing the user to apply heat or cold. When either the high or low trip point is crossed, the programmer unit returns the unit to the temperature measurement mode and displays the temperature. Thus, in familiarizing yourself with the unit, you might display the temperature and set the T_H trip point a few degrees higher. Then, enter the Test mode and warm the DS1821 with your fingers.

Thus, a typical scenario might be to enter the terminal emulation program and reset the programmer. In the transport application, the user may wish to view the THF and TLF flags from a prior shipment.

The data (T_H, T_L, Active State, THF and TLH) is entered and this is programmed in the DS1821. The user may verify this using the Read command.

Prior to closing out the sequence, the user would program the DS1821 in the thermostat mode such that when power is next applied, the DS1821 operates in the thermostat mode. However, provision is made to program the DS1821 to be used in the temperature measurment applications.


ein Bild

 

DS1821 PROG_project details.

DS1821 PROG Project

Compiler

Mikroelectronika C compiler V6.2.0.0

Target

18F452 (retargetable to other PICs ).

Software level

Medium.

Software notes

1BUS SYSTYM

Hardware level

Easy.

Hardware notes

No special notes

Project version 1.00

Initial Release

Project files

 hex-file    eagle_files

You can program the PIC in circuit through the ICSP connector.

We have the ability to quickly develop a small kit which will allow a user to program DS1821s for use as thermostats. If you are interested, please contact me.

Today, there have been 17 visitors (35 hits) on this page!
This website was created for free with Own-Free-Website.com. Would you also like to have your own website?
Sign up for free