Main Content

Temp and Humidity Monitor with Graphs and Battery Monitor

Monitor to record temperature and humidity, store 24 hours history and display these in a graph. Battery level monitor screensave.

The project is an evolution of my project “Very low power temp and humidity monitor with min and max”. I wanted to extend this to store 24 hours of history and display this in a graph. As explained below, I had to remove the code that put the processor to sleep so I also added a battery level indicator so I know when it needs recharging.

I encountered a couple of issues with extending the project:

- Initially I added an array to store the temperature history int tempHistory[96]; this worked well, however as soon as I added a second array to sore the humidity history int humidHistory[96] the program would no longer run. It compiled and uploaded but did not even run setup(). Even though it appeared that there was plenty of spare program and variable space, the only conclusion I could come to was that it was running out of memory. Hence, I changed track and am now storing the history in EPROM.
- In the linked project I reduced the power consumed to increase battery life by invoking a sleep mode. The issue with this is that it stops the timers being triggered and hence millis() does not advance during the sleep period. This was an issue as I wanted to store the readings every 15 minutes (96 per day) and there was no way of tracking elapsed time while sleeping. Hence I have removed the code to activate sleep mode. As removing sleep mode will reduce battery life, I added battery monitoring so I know when the battery is getting low.
- Finally, I added a screen saver displaying the battery level that is moved every 10 seconds.”

Link to article