So, I hoping to lower the power consumption of my project. I have Arduino Uno, Xbee Shield and Xbee. Additionally I am connecting two SRF02 ultrasonics to I2C bus. At the moment I am getting 37 mA consumption when all the devices are sleeping.
Arduino is using following library: Google Code Archive - Long-term storage for Google Code Project Hosting.
SRF02s are getting power from D7 pin and set to sleep by following: digitalWrite(SRF_out, LOW)
XBee after defining sleeping mode to be '1' is sleeping by use of following line: digitalWrite(digipin, HIGH)
Any suggestions taking down the power consumption would be highly appreciated?
I did not look into narkoleptic in detail but it seems that at least some timer will still be running.
My experience in pushing power consumption of the controller down to some microamps are:
read the datasheet. It not only about stopping the CPU.
if possible cut of all peripherals (not sleep them, but really cut them off). The datasheet explains how
if you can not cut off everything lower the clock (by means of CKDIV) before going to sleep, do not forget to speed up after waking
3b) do not lower the clock for at least 1s after a reset, otherwise you might virtually lock you out.
Ensure that all pins are either output or pulled to a defined state. Avoid free floating inputs at all cost
Use a board with a different regulator. The default power regulator of Arduino will draw to much power even if everything else sleeps. If it is an uno, think about how to sleep the processor for the serial interface. Or as suggested: do not use an Arduino at all, use a stand alone chip
It is fairly easy to get the controller to an average consumption <1mA. <100uA gets harder. 10uA is possible but you start getting all kinds of weird effects, e.g. seemingly being unable to power down the controller because it will be powered through some pullups.
If you want to push it you will have to look into the datasheet and use a customer board. Decreasing Voltage is also a good idea, but this implies that you have to decrease the frequency as well. The RC oscillator will use less power as a crystal. Crystals with lower load will consumer less than crystals with higher load.
Thanks for reply. Suggestions sound very good. Maybe I will continue programming with Arduino, but just strip the microcontroller from the board.
Btw. I have this problem that when I upload program to arduino, unplug the USB the program doesn't continue anymore. Is there anyway to go around this one? Meaning that program would continue after power up.
Btw. I have this problem that when I upload program to arduino, unplug the USB the program doesn't continue anymore. Is there anyway to go around this one? Meaning that program would continue after power up.
When you unplug the USB, one source of power is removed. The Arduino should switch to the alternative power source. What alternative power source do you have?
Ok, by the last question I mean that, when I cut all of the power sources naturally nothing works. But I assume that it would start working again after power on, since the program should be stored in the memory. But this doesn't happen. So, maybe I have misunderstood something.
But I assume that it would start working again after power on, since the program should be stored in the memory.
This is true.
But this doesn't happen.
What exactly should happen? Does the power light on the Arduino come on? Does the XBee come on? That is, does the associate light on the XBee shield start blinking?
This actually works after power off/on if I don't have the Xbee shield attached, but doesn't with the shield.
Does the power light on the Arduino come on? Does the XBee come on? That is, does the associate light on the XBee shield start blinking?
Yes, the led committed to Xbee chip blinks. Led associated to shield blinks (this doesn't blink when program is working). Also Arduino's green led is on.
Well, at the moment I am testing the setting with very simple program.
This very simple program does nothing but write a value to the serial port every second. What is on the other end of the serial port that proves the data is being sent?
This actually works after power off/on if I don't have the Xbee shield attached, but doesn't with the shield.
It sounds to me, then, as if you are not providing enough power to the Arduino/XBee shield/XBee when running off battery power. What kind of battery are you using?
I was testing the system with USB power and it seems that the code doesn't start automatically when plugged with USB. Works well with battery.
So, I am looking for ways to just work with this Atmega328p. So, basically my system doesn't need to have much of time accuracy so I am thinking of using internal oscillator. But how to enable internal clock?
So, what basically I need to do in order to make the chip work with developed Arduino code without the Uno board? I am a bit confused about this bootloader. It is probably a stupid question, but do I actually need to burn a bootloader if I program the chip with arduino board remove the chip and make it work with electronics.