published: August 31, 2015 —
last modified: October 23, 2025
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.
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:
booleanDHT::read(void){// Check if sensor was read less than two seconds ago and return early
// to use last reading.
uint32_tcurrenttime=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.
I could just make a copy of the library and remove this part, but instead I created a own implementation which is simpler.
My own implementation has some limitations:
It only works with the DHT22 chip.
It requires a microprocessor with 16MHz or faster.
It only supports celsius as returned from the DHT22 chip.
It requires the AVR library.
Download the new version 1.1 of the data logger software here:
I just received the Adafruit PCB coaster and was pleasantly surprised—photos don't do it justice. Made from 2.4mm FR4 with a transparent solder mask and black silkscreen, it blends cold and copper tones nicely. Read on for my quick impressions and close-up photos.
I’ve published a simple firmware example for the Always-On project, built for PlatformIO and Visual Studio Code with my HAL adapted for Adafruit Feather M0. It explains the hardware mapping, motion-triggered lighting behavior, and timing options. Please read the full post for setup instructions and the GitHub link.
In part three I assemble and test the prototype PCB, set ATtiny13A fuses, and refine user interaction and firmware plans. I cover LED display choices, power measurements and a modular firmware approach. If you’re building a low-cost plant sensor, read the full post for practical steps and diagrams.
I've released a small update to my LR2052 storage boxes: new split models (LR2052-300C-S), an extensive clickable PDF catalogue, more free models on Printables, and a new download area for buyers. I invite you to read the post for full details and download links if these designs help you.
I've been making videos of my LED snowflake decorations, but they still fall short of the live sparkle and diffraction I see. I explain the problems—blinding LED peaks and weak diffraction spikes—and invite you to read the post to watch the clips and see my plan to add digital effects.
I finally published all design files and documentation for my plant watering sensor project. The package includes PCB layouts and firmware, but this is an advanced build: it needs SMD reflow, Atmel Studio and an Atmel-ICE programmer. If you're interested, please read the full post and the GitHub repo for details.