Menu Close

Month / August 2015

Data Logger Simple – Software Bugfix

After analysing recorded data from the simple version of the data logger, I found a problem I had to fix with a new release v1.1 of the software.

If you look at this chart, which is showing data recorded in 30 second intervals, you can clearly see the values do not really change every 30 seconds.

Data Logger Problem Chart

The values change every 40 minutes and this can not be correct, even the sensor is slow. I found the problem in the DHT library from Adafruit. It is not actually a problem, but the library relies on the function millis() to measure the time between two reads.

From the DHT sensor library:

boolean DHT::read(void) {
  // Check if sensor was read less than two seconds ago and return early
  // to use last reading.
  uint32_t currenttime = millis();
  if (currenttime < _lastreadtime) {
    // ie there was a rollover
    _lastreadtime = 0;
  if (!_firstreading && ((currenttime - _lastreadtime) < 2000)) {
    return _lastresult; // return last correct measurement
  _firstreading = false;
  _lastreadtime = millis();

The function millis() relies on timer1 which is counting the time for this function. To save power, I put the microcontroller into sleep mode, which stops all timers except timer2. Therefore the time is not counted anymore, and millis() returns a wrong value.

Continue Reading

Simple Version of the Data Logger Published

I just published the simple version of the data logger hardware and software. The simple version extends storage of the minimal version with external persistent RAM. The additional storage provides space for more records and a higher precision for the records. Temperature and humidity is stored as float and the time as a UNIX timestamp. I […]

Long-Term Test Finished

I finished my long-term test of the minimal version of the data logger project after a few days. To simulate the situation for the actual usage, I setup the data logger to record data in 1 hour intervals. The test answered these questions: Does the data logger function properly over several days? How much battery does the […]

Data Logger Documentation Online

I just published the minimal version of the data logger project. The minimal version uses the built-in EEPROM of the microcontroller to log sensor data. I decided to create this additional minimal version because it works for very simple cases and does not need any external memory. The data logging mode is controlled using a […]

Are My Documents Safe in the Root Cellar at ~80% Humidity?

Update 2015-08-21: Added the wiring diagram.
Update 2015-08-24: The documentation for the minimal version is online here.

There is a large cellar where I could store unused items and documents, but the catch is the humidity there. It is a root cellar near a small brook and the humidity varies between 75% up to 90%.

Archived material should never be exposed to humidity greater than 65%, therefore I have to isolate all documents in boxes from the air of the cellar. But are this boxes safe? Do they keep the humidity away from the documents – even for years?

To have a look into the box environment, I need a data logger. It would be simple to buy one, but much more fun to build one. So a new project is born: I call it the “Data Logger” project.

There are a few phases to realise this project:

  • Prototype (done)
  • Simple Version (in work)
  • Deluxe Version with Display and Case

The Prototype

For the prototype I used a large solderless breadboard from 3M. There I actually just tested the components for the simple version, especially if the protocols are working and if I can use them in the way intended. I will keep this section short and explain everything in detail in the next section. Just to remind you, I tested everything on a breadboard before I soldered the components to a stripboard.

Parts of The Simple Version

The simple version should be a data logger which automatically starts logging temperature and humidity values it it is powered on. Using a small switch, I can select between logging, reading and erase. In the reading mode, the logger will send all logged values to the serial interface.

Because I need quick results, I will build the whole device using components from Adafruit. Here a list of components I will use for the simple version of the data logger:

Continue Reading