Some advice?

Hello,

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!

I did find this, which gives some insight - http://arduino.cc/forum/index.php/topic,59804.0.html ...but I am wondering if anyone has any others?

Thanks in advance.

Seán

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?

i wish i had 26 hour days

or look into the famous watchdog timer in the chip

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?

Seán

eddiea6987:
Putting an Arduino Diecimila to Sleep & Waking Up | Arduino Blog

Thanks! I will read through this.

Seán

What model of accelerometer will you use? Some have programmable interrupt generators in them for exactly this purpose.

Amongst the super-low-power STM parts is this one: http://www.st.com/internet/analog/product/250725.jsp

"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."

Mouser stocks 511-LIS3DH at 3 quid a throw.

Hey,

I am using the ADXL335.

I don't think it has any of the features you talk about, but I will have a look.

Seán