AVR 1-Wire slave with DS18B20 temperature sensor

This project demonstrates a complete 1-Wire slave implementation to connect a 1-Wire temperature sensor with local display to the 1-Wire bus.

foto of the prototype

The central part of this circuit is an ATTINY45 controller. The controller is both 1-Wire slave and master. At the master side is a DS18B20 1-Wire thermometer connected. A DS18S20 may be used as well. At the slave side the controller acts exactly as the connected DS18B20. There are two shift registers connected to the controller to drive a 3 or 4 digit multiplex display. The actual firmware drives three digits but can simply adjusted for one digit more.
The ATTINY45 does temperature conversion in a loop and displays the actual value at the local display. For the sensor parasite power is used, so a conversion takes little less than one second. But on the 1-Wire slave side the ATTINY45 delivers immediately the last conversion result. No wait for conversion is needed.
As surplus the internal 2048 bits EEPROM of the ATTINY45 can be accessed from 1-Wire bus with the standard commands for iButtons. It may be used to store minimum and maximum or mean values.

The source code is available here.

project goals

  • display temperature near the sensor
  • assimilable into existing 1-Wire systems without change of software
  • acts like a standard temperature sensor 1-Wire slave
  • no wait for conversion needed when reading temperature
  • additionally EEPROM accessible with iButton protocol

The schematics is available for download here.

1wire-slave-temperatur-schematics

 

Receive updates directly in your inbox

Loading

 

Leave a Reply

Your email address will not be published. Required fields are marked *