The DS1621 is a very accurate and easy to interface chip. It has a built in temperature sensor and using I2C protocol, can send very accurate temperature readings. The interface of I2C is just 2 wires, one Data and one Clock. What makes this chip even more handful is that it comes with a 3-bit address. This means that with those 2 wires, up to 8 chips can be interfaced and accessed by it's address!
The circuit in operation
The DS1621
The DS1621 chip is very accurate
The DS1621 is a very simple-to-use chip for measuring temperatures. One great advantage is the high accuracy that it has and the wide measuring range. It can measure form -25oC to +110oC with maximum error 0.5oC near the edges. For room temperatures, the error is almost zero.
Furthermore, each chip is hardware addressable. Using just 2 communication lines from the microcontroller, up to 8 chips can be cascaded and separately controlled by it's pre-selected address. The communication is done using standard 2-wire I2C protocol.
The temperature is returned from the chip with 2 8-bit bytes. The first one is the temperature in degrees (no conversion needed). The second one is the half-degrees. Using only those registers, you can have a 0.5oC step. But there are 2 more registers in the chip that can be used, and using a formula, this step can be significantly decreases, increasing with this way the accuracy. This circuit will not use those registers and thus, a step of 0.5oC will be used, which for room temperature monitoring is already enough.
Finally, this chip can be a stand-alone pre-programmed thermostat. It has an output that becomes high when the temperature exceeds a pre-programmed value, and turns back low when the temperatures goes bellow another pre-programmed value.
The Circuit
What i have design here is a dual temperature meter. I use two DS1621 chips. The first one has the address 000 (0) and the other one the address 001 (1). The address can be hardware selected from the package pins A0 A1 and A2. The same circuit with very slight modifications in the PIC program can be used to interface up to 8 chips. For addressing, i use one 4-dip switch on each chip. I use of course only the 3 first dip switched. On the real PCB, this switch can be replaced with permanent wiring to reduce cost and size. Here is the schematic diagram:
As already has been told, the DS1621 uses only two wires for interface. The Data bus comes from the RC6 I/O of the PIC, and the Clock bus comes from the RC7 I/O. Furthermore, the Data bus needs a pull-up resistor. An 1K resistor is enough. Higher values may cause problems as the rise and fall times will be higher. Finally, the LED is blinking every time a new measurement is taken.
Downloads
Here are all the files needed as well as the full assembly listing, to re-compile the program:
At 29 October 2012, 4:02:11 user mecs wrote: [reply @ mecs]
@Giorgos Lazaridis
Thank you for the quick response. I did the tutorial you gave and tried to simulate using protues.. and its working fine, although I still have a lot of time just learning a basic of this..
@John Doe "1SHOT = One Shot Mode. If 1SHOT is "1", the DS1621 will perform one temperature conversion upon receipt of the Start Convert T protocol. If 1SHOT is "0", the DS1621 will continuously perform temperature conversions. This bit is nonvolatile."
The I2C is of course essential to initialize the chip and set the temperature and hysteresis. Afterwards it can run as a stand-alone thermostat.
If a +-2 degrees typical accuracy is ok, you can use some very cheap NTC (or PTC) thermistors. Look these:
http://pcbheaven.com/exppages/Experimenting_with_a_thermistor
Any PIC with A/D module will do the work.
Higher accuracy can be achieved with LM35 for example, again you need a PIC with A/D module.
You can use a DS1621 digital thermometer with I2C interface protocol. For this, you can use whichever PIC you like, because you can implement I2C in software. DS1621 is very accurate but somewhat expensive.
I have quite a big request. I was wondering if you could make a project similar to this one but that it had 2 relay outputs and three buttons to navigate on the LCD.
It would be great to turn the relays manually ON/OFF and automatic if the temperature on one of the sensors rises over a specific temperature lets say 50°C.
would that be possible because i am making a room thermostat and i am not so good at code writing.
Hi Van Luu. First of all, click on the schematic diagram to enlarge it to full size... That will solve your "bluring" problem. The image is 2000x1000 pixels which is rather big... As for the components, i can answer your future questions. R4 is limiting resistor for the LED, R3 is pull up resistor for the data line of the I2C lines, R1 adjusts the contrast and R2 the backlit brightness. I have all the datasheet needed for the display and the DS1621. If you have more questions, i wait for them.
My name is Van and studying in the Royal School of Technology in Stockholm. I was looking around the net for some help and found your interesting project. We're a couple of students studying an electronic project where we have a similiar task.
I saw the diagram but do you have something more detailed because it's hard to see every component that is used?
Also, could you tell more about what every component does? There is a couple of more questions I would like to ask if it's okay with you later on.