I have a project with an Arduino nano, PIR sensor, a LED 5mm white and a photoresistor.
Im trying to calculate power consumption. I understand the nano draws about 16mA, so in a 24hr day, it would consume 384mAh.
The LED, phototransistor & PIR work together in that if there is movement and its dark, the LED powers up for 15 seconds and then powers down.
From what I've read, the PIR draws very little current while idle, around 60uA if im not mistaken but Im not sure while active but Ive read about measurements of about 150mA.
The LED should draw about 20mA and 0 while off.
The idea is that about 10 times during the night, motion might be detected and the LED powered.
This means that for the LED, 10 times @ 15 seconds each, is 150seconds out of 3600seconds in an hour. Thats 150/3600 = 0.04hrs x 24 = 1hour at 20mA = 20mAh.
For the PIR, if it does draw 60uamps while idle, well that's just negligible. But if its fired 10 times and remains active for (mid setting = 200-5=195secs/2=) 98 secs each time, that's 980 seconds/3600 = 0.27hrs x 24hrs = 6.5hours at 60uA = 0.39mAh.
This means the total power consumption would be 384mAh+20mAh+0.39mAh for a total of 404.39mAh. That seems like a lot given that if I use 6x1.5V batteries in series, Id only have 2500mAh to work with assuming it could use them all up, thats 2500mAh/404.39mAh = 6 days?
The nano isn't the best choice in a battery powered situation. Personally I use a pro mini and have yanked the regulator and led off the board. It depends what else you need to do though as to whether this is practical.
Also, you first need to have a look on reducing the Arduino Nano power consumption. It uses a LDO for power regulation which is not ideal for this kind of project. It also has a built-in USB to Serial (and a LED?!) which will simply waste energy when your project is running....
After fixing that, you need to use the "sleep" modes for the MCU. Once you get your board running at very low power when the MCU is sleeping, not more than a few uA, than you can progress with your project and start adding other components.
Regarding the PIR, you should be able to find a few options with very little power consumption, and that your is already ok with 60ua only. The PIR should be used to wake the MCU from sleep and check the phototransistor for the luminosity level... if it's too dark, turn on the LED, if it still bright, just go back to sleep and ignore any other PIR interrupt for the next a few seconds (as it probably will be bright for some time)
In summary:
you need to have a board capable of consuming very low power when the MCU is at sleep, like this one Bitbucket
Familiarise yourself with MCU sleep + interrupts/watchdog timer.
Non-blocking code, for example, you don't need to have your MCU awake during the time the LED is on
You should find an actual datasheet for a PIR sensor you can buy. The Parallax #555-28027 datasheet says that it draws ">3mA (may vary)". That is way more than 60uA. The good news is that it can run on 3V. You can use three AA cells in series (nominal 4.5V) and run the PIR and Arduino directly, eliminating the power wasted in the regulator.
Just don't forget that 3 AA on series will only provide 4.5V when brand new. At 50% they are more likely to give 3.7V and finally less then 2.7V by the end of life...
Ok I measured the project and it pulls 28mA when the led is on and 21mA when it's off.
So that's 21mA X 24hrs, that's 504mAh per day. I had calculated 404. So that means that a 2500mAh will last about 5 days.
I've been playing with sleep mode and got a 28% savings. That means 394mAh which is not much because that is still only 6 days.
So I'd have to try a different power savings mode instead of idle, like power down. And about "taking out the regulator, the led and the usb-to-serial", any good tutorials anyone can recommend?
You don't need anything else than a PIR sensor, an LDR, a transistor, a LED/resisor and a battery to make a night light.
If you remove the fresnel lens of the PIR sensor, you see a spot where you can add a small LDR.
With that fitted, your PIR is light sensitive, and will only output a high when it's dark.
The "time" pot can be adjusted from ~7 seconds to ~7 minutes ON.
The output can directly drive the base of a small NPN transistor.
LED/resistor between +batt and collector. Emitter to ground.
60-70uA current draw.
Leo..
Wawa, thanks! Sounds neat. So you mean something like this:
musskopf, thanks for the tut. I was worried about the sketch upload as well but I do have a USB-to-Serial/UART TTL adapter. Also thanks for clearing up the name. I had been fumbling with that that adapter was called. Its USB (from the mac) to Serial port.
Yes, but the LDR can be mounted onder the white dome, almost flat on the circuit board.
The LDR connects to pin9 of the BISS0001 chip and ground.
Post a picture of the board under the dome if you're not sure.
The LED needs a current limiting resistor.
Post details of the LED if you want help with calculating the resistor value.
Leo..
Ok sorry about that. The cathode is the back part of the diode, right? Back meaning where the current flows into with the anode being where the current flows out of.
Ok now Id like some help understanding the transistor calculation. I have here for example a 2N2222.
Vce - means that it can handle a voltage diff of 40V
Veb - means that the volt diff applied must be 6V
Ic - means the current it will allow through is of 1A
So does this mean I need to apply a voltage of 6V at the base for the transistor to "open"?
So I can use a 4xAA battery pack which yields a 1.5x4=6V to power it?
Max Veb is when when you connect it the wrong way round.
Base voltage is normally ~0.65volt.
Yes, you can use a 4-AA pack.
Check the circuit. I think you have connected it wrong.
That's a 20mA LED. White? If so, it has a Vf of ~3.3volt.
The resistor should drop 6volt (battery) - 0.5volt (transistor) - 3.3volt (LED) = ~2.2volt.
2.2 / 0.020 = 110ohm
Battery voltage will drop over time, so 100ohm will do.
Leo..
The cathode is the thick line (chip) of the symbol, the arrow symbolizes the needle (anode) pressed onto the old detector crystals. Discrete diodes usually have a circle marker near the cathode pin.
When you inspect a monochrome LED, you'll find in it a pin with a bulky head, carrying the chip (cathode), and a slimmer lead for the anode, from which a very thin; almost invisible; bonding wire is attached to the surface of the chip. If you manage to melt the plastic case when soldering a LED, that thin wire can break and destroy the LED. Many years ago I obtained a lot of surplus LEDs with such heat sensitive plastic enclosure, but nowadays LED, in detail SMD parts, should withstand higher soldering temperatures without defects.