Marco asked me if it was possible to connect a DS18B20 temperature sensor to my ATtin84 LoRa Node. Challenge accepted and changed the code for using the DS18B20 node. This post is for explaining the this configuration and has a link to the code.
The DS18B20 is an onewire temperature sensor. I use the DallasTemperature Arduino Library for reading the sensor. The Data sensor is connected to ATtiny pin PA7 = Arduino pin 7 in the software.
The code for the sensor can be found here: https://gitlab.com/iot-lab-org/attiny_lora_node_ds18b20. The code is programmed and compiled with the PlatformIO IDE. With this code you can read 1 sensor. It should be possible to read more sensors with the DallasTemperature library: Now reading
getTempCByIndex(0). You should be able to read next index. Remember to send 2 extra bytes to your LoRa backend at “
// move into bytebuffer” I did not test with multiple sensors.
I made a testmodel with a shielded DS18B20 sensor, so I can also measure liquid temperature. The electronics is compacted in a Lab-tube.
In my test the first measurements after booting the node give a 85.0 Celsius temperature.
I measured the voltage and current in sleep mode. The values are an indication.