I am playing around a short while with Arduino now and I am fascinated. Awesome 'toys'
As I was building a little stand-alone 'weather station' now (with DHT22, BMP180, Light sensor and the NRF24L01), I came across the question: How to save power?
The NRF24L01 is sending the data wireless to an RPi. That makes it possible to leave the 'weather station' outside. Currently running on an old battery pack (26.000mAh). The pack is old and doesn't have the full power any more (its dying). But anyway it was lasting just approx. 10 hours. Terrible!
I use already the Jeelib to replace the delay function. The loop is running every 5 min at the moment.
I suppose the sensors sucking my battery empty. But how to cut them from power? I have them, as standard, on the 5v / 3.3v pins. I didn't checked it, but I suppose that this pins are still under power even the Arduino is in sleep mode.
So, how to cut the power for the sensors? I suppose I can connect the Vcc/Power+ pin of the sensor on a digital pin of the Arduino and set this Pin HIGH/LOW, isn't it? But then each sensor is using at least 3 pins (Vcc, GND, data). And how about the 3v3? Like the NRF24L01 needs it.
I also want to connect more sensors to the Arduino and replacing the UNO with a ProMini. Then I'll get problems because I will not have enough pins.
The other thing is... not all sensors deliver straight away correct values. Like the MQ2 gas sensor needs quite a while, because it has to heat up. I don't know if other sensors also need this 'warm up' time. Is there any overview somewhere out in the big online world for this question? I don't know if I can power up the DHT22 and if I get straight correct values (just as an example for every other sensor out there).
An on/off switch isn't a solution. I want to have this remote. A switch would mean I need to go there every 5 min to switch power on and off.
I think there is a better solution, isn't it?
Thank you for your answer. But its far away from my question. I can make a switch in front of the Arduino to switch everything on and off. But that isn't the point.
This Arduino shall be work stand alone (remote was the wrong word maybe). I don't want to bother with it. It shall be somewhere and just work, without my attention.
I just want to know how to power down the connected sensors while they are not needed (e.g. during the sleep cycle). How to make the system more power efficient.
Connect the peripherals to a subcircuit. Use a mosfet to switch this subcircuit on/off using a digital pin on the arduino.
In your sleep routine turn off the mosfet pin before you sleep.
When you wakeup, turn the fet pin back on, to activate the subcircuit. You might have to build a timer routine in to wait for a while after wakeup before reading certain sensors.
.....there are probably other ways, but thats how I'd do it
@scrumfled
I never heard about mosfets. But it looks like a possible solution.
If I understood it right then I need to make a new circuit for the sensors and interrupt this circuit with a mosfet when the Arduino is sleeping... right?
If I can't just interrupt the 5v and 3v3 outputs on the Arduino board, then this seems so be a good solution.
@Pauly
The battery pack is from a solar system. On it is a 42W solar panel. But the sun is not shining so much right now and as I said is the battery pack dying. It keeps just a piece of the power it was used to keep.
Hi there, if you apply the Vsupply (for sensor only) to the collector of a PNP transistor, attach the base to a 10K(other side of 10K to Vsupply) and to an NPN collector, NPN emitter to GND, NPN Base to IO pin via 500R, then when you write "0" to the base/IO pin the Vsupply to the sensor will stop as the PNP will switch off, 1 to switch on. This will only function for low mA, there are adjustable voltage regulators that have an enable pin, this can be switched on and off in the same manner for higher current sensors.
Have you measured the current that these sensors use when they are not being read? Some may be so low that it is not worth cutting the power.
If you do need to cut sensor power and the sensor uses less than around 30 mA, just use an Arduino output to power it. If more than 30 mA is needed then use a mosfet or bjt transistor as others have suggested.
Attach your bmp180 to the Pi, not the Arduino. It does to need to be outdoors, because the air pressure will be same as indoors.
To attach several sensors without needing many Arduino inputs, look for sensors with i2c interface. For example sht21 instead of dht22.
For lowest power in sleep mode, use a standalone atmega328 chip. Even Pro Micro will have power leds and other components that use power for things you don't need.