- Thread starter
- #11
After doing further testing, I've encountered one more major problem. The following is data logging overnight. If you notice, there is a sudden spike in the temperature, followed by a big whole in the data.

The whole in the data is caused by the device being under powered. One of the batteries I've been using to test with has finally exceeded its usefulness, and can no longer provide enough volts to write the temperature to the flash.
So what is with the spike in temperature? Well, when the device resets, it looks for the next memory location that has not been written to, and attempts to write to that memory location. Really, those values should be at the end of the graph, not in the middle.
The problem could be solved in a few different ways. The first method I could use to solve the problem is to detect when the power is to low to be useful for writing to flash. From observing the voltage when running, it appears that the voltage drop tends to occur when I'm using the LED. I may be able to wire up an input pin to interrupt the CPU when the voltage drops below a specific voltage.
Another option is to use the ADC to monitor the battery voltage, but this may use more power than I would like.
Thoughts?
The whole in the data is caused by the device being under powered. One of the batteries I've been using to test with has finally exceeded its usefulness, and can no longer provide enough volts to write the temperature to the flash.
So what is with the spike in temperature? Well, when the device resets, it looks for the next memory location that has not been written to, and attempts to write to that memory location. Really, those values should be at the end of the graph, not in the middle.
The problem could be solved in a few different ways. The first method I could use to solve the problem is to detect when the power is to low to be useful for writing to flash. From observing the voltage when running, it appears that the voltage drop tends to occur when I'm using the LED. I may be able to wire up an input pin to interrupt the CPU when the voltage drops below a specific voltage.
Another option is to use the ADC to monitor the battery voltage, but this may use more power than I would like.
Thoughts?