Close
0%
0%

Low Power Environment Monitor / Logger

A small board that measures temperature, humidity and pressure every hour for five years.

Similar projects worth following
This is a board with a bme280 pressure, humidity and temperature sensor, a ds3232m realtime clock, and 4MB of flash memory. The clock wakes up an atmega328p, it takes readings and stores them, and then goes back to sleep. A low dropout, low quiescent current voltage regulator provides 3.3v power to the board from an external battery.

I built this to be buried inside a time capsule (though it has plenty of other uses), so it has to be able to survive freezing temperatures, and should last at least 5 years without maintenance. A quick calculation of current draw on my prototype says that it should be able to run for about 15 years (!) on AA batteries, and there is plenty of room in the flash memory for hourly measurements (15ish years worth).

This project is a bit scattered, which tends to happen when you only check in on things once a year or so. Latest version of hardware/software here: [https://github.com/alnwlsn/envilog3]

This project takes inspiration from many of the other similar low-power loggers on this site, but especially from the Cave Pearl project which I discovered about halfway through prototyping on this one. Instead of using several cheap modules, the heart of the data logger is distilled into just a few critical components.

The following software was used in the program for this device:

- Arduino MiniCore hardware package. The board is programmed like a normal arduino board with the arduino bootloader, but this package makes it easier to get a bare 328 chip working with many of the power-heavy features disabled.

- avr/power, avr/sleep, Wire, SPI arduino libraries, included with the arduino IDE.

https://github.com/Marzogh/SPIMemory - for using the external flash memory chip that stores the measurements

- The SparkFun BME280 library - For configuring the BME280 sensor

To make the project itself: 

- Make the board and assemble the components onto it.  Everything is surface mount except the sensor board, which is an Aliexpress special. 

- Flash the 328 on the board with the Arduino MiniCore bootloader. Make sure that the BOD is disabled, and the 8 mhz clock speed is selected. I tried 1 mhz as well, but found that the flash chip did not work well at this speed. The 328 can be programmed with ICSP, just like flashing a normal Arduino. The reset line, VCC and ground pins are brought out on the outside 5 pin header. The remaining SPI pins needed for ICP can be connected to either some test points on the board, or by clipping onto the legs of the flash chip.

- The board can now be programmed with a usb-serial adapter like any other arduino board. The tx and rx pins on the board connect to the rx and tx pins on the usb-serial device. The reset pin on the board connects through a 0.1uf cap to the DTR pin on the usb-serial, because I didn't include one on the board. Upload the main program.

- Push switches 1 (clock set) , 2 (flash erase) and 4 (status) on, and connect the board to a serial monitor and power (between 4 and 15 volts).

- Use the single button to set the clock following the serial terminal instructions. For example, to set the first parameter, the year, to 2018, press the button repeatedly until 18 is shown, then wait 2 seconds to continue. 

- Erase the flash by pressing the button once when prompted.

- Return all dip switches to off position. Switch 4 can be left on, which will blink the green led whenever the 328 is powered up, but can be turned off to save power.

- After data is collected, turn switch 3 on and press the button. The data will be output over serial in the form of a table.

This project has been ongoing for a few months now, but I, like many people, don't document projects as well / as often as I should. This project represents a lot of firsts for me, such as the first time working with low power, first time ever soldering SMD components, and only the second project where I have designed a PCB. Most of my projects consist of either breadboards, prototyping boards, or some bizarre freeform/deadbug. I am not an electrical engineer or programmer, just a self taught hobbyist, which does sometimes mean that I have no idea if I am doing something "the right way." I want to keep my designs simple, using components that are well known, and programming no more complex than Arduino.  With that in mind, the following ramblings explain my thoughts in building this project.

Since this was designed to be buried in a time capsule, the first order of business is how to get power. I had never worked with any low power sleep modes on microcontrollers, but I have plenty of devices that last for years with just batteries. Plenty of projects here on HAD that use a coin cell, but i'd be hard pressed to get 5 years out of one of those. Sounds like a good solution is normal AA batteries. I will use enough so that even when the battery is near dead, the voltage will still be high...

Read more »

328-memory-bme280-v6-boardv1.ino

Arduino program to make the board work

ino - 11.05 kB - 09/06/2018 at 02:24

Download

pcb-files.zip

Eagle files and gerbers

x-zip-compressed - 86.66 kB - 08/27/2018 at 14:41

Download

  • 5 year update - first recovery

    alnwlsn01/02/2024 at 03:08 0 comments

    Welcome back everyone! The 5 year update I'm sure you've been anxiously waiting for is finally here, because just a few days ago I was able to recover the oldest unit from the time capsule where it was buried 5 years ago.

    As a reminder, this project was constructed for a semi-local annual event I attend, where every year, we bury a time capsule. The capsules are staggered, so every year, there's another capsule from 5 years previous to retrieve and examine. The contents of these are the usual time capsule things like predictions about the future, pictures, and old newspapers, but occasionally someone will throw in a pack of Skittles or beef jerky or something to see how it fares, with results ranging from "mostly fine" to "this tastes like mold smells".

    Anyways, a time capsule is usually a fairly passive thing, where mostly nothing happens until the capsule is opened. This is how it has been for almost every time capsule ever constructed, and the same for the past 30 or so years of our local tradition. Unless mold is forming, there's nothing active going on in there. What if you could wind a clock and have it still be ticking 5 years later? Nobody really knows what happens inside them for the intervening 5 years that they are buried, either. Do they freeze solid in winter? How stable is the inside environment?  Sometimes we open them to find that they have taken in water - when did this happen? Immediately or after some time? That's what I was really trying to figure out.

    It occurs to me that I've never uploaded a picture of one of our time capsules, so here's one of them:

    This is not the usual design - most of the capsules are a 4" PVC with one end having a threaded plug for easy reuse. In this version, the 6" ends are simply pushed on and held by friction, with the seams sealed with tape. For either design, the tube is filled, sealed, and then buried at the top of a large hill, usually about 2 feet underground.  The tubes do not contain desiccant.

    The board installed in 2018 had a 3D printed holder, and used four Lithium/Iron Disulfide AA batteries, which are supposed to have an extremely long shelf life and very wide operating temperature. Upon recovery, two of the cells measured in at 0 volts, one at about .7V, and one still at 1.5V. I'll hang on the the one "good" battery to see how much power is really left in there. I apparently wrapped them in packing tape just in case they leaked, which they did not.

    Another thing I noticed was that there is some flux present on the back of the board. Leaving flux can contribute to increased current draw, as it acts like a very high resistance. I'm not sure why this wasn't cleaned off - perhaps this contributed to the dead batteries.

    Ok, so how long did it last? Well, first I had to make something that would show me the data after it was dumped out over the serial port. I always found working with plots in Matlab confusing, and now that I'm out of school I use python's MatPlotLib instead, and it's also confusing. Is satisfying when you finally get it right though; here it is:

    Actually, I already messed up; it's supposed to say "Winter Camp XLII".

    Looks like it lasted a bit over 3.5 years; 33471 hourly samples. I do have a control unit which I check up on once a year; it too was dead this July after 35553 hourly samples. Perhaps my lifetime calculation are a bit off, and I'll need to install a bigger battery next time. Current life is kind of ok for this part of the project - since the time capsules are staggered by 1 year, there should always be coverage, even if one unit fails.

    I have to believe the temperature readings are fairly accurate, since I have two sensors for that which agree quite well (the BME280 and the internal thermometer in the DS3232M real time clock). Looks like the capsule gets down to just above freezing (the red line) in the winter, and goes up to a cool 65F in summer. Very reasonable.

    How about the barometric pressure?...

    Read more »

  • 3 year update

    alnwlsn12/10/2021 at 05:22 0 comments

    This project is not dead; 5 years is just a long time.

    So, what's been going on? Well, in a few weeks I will be burying the 4th unit in a 4th time capsule (the time capsules are staggered - every year there is one to dig up from 5 years ago.) So it will still be 2 long years before I get the original unit back from 2018 to see if it worked.

    However, this means that I have just used up the last unit I have in stock, and I'll need to build another batch of them. This probably calls for a PCB redesign; there are definitely some improvements I can see to be made. It certainly helps that for the past 3 years, I've taken a job in which I regularly make PCB designs, so my skills in that have improved significantly, as well as my skills in working with and soldering SMD components. If only we weren't living in the silicon shortage timeline - genuine BME280 sensors have been out of stock for months, as have even the humble AtMega328P.

    This year, I decided to try something a bit more robust by spot welding the batteries together instead of putting them in one of those crappy battery holders. I built the spot welder for doing 18650 batteries, but I figured it could serve me well here too. Only risk it that I blow through the case of the battery with too much current, and make a hole which drains out all the electrolyte. Seems to be OK so far, but only time will tell, unfortunately.


    As for the units I have decided to keep around for observation: one was in a plastic food container placed outside my house. All was going well until spring of 2021, when I found the container had cracked and filled with water. In fact, the board had been entirely underwater for some weeks. After cleaning up the corrosion, I managed to extract the data that was on it, and left it to dry indoors. When I finally got back to the seemingly trashed unit after several days, I changed out the batteries and to my surprise, it worked again, and has been running most of the year (indoors). I have not checked in quite a while to see if the BME280 sensor was at all damaged by the flooding. I would actually be surprised if it does work correctly, but I don't consider this unit as part of the fleet anymore anyhow.

    The other unit I have access to (sometimes) is at my summer vacation spot. It's protected from the elements somewhat, but still sees freezing temperatures for much of the winter. I placed this unit in the summer of 2019 and checked in on it in the summer of 2020 and 2021. Both check-ins seemed to prove the unit was working just fine; battery voltage was good, the data read off cleanly, and the time was only off by less than a minute both years.

    However, for longevity, the oldest unit is still the 2018 one buried inside a PVC pipe underground, and I won't see it again for another couple years.


    I also rewrote the firmware, as I've gotten better at doing stuff like that too (at least I hope so). The units are now controlled mostly through a serial port command console interface, so the DIP switches aren't really needed anymore.  The new software, along with some example scripts for Python and Octave for graphing the dumped data, are on Github here (https://github.com/alnwlsn/envilog2), which I've started to try out despite not really being a software guy.


    That's all for now though, see you in 2 years.

  • September update - clock accuracy

    alnwlsn09/22/2018 at 17:08 1 comment

    I've been running this one board since mid-August, but since the beginning of this month I have not removed the batteries or set the clock, which marks the longest time so far that the system has been running continuously. I downloaded the recorded data and found it contains not a single error. However, I noticed a discrepancy today between my board and my other clock, of just over a second (the board is set up to take a measurement every minute on the minute, and will blink the green light as an indication). The DS3232M's datasheet specifies an accuracy of 5 PPM, so one second over this timeframe is well within spec. However, tuning in to WWV on the radio revealed that the board was dead on accurate; it was the Nixie clock that had drifted. The Nixie clock uses one of those counterfeit DS3231 modules from China as it's clock source. While the discrepancy is within spec, it is still the genuine Maxim chip in the logger board that has proved to be more accurate.

View all 3 project logs

Enjoy this project?

Share

Discussions

Jan wrote 09/01/2018 at 06:19 point

Nice project, very similar to my micropower micrologger. Haven't worked with flash chips, added to my bucket list :)

Regarding the placement in a "time capsule": Your humidity measurements won't be too useful if you need to put it into a tightly confined/watertight space... Another tip for you to get power consumption down: Power the BME280 from a digital pin, remove all the hardware-pullup resistors and use the internal ones when active. Saves a lot of quiescent current.

By the way, you could easily get 5 years out of a CR2032 cell with 220mAh. You'd need to ditch the regulator and use a sensor that works from 3.3 down to 1.8V. Clock speed should be set to 4 or 1Mhz and all peripherals/sensors are powered by a digital pin.

Say you have 4uA power down consumption, 1 wakeup/hr and 0.2mA consumption while taking a measurement for 1 second you'd get >5 years run time. And CR2032 are not even the highest capacity coin cells.

BOD and all other peripherals of the Atmega328 need to be turned off of course.

Cheers, Jan

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates