Electronic – arduino – Short-term data storage in between wake cycles

arduinosensorsleepstorage

I've been working on making a gardening system using an Arduino or an ESP32. To conserve energy, I will have the MCU sleep for long periods of time (I was planning on using pin-change interrupts to wake it up). It would be very useful to log sunlight and soil moisture data over time, but without having to wake up the MCU every 10 minutes or so to log it. So, I thought about storing or accumulating this data in a temporary storage area until the MCU woke up and logged the data (probably on a webserver).

I was thinking about using a simple solution, like analog electricity meters in houses, but I'm not sure if this is feasible. EEPROM also seems like an option, but that might be overkill.

So, is there a good method of simple short term storage I could use to lengthen the amount of time between when the MCU needs to log the data? Thank you for your help.

Best Answer

I made a temperature and humidity logger a while ago. It used an Atmega328P on a custom board. Logging is done to an SD card with a level-shifting interface board.

Temperature logger photo

That runs from 3 x AA batteries. I think I've only changed the batteries over once in the last 3.5 years.

The LED display is only occasionally used, to tell you the temperature right now if you press the red switch (plus other stuff like the date/time, the count of writes to the SD card, and the number of errors).

According to my calculations on that page when asleep it uses 6 µA, and averaging out the time taken to write to the SD card that adds 36 µA extra. Still, 42 µA is below the self-discharge rate of the batteries.

From time to time I pop the SD card out of its holder and download the resulting data.

The overall schematic is here:

Temperature logger schematic

Code and other details are available on the page I mentioned above.