Modifying Cheap PIR Motion Sensor to Work at 3.3V

This PIR motion sensor is a $2 sensor that is used to detect movement from humans or pets. You can read my previous tutorial on how to use this sensor with an Arduino.

I’m currently working on a new project and I needed to make this module operate at 3.3V. By default this module runs at 5V, but it has an on board voltage regulator that drops that voltage to 3.3V.  With a quick online search I’ve found a blog post that explains how you can bypass the voltage regulator and use this module at 3.3V, which is exactly what I needed.

Where to buy one?

You can click here to compare the PIR motion sensor (HC-SR501) at different stores and find the best price.

Before soldering

Some of these modules come with pins soldered in that top right corner, so you don’t have to solder anything. You would simply connect a jumper wire to that pin that is highlighted in red (see Figure below). With my particular sensor I had to solder a small wire.

pir_motion_sensor_arduino

After soldering

Here’s how it looks, now if you supply 3.3V through that red wire your module works at 3.3V.

pir_motion_sensor_arduino_3.3V

Testing

I’ve tested this sensor with an Arduino using this code. The only difference between that previous blog post is that now I can power my module with the 3.3V pin of the Arduino!

Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.



Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »
Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior experience!

What to Read Next…


Enjoyed this project? Stay updated by subscribing our newsletter!

25 thoughts on “Modifying Cheap PIR Motion Sensor to Work at 3.3V”

  1. Thank you for posting this. I want to try this with my LightBlue Bean. Not sure how long the Bean’s battery will last though.

    That little square you have to solder to is pretty dang small. LOL.

    Karl

    Reply
  2. Ha! I was just wondering that. I was working with the Ultrasonic sensor HC-SR04 to see if it would work at 3V, but it looks like I need to order US-100. Thanks!!!

    Reply
  3. Tried this with no success. The PIR keeps acting like it’s underpowered. Everything works using the 5v regulator and a USB connection. But I’m trying for a 3.7 v battery connection with no success.

    Reply
    • I’ve used this method to modify more than 10 PIR motion sensors and it always worked for me…
      Not sure what’s happening with your sensor. Make sure your power source can supply enough current

      Reply
  4. This is just a heads up for potential problems. I appreciate the work, and I find this to be a very neat hack.

    Note that this solution bypasses one capacitor (missing in schematic, but connected between Vin and GND of LDO), and was apparently the reason why PIR kept triggering in a circuit here.

    My setup:
    sonoff basic (with switching based PSU) -> 3.3V and GND to HC-SR501 – it kept triggering, I replaced the PIR module, same. Oscilloscope showed normal 3.3V line.
    12V wall wart + external LDO to 3.3 -> 3.3V and GND to HC-SR501 – normal triggering. Oscilloscope traces of 3.3V and OUT signals look the same as in non-working scenario above.

    I have not experimented adding an electrolytic capacitor between 3.3V and GND (which I assume should also solve my problem), instead I modified sonoff basic to get 5.0V out and connected that to Vin of PIR. This works fine.

    On another sonoff basic, HC-SR501 works fine when powered with 3.3V.

    Reply
  5. I have a better idea: see that tiny diode near the VCC pin (on a rail going to LDO)? That little sh*t drops almost 0.5V on it’s own, leaving 2.8V after LDO.
    I suggest to simply add a jump wire on the diode, that should be enough to power it from a 3.3V source, at least that worked for me.

    Reply
  6. Any idea if this changes the sleep/idle current of the sensor? My hc-sr501 reads a little over 60uA when idle on a 5v rail.

    Thanks for posting this, I’m running some arduinos on battery, curious if you measured the current consumption of it hooked up raw to the battery.

    Reply
  7. I remove the diode from the lower left (which is there for polarity protection), as well as the LDO. I run a bare jumper wire to bridge the removed diode as well as running the jumper up to the Vout of the removed LDO. I power the PIR from a 3v3 switchmode off of a LiIon or LiFePO4 cell (also supplying an LED driver or a µC), no problems. You can drop the scavenged parts into your parts bin for some other project.

    You really want the input power to have the benefit of the capacitor in the lower right.

    All the boards I’ve dealt with have a pin header for the retrigger mode, and have used a MELF package for the diode. The LDO has been a Holtek 7133-1

    Reply
  8. After I did remove & bridge the Diode the transistor for a full 3v3 PIR it was keeping triggering randomly. I shortened the 20cm cable connected between the ESP32 and the HC-Sr501 and suddenly it become stable. So I another to consider is to use a short cable!

    Reply
  9. I bought the 5v SR501, wish I had instead bought the SR505.
    I initially used 3.3v from the ESP32 to power the PIR. I then discovered it takes 5v, so I gave it 5v instead — it didn’t seem to make a difference.
    Anyway, It appears to work OK, but I’m not really sure I understand the “Mode” jumper
    (Single or repeatable trigger).
    I have the delay set minimal (approx. 3s).
    There seems to be some “settling time” required after the OUT pin returns to LOW.
    When I move my hand in view of the sensor, the OUT pin (viewing the scope) goes HIGH immediately. However, if I move my hand again after only a very short time after the return to LOW, nothing happens for a few sec. (it varies maybe 3-6s), but then OUT goes HIGH again! If I wait for approx. 5-7s after OUT goes LOW and THEN wave my hand in view of the lens, OUT goes HIGH immediately. It behaves as though there is a “recovery” time associated with the transition from LOW to HIGH for delay sec. and then its ready for another transition.
    I tried moving the jumper for “repeatable” triggering, but I’m not sure what I should expect. I wasn’t able to be certain as I observed its behavior if it was doing the ‘right’ thing.

    Reply
  10. Seems obvious but I’m going to ask to be sure.

    Once doing this modification, you supply the module with 3v3 on VCC correct?

    If that’s the case, you could jump that H pad to VCC right?

    Reply
    • Michael, the PIR modules I have (a commodity part on AliExpress, often sub-US$1 each), do not have the pads where this article shows the red wire connected. What I do (since I can manage to connect power with correct polarity), is remove the polarity protection diode just to the left of the Vcc header pin, as well as the vreg, and bridge the pins where the diode had been and the centre pin of the vreg to the one on it’s right (towards the middle of the PCB). This loses the 0.6V drop of the diode as well as the overhead for the LDO. Once so modded, I provide 3v3 on the Vcc pin (whose regulation comes from elsewhere), using the standard header pins. In my typical use, I have an LED driver board that piggybacks on the back of the PIR, so routing a wire somewhere else isn’t the level of tidy I’m looking for. If you run 3v3 to the location shown in the article, you would NOT run anything to the Vcc pin.

      Note that the elcap in the lower left (if the Vcc/Out/Gnd is at bottom centre) is a buffer cap, not that the board itself should use much juice. If you’re not bridging the Vcc path or not supplying power at the Vcc pin, there’s a very good chance that cap will not be charged (it is on the INPUT side of the vreg, so shouldn’t be charged if the board is being supplied by 3v3 on the output side of the vreg, but I might be wrong – I haven’t worked up a complete board schematic).

      Removal of the parts is trivial with hot air – the LDO is a bit more of a bother with a stick iron.

      Reply
  11. Those are very small parts to remove and replace with jumper wires even with hot air 🙂

    Can I not just use the 5v pin on a wemos D1 mini?

    Reply
    • If you have 5V to start with, yes, you can power the PIR Vin without needing to mod the PIR. The current consumption of the PIR is very low, so the losses aren’t that significant.

      The point of modifying the PIR module to bypass the onboard voltage regulator (either by feeding it from another point on the PCB beyond the regulator, or bypassing the diode and regulator) is for people using say, a single Lithium Ion cell, to power their project (for which their µC is likely 3v3), and when passed through a diode and an LDO, suddenly, that’s insufficient to run the PIR module.

      I have and use a lot of LiFePO4, which when FULLY CHARGED are 3.6V (and don’t stay there for long – 3v35 or so is where the bulk of their charge is) – there’s NO room for a diode drop with that, much less the demands of an LDO after the diode.

      Note that those using say a Lithium chemistry don’t want to have to have a boost circuit, or say a 2S battery configuration just to run the PIR, when in fact, the PIR wants 3v3 itself.

      SMD isn’t for everyone, and no judgement here, but as SMD goes, the miniMELF (diode package used here) and the SOT89 (LDO) are both very manageable parts, but then rework isn’t everyone’s cup of tea – removing an SMD device is a bit more of a task than installing one on a bare board.

      Reply
      • Thanks, I had not pondered battery. How long does it run on battery? Does your code turn off wifi until it detects motion?

        I do love my hot air stand, but that is still small stuff for me.

        Thanks,
        Grey

        Reply
        • My own modding of the PIR sensors are generally not for WiFi (such as ESP modules). Turning lighting on in response to motion doesn’t require WiFi (nor even a µC), which would consume a lot of current compared to the PIR. You could have a µC with the PIR output driving to an input pin on the µC, configured to wake on pin change. Wake, log the event or do whatever else and go back to sleep. PIR modules running my 1-3W LED driver with fairly frequent foot traffic (but not like downtown in-city) will run for 6-8 months if not longer in my environment, but then the LFP cells I have are 50Ah each.

          Reply

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.