I am hoping someone can give me some advice on a path forward.
I need to put my system into sleep for long persions of time, or an idle mode. When I receive a signal from an accelerometer, I want the system to wake up and start taking in data.
I was initially going to use the WDT, wakening up every 500ms or so, but there are a few issues with this
The system will not be taking data in for long periods of time -- it will probably only take in data for say, 6-10 of the 26 hours in a day, so waking every 500ms is still wasting a lot of power.
Even waking every 500ms, I will miss the start of some events, and will not have complete data
So, I have been talking to a few people, and reading the datasheet for the ATmega328P, and I am wondering would the analog comparator be useful? My thinking is that I can set up an analog reference, below which the system wills stay idle, but above it (i.e when the voltage on AIN0 > AIN1) the output takes the system out of idle, and the system goes on as normal.
Does this make sense? Or am I just being silly?
If I am not being silly, this brings me to my second issue ...I don't have a fracking clue how to do it. I have been reading the datasheet, but if someone has some sort of example, that would be great!
The system will not be taking data in for long periods of time -- it will probably only take in data for say, 6-10 of the 26 hours in a day, so waking every 500ms is still wasting a lot of power.
Long days, huh?
When I receive a signal from an accelerometer, I want the system to wake up and start taking in data.
How is the accelerometer being powered? If it is powered (off) by the Arduino when the Arduino goes to sleep, how will it ever generate any signal?
My instinct is that you will want an analogue comparator to watch the signal from the accelerometer and generate an interrupt signal on the Arduino if it crosses a certain threshold.
gardner:
My instinct is that you will want an analogue comparator to watch the signal from the accelerometer and generate an interrupt signal on the Arduino if it crosses a certain threshold.
Yes, that's it.
Is this a reasonable way to do what I want? Or is there a different path?
"The device may be configured to generate interrupt signals by two independent inertial wake-up/free-fall events as well as by the position of the device itself. Thresholds and timing of interrupt generators are programmable by the end user on the fly."