Minimum oscillator frequency for saving power in rf project

Hello everybody.

This time I am trying to make a wireless accelerometer transmitter working on batteries (it must have small power consumption). It is made of an Atmega328p, an NRF24L01 and a LIS3DH accelerometer.

For achieving low power consumption, I am setting both the nrf and lis in power down mode when they are not in use (my sampling rate is 100Hz). I am powering the uC directly form the batteries at 3.3V. However, my design is consuming around 2mA, and I would need to be under 1mA.

Reading the uC's datasheet I found that it would consume much less if I used its internal oscillator at 1MHz or 4MHz instead of the external 16MHz crystal I am using. My problem is: how can I know wether any of those frequencies is enought for my purpose?

Both peripherals are connected using SPI, with the default settings of their respective Arduino libraries (I am not an experienced programmer). My goal is to achieve 100Hz of sampling rate on the receiver.

What is the lowest oscillator frequency I should choose?

Thank you in advantage

Hi

SPI should be fine regardless of speed, unless you need to do something very quick with the data retrieved using code which will run slower, nut sPI will not be a problem.

The issue with the internal oscillators are they are not very accurate, this can make things difficult when connecting to other devices using something like serial, but with SPI the clock is pulsed by the 328p, so it doesn’t matter if things run a bit faster or slower as everything beats to that clock on the SPI bus.

Running slower however doesn’t really save power as everything just takes longer, and an external crystal compared to internal one isn’t a great difference.

Options are to sleep the processor, you can sleep for milliseconds so could sleep for 10ms between each sampling, although it may need to be shorter than that, and if your sampling takes something approaching 10ms you haven’t enough spare time to sleep.

You should post up a schematic of your design.

Note that if you are running at 3.3 volt at 16MHz you are running the 328P out of spec, and as the battery flattens the voltage drops, see this here http://forum.arduino.cc/index.php?topic=213105.0

I would suggest if this is a home built project is to run at 8MHz, allowing voltages down to around 2.5 volt, this requires the necessary bootloader and fuses set and a 8MHz crystal or the internal oscillator configured. Doable but a bit more advanced, or just buy a 3.3 volt 8 MHz dev board.

Hope that helps.

Your current consumption is only 2mA when running 16MHz@3V3? Strange. Should be at least 4mA. Maybe you have CKDIV8 fuse programmed (default value) and in fact your speed is only 2MHz?
Both nRF and the accelerometer runs at much lower voltage (if you have "bare" nRF without PA+LNA chip). Lower voltage = less current needed.
For this application you should use a sleep mode - look here. 1mA average current should be easy to achieve. My guesstimate is you will get to 100uA if you use the sleep right.

Yes, the power consumption was mucho more than 2mA, I got mistaken.

I am using the nrf with the schematic of the example of the datasheet. By the way, I do not think the nrf can be powered with lower voltage, since its datasheet specifies that it should be between 3V and 3.5V.

I have planned to use the sleep mode in the future. However, I would like to know what frequency I should be using for the atmega's oscillator.

Thanks.

Reading the atmega's datasheet, it seemed that power consumption was much less with slower oscillator, but it is true that for powering on and off the uC with a timer would require a faster clock. Is it worth going for 4MHz? And with respect to precision, Is it worth going for an external oscillator then? Would I achieve under 1mA with one?

Are you waiting for an acceleration event that you could configure the accelerometer to generate an interrupt on? If so, put microcobtroller to sleep instead of the accelerometer and have it wake the chip with the interrupt line.

That would be the best thing to do, but it is difficult to do it with a lis3dh. With a correct timing, I may be able to set a timer on the atmega for it to sleep and getting the 100Hz sampling rate

If you don't want use sleep (why?) you may change ATMega main clock prescaler to maximum value to run slowly while idle and change it back to fast speed before doing something. But it will break millis() and delay.
Running from external clock source won't save current.