Practical project allowing to monitor the temperature using Rasperry Pi 4B microcomputer and DS18B20 sensors. Here temperature in the fridge is being controlled, but it can be versatile and room temperature could be monitored for instance as well.
Sensors have to be properly connected to Raspberry Pi using breadboard, and python module w1thermsensor
is used to retrieve the temperature registered by the sensors. Based on that, temperature can be constantly monitored, e-mail notifications can be sent when temperature is unexpectedly low/high, and saved data can be plotted on a graph.
Below hardware setup is shown with sensors located in the fridge and connected to Raspberry Pi through a breadboard.
This image from a generated graph is clearly showing that refrigerator is not working correctly, especially freezer with it's high amplitude.
Generated data extract and results printed in Thonny IDE are visible below.
And here is an e-mail notification that was generated.
As an enhancement of the project, additional script was added, which is sending the data to InfluxDB
, a timeseries database. It can be connected to Grafana
, monitoring tool, allowing real-time dashboard to be available.