1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

I'm using a HC-SR501 PIR sensor and a 12V relay to switch between green (NO) and red (NC) on a LED strip, everything being powered by a 12V power supply.

Without any motion in the room, the LED strip changes color from red to green and back to red, every 24 and 45 seconds respectively, with the relay jumper set to LOW. If the jumper is set to HIGH, the strip has the red light turned on and no motion will make the relay to switch to green.

Testing the PIR sensor separately I get a normal 3.3V on the output channel for 19 seconds when motion is detected.

Can you please tell me what am I doing wrong?

enter image description here

\$\endgroup\$
9
  • 1
    \$\begingroup\$ lastminuteengineers.com/pir-sensor-arduino-tutorial \$\endgroup\$ Oct 15, 2019 at 2:03
  • 1
    \$\begingroup\$ solarbotics.com/product/52262 \$\endgroup\$ Oct 15, 2019 at 2:07
  • \$\begingroup\$ @BruceAbbott I used a similar configuration initially (create.arduino.cc/projecthub/Heathen_Hacks-v2/…) and then I dropped the arduino and connected the PIR output to the signal input for the relay. Same behaviour with and without the arduino board. \$\endgroup\$
    – Gogutz
    Oct 15, 2019 at 2:41
  • \$\begingroup\$ @Gogutz Try decoupling the PIR sensor. Place a 0.1uF ceramic capacitor in parallel with its power pins. \$\endgroup\$
    – DKNguyen
    Oct 15, 2019 at 2:44
  • 1
    \$\begingroup\$ Where's the Ground (negative) connection to your LED strip? (in your photo - since removed - it appears to go to the relay common contact). \$\endgroup\$ Oct 15, 2019 at 2:59

1 Answer 1

0
\$\begingroup\$

The PIR needs a clean Vcc and no switched bright lights near the sensor.

I don't know how much a glitch your Rleay causes on 12V nor the proximity of the LEDs near the sensor.

Here's your datasheet. https://components101.com/sites/default/files/component_datasheet/HC%20SR501%20PIR%20Sensor%20Datasheet.pdf

\$\endgroup\$

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.