I have a raspberry pi zero and a HC-SR505 (not 501, which apparently is what I should have bought). I'm a programmer, with only a little electronics from long ago, but some people suggest the it will not work, something about 3.3v vs 5v. Others say it will work. I don't want to waste my time, so I thought to ask someone here.

  • So what does it output on the signal pin when triggered? Measure it. The signal is present for about half a second. The HC-SR04 PIR outputs 3V3. If your signal is 5V(I don’t know the 505), use a voltage divider to drop it to 3V3.
    – user2497
    Mar 19, 2018 at 23:19

2 Answers 2


The sr505 appears to output a 5volt signal. If anything more that 3.3 volts goes through the Raspberry Pi's pins, it can overload and destroy the Pi.

Using a logic level converter chip should allow the Pi to talk to your PIR sensor.


Well strangely, the adverts I have seen for this produce, such as this one suggest that it takes a 4.5-20Vdc supply voltage but that the output voltage is 3.3V high and 0.0V low.

If you want to be safe you could connect the device up to the RPi 5V supply and measure the voltage of the output under conditions where it is at a high logic. Having seen the schematics showing this device feeding the base of an NPN Common-Emitter transistor stage I think you could feed the output from this device through a 1K ohm resistor to the top most anode of a series of four 1N4148 diodes in series going down to ground via the bottom most cathode and then take the voltage (which will now be clamped to be no more than 4 x 0.7 Volts, i.e. 2.8V) via another resistor, say 10K ohms, to a GPIO pin set to be an input possibly with an internal pull-down. The levels concerned should be sufficient to now drive the RPi. Importantly this requires the sensor to be supplied from the RPi so that if the latter is powered down then so is the sensor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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