Why logging every minute?

I did build my first RFM69 temp sensor and i see everywhere code that sends every minute.
Does everybody log every x minute?
I'm missing something? Because i think logging only if there is a change would save battery, bandwidth, CPU, disk space...

manicmoddin's picture

Re: Why logging every minute?


I often think about this problem. The reasoning I have for it is often down to ease.

Running on battery, I will often try to do things on a value change, as long as that value is not likely to change often (quickly). This will limit the battery use.

If it is running on usb or other external power, or if the value is likely to change often, I will log with an interval that is appropriate, sometimes minute, sometimes 5 seconds. All depends on what you are wanting to acheive.

Go for what is best in your situation.

Also note that putting the "Arduino" to sleep, you can also sleep the sensors and the radio too if you look through enough code from jeelabs.


MrGlasspoole's picture

Re: Why logging every minute?

I did build two prototypes. 1 Arduino and 1 ATTiny.
Then i saw that the ATTiny + PCB costs more then a Arduino pro mini clone. So i go the Arduino route and have more options and no complicated flashing.

I already put them completely to sleep. But what takes the most power is the RFM sending.
So i guess only sending if the temp changed is the way to go.

Off topic:
One thing i wonder is why it is so hard to do, to get long battery life.
I have a radiator valve with radio temp sensor and both have displays.
So the displays are always on and the valves radio module also needs to be in receive mode.
This two things are running since 3 years on the same battery.
The sensor has only 2xAAA batteries and the valve (2xAA has a motor that needs power).
How do the commercial products do that?

Patrik Arlos's picture

Re: Why logging every minute?


There pros and cons with all solutions; if you only report on change, then you save 'radio' transmission enery (+), but on the other end, you do not know if the device is alive (-), i.e the lack of data is that due to no change, or a device malfunction... you can mitigate this, by always reporting (irrespective of change) every x*k minute, and in between you report when the change is bigger than Z data units 


MrGlasspoole's picture

Re: Why logging every minute?

@Patrik, that is what i had in mind. Sending every 5 minutes even if there was no change.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.