I'd like to use a PIR sensor (HC-SR501) to control the power to an Arduino Uno. Note that I'm not talking about using a PIR sensor as input to the Arduino and sensing the output pin from the PIR, I'm talking about using the output pin from the PIR to turn the Arduino itself on and off.

Hooking it up directly doesn't seem to work as I'm guessing the PIR doesn't handle that much current output. Would I use a transistor of some kind to do this?

My reason for wanting to do this is simple, power preservation. The PIR uses so little current when it doesn't sense anything that I thought it would be nice for something like a mailbox sensor that doesn't need to run that often. Thanks.

  • Most serious designs would do this by suspending the processor rather than depowering it, though the whole board needs to designed with that in mind, something an off-the-shelf Arduino is not. If you actually want to depower it, and the Arduino needs to communicate with anything having a common ground with the control circuit, you may find high-side "USB power switch" like the RT9701B simplest for controlling the supply, even if it is not USB. Jul 22, 2016 at 22:06
  • Did anyone find a solution to this? I have a servo to power with the Arduino. Maybe the PIR sensor can turn on a second power supply before turning on the Arduino and running the servo? Long shot but who knows.
    – bodkin77
    Sep 3, 2016 at 7:22

1 Answer 1


Yes you can.

It all depends on how you are turning the power on. You sensor needs to flip a 'switch' rather than actually power the Arduino directly. (I'm sure you know that but just in case).

So you need a normally open relay in between you power source and you Arduino. Normally open because you don't want it powered unless you 'turn it on'. Your relay might be able to be switched by your PIR sensor's data output, but if you need more current then you are going to have to use a transistor and draw more power from the power source.

You have the PIR sensor, so now find the relay capable of carrying the maximum current you need for the Arduino.

  • 1
    Ok that's kinda what I figured and I did try a relay before, but not with a transistor between it and the PIR. I guess the PIR can't drive the relay directly. Thanks.
    – deltaray
    Jul 21, 2016 at 13:31
  • I'd suggest using a transistor, instead of a relay. Relays are more expensive, and waste power energizing the coil inside them.
    – Gerben
    Jul 21, 2016 at 17:59
  • Thanks. Do you happen to know what transistor type I should use for this? I tried using a PNP 2N3906 as recomended at rason.org/Projects/transwit/transwit.htm, but it didn't provide enough current, only a trickle. I could see the LED lights on the Uno slightly light up, but not quite full power.
    – deltaray
    Jul 21, 2016 at 21:50
  • Well, I got a 2N2222 NPN transistor to do the job, but I'm not sure if this is the correct solution. When I use this to turn on an Arduino Uno that plays a melody, the power leds on the arduino flicker with each note played. However a multimeter across the circuit only shows it drawing 54mA at most.
    – deltaray
    Jul 22, 2016 at 2:17
  • A bipolar NPN transistor like a 2N2222 is a relatively poor choice for this, and as a low-side switch creates some substantial complications if the Arduino is connected to anything. Jul 22, 2016 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.