How do I power arduino using a PIR output pin

I have a project in which I want the arduino to send some data to wifi when motion is detected by the PIR motion sensor.

I'm powering the arduino through three 1,5 V AA batteries (4,5 V total) and I've noticed that running the arduino all the time is very power consuming.

Is there a way to connect the PIR output sensor to the arduino power input in order to turn the arduino on while the sensor is active, and then turns off when there is no movement.

I tried connecting the output pin directly to the power input, but that wouldn't power on the arduino (current not high enough probably). I also tried this with a NPN 2N2222 transistor, connecting the PIR output to the base, the collector to the battery positive output, and the emitter to arduino power input. This would slightly turn on the "ON" led, but that doesn't seem right.

Is there a better way of accomplishing this?

As you discovered this would be worse than powering direct as you get an extra voltage drop in the transistor.

4.5v is very marginal for a 5v device even with fresh batteries. How is the PIR supplied?

The PIR is connected directly to the batteries.

OK. Well in that case you still have the problem that 4.5v is marginal for an Arduino and as the batteries run down and/or get cold there won't be enough volts.

A couple of options.
1 Use a higher voltage rechargeable battery such as 2 LiPo cells (~7.2V) to supply Vin to the Arduino and use the 5V from the latter to supply the PIR.

2 Stick with the present batteries, have a "low drop out" (LDO) regulator to drop this to 3.3V for a 3.3v Arduino.

I think you will find that in both you need to put the Arduino into some sort of sleep mode to give decent battery life. It is probably not a good idea to just switch the Arduino supply off because it will take some time to reboot when it powers up and that might not suit your application.

Which Arduino?

You can setup controller deep sleep mode that it power consuming will decreased in hundreds times. The mcu will wake up from PIR sensor via interrupt.
This is a common way to arrange power saving for mobile applications.

ESP32 can do deep sleep and wake up upon external thingy.

It's not possible. You can power up a PIR sensor with an Arduino. But you cannot power up an Arduino from the output pin of a PIR sensor. The PIR output has a very low current. The current is not sufficient to drive an Arduino.

1 Like

don't be so sure. Aliexpress has ready-made PIR modules that can switch loads 12v, 110v or 220v
https://aliexpress.com/item/4000353403629.html

Switching a load and providing power out are two completely different things.
The PIR sensor is a data-level output and will NOT provide enough power to run any processor board. It will provide enough to turn on a MOSFET that controls a relay- as it likely in the Aliexpress module.

This Ali modules has in-board solid relay, that internally switched on and off by PIR output. It can be used to control small loads (for example led lamps) without any additional components.

I have used such module in my house, 220v variant - it turns on and off 20w LED lamp.

what I'm talking about is that these modules can be used exactly the way the OP wants

No, the OP wanted to power the Arduino from the sensor data out pin.

The sensor data out pin can control a MOSFET that can turn on the power to the Arduino.

Ok, and how would I make sure the arduino stays on while there is movement detected.

If I'm not mistaken, the arduino gets reset through the reset pin on the falling edge, meaning if I connect the PIR output pin directly to the reset, it would wake the arduino up once the movement is gone, but I want it to turn on immediately.

I tried some circuits with the transistor, but can't seem to make it work. Any suggestions?

I thought about relays, but they seem a bit too expensive for my needs.

reset pin has nothing to do with waking up from sleep mode

I suggest that switching arduino on and off from PIR is bad idea at all.
Please read a little what is a microcontreller sleep mode and how to use it.

If you had a NodeMCU (EN pin broken out), then you could power the ESP on/off with the PIR output.
Leo..

Is this not possible by an extern 12v pir that give 12v out when activated .. see picture

Yes, this will supply enough power to work some electronics, such as single arduino board.
But please note, that switching arduino on and off has nothing to do with sleep mode.
It will be quite difficult to get it work as expected OP if it turns on for a few seconds and starts every time from hardware reset.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.