Introduction: Convert a 5v PIR Motion Sensor to 3.3v for ESP8266
Do you have a PIR Motion Sensor that you would like to use with your 3.3 volt Arduino or an ESP8266 (NodeMCU), or maybe a Raspberry PI. Well the standard el-cheapo Chinese PIR Sensor accepts 5 volts in the VCC pin(actually 5v to 20v) and will not work at 3.3 volts. In this Instructable I'll show you how you can use a standard HC-SR501 PIR Infrared Motion Sensor with an ESP8266 or other 3.3 Volt micro-controller.
Check out my YouTube video also. Youtube Video
Step 1: Solder a Wire Onto the Voltage Regulators Middle Terminal
In my tests the HC-SR501 PIR Motion Infrared Sensor falsed when I attempted to use 3.3 volts at the VCC input pin. Luckily there is a simple solution to get the Motion Sensor to work with 3.3 volts boards like the ESP8266.
UPDATE!!! Thanks to Dosman71 - I originally said to solder to the middle terminal of the onboard regulator, This is WRONG!! The terminal you need to solder the wire to is the one on the RIGHT of the voltage regulator if the three pins are facing you. Ignore the Picture above and disregard what I said in the YouTube video
We need to simply solder a wire to the RIGHT terminal of the onboard voltage regulator. This regulator was designed to convert the high voltages coming from the Arduino (5 volts) or other devices(up to 20v) down to 3.3 volts logic; however, the ESP8266 works at 3.3volts and this regulator is not needed. So we need to bypass it!
The motion sensor internals actually work at 3.3 volts and the trigger pin (the middle terminal between the VCC and Ground) outputs 3.3 volts.
Step 2: Connect and Upload the Code
Next simply connect the other end of the wire you just soldered to the PIR sensors voltage regulator to the 3.3v power supply from your Arduino or ESP8266 (NodeMCU) and then connect the Ground and Trigger Pin and think of all the new projects you can do with your new sensor.
The Example code be found at Adafruit's website below
https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/using-a-pir
Now you can have your ESP8266 send you a text message over WIFI notifying you when someone is at your front door, or when the mailman opened the mailbox door, or when the UPS man left a package. Have fun!
2 People Made This Project!
- miaszh made it!
- russgalloway made it!
14 Discussions
1 year ago
Hello. How about removing the 7133, then short the Vin-Vout pads so that the original connector can be used ?
3 years ago
you can do that put Vcc on Pin Header Labelled H and it will work instead of soldering the Vcc wire to the output of regulator, it is the same thing
have fun
4 years ago
You don't need to solder anything. The free PIN from Jumper serv 3.3 V :)
Reply 4 years ago
Actually the jumper pin on the HC-SR501 is used to determine whether or not the sensor will reset after an initial detection. I don't believe it affects the voltage in anyway.
Reply 3 years ago
lol AndreasO1 is correct. The jumpers serve to either pull pin 1 of the BISS001 chip high or low. You don't need to solder anything. One of the jumper pins is directly connected to Vout of the regulator.
Google "hc-sr501 schematic" and look at the jumper pins.... :)
In fact you can connect power directly to the correct jumper pins.
4 years ago
Hello,
I think you made a mistake : the voltage regulator on
the board is a HT7133 so pin 2 is "power input". You have to solder your
wire on pin 3, which is "power output".
So why does your
solution works ? It's because by injecting the 3.3V directly to the
regulator you are bypassing the polarity protection diode and it's
voltage drop.
Reply 3 years ago
However the way he did it does bypass the diode and pass thru the regulator which in return will clean up any voltage ripples depending on the voltage source. So either will work. It just depends on how you intend to power the sensor. ;) Good catch though as it is important to read the datasheets.
Reply 3 years ago
LOL....I was just about to say the exact same thing until I saw your post.
Reply 4 years ago
You are absolutely right! Thanks for pointing out my mistake.
4 years ago
Nifty, but what about current ?
I read standard 5v PIR Motion Sensor require about 50mA of current to operate, which is way more than esp8266 GPIO pin can source.
Reply 3 years ago
you are feeding the PIR from a 3V3 source, not from a GPIO pin
3 years ago
can you please provide me the code for pir sensor + esp8266 which is to be uploaded...??
3 years ago
I am not quite sure I get which pin to attach what to, as "right" depends on the direction I am looking at it.
Do I understand correctly, that I need to connect a 3.3V out pin of the esp to the pin (which I still need to find out is "right")?
4 years ago
Hi!
Would it work if I just short circuit Vin & Vout on the regulator and feed 3.3V on the sensor vcc pin (where I normally would feed 5V)?