I have two HC-SR501 PIR's I'd like to use to detect motion and light up a 12V LED strip when motion is detected (each PIR is assigned a LED strip).

I am, however, unsure on how to hook them up to my Wemos D1 Mini. I know I can't hook up a LED strip to an output (not enough current from the WEMOS) so, for now I just hooked up 2 leds instead while my relays are on order. My circuit works as long as only one PIR is hooked up, but when the second is hooked up the ESP8266 starts behaving weird / restarting. I guess I'm drawing too much current with two PIR's?

enter image description here

Excuse the poor photoshop. I couldn't find any online circuit diagram tool that has an Wemos D1 / ESP8266.

Ok, so, my reasoning is I'm drawing too much current. So I figure I try this:

enter image description here

This way, I can later, when the relays arrive, power the LED strip from the same 12V connection and simply hook the (now) LED contacts to a relais:

enter image description here

I was planning to power the Wemos simply from a USB power adapter (I have enough of the (genuine) 5W Apple USB power adapters laying around).

My question is: I'm unsure if this will work. Will it? If not, what would I need to change?

Basically I want to control 2 LED strips that turn on when a PIR detects movement; there is some more logic involved but that's all software. The software will be no problem. It's the circuit I'm uncertain about.

Bonus question: maybe I can do without the USB power and hook the Wemos to the 12V too? I guess I'd need a resistor? How would I hook it up correctly?

Bonus question two: Instead of a relay, I'm pretty sure I could use a MOSFET like this one (link) too, right?

I also asked this question here.

* The actual I/O pins I've used may differ, not sure, I hope the idea gets across.


1 Answer 1


If you use different supplies they should at least share one ground. According to the "datasheet" the HC-SR501 should be low power, so I'm not sure if the problem you're facing are really due to a unsufficient power supply. Do you have a chance to measure the drawn current? Could you be more specific in regards of "weird behavior"? If you want to power the Wemos from 12V I'd suggest to use a voltage regulator (LDO) instead of a simple voltage divider. And yes you could switch your LED stripes with a Mosfet instead of a relay.

  • \$\begingroup\$ I'll see if I can measure the current with my ($20) multimeter tonight. About the weird behaviour: doesn't boot, boots but serial output is garbage, boots and works for a few seconds then stops working, resets. Such things. Without changing a single thing other than pressing reset. Remove one (or the other) PIR and everything is fine. And it's not in the code; that's for sure. I will try the common ground; had no clue that was an option. Just connect the blue rail to the Wemos GND (and adapter GND) I guess? Also thanks for the MOSFET confirmation! \$\endgroup\$
    – RobIII
    Oct 29, 2018 at 13:07
  • \$\begingroup\$ It turns out one of the PIRs was broken anyway... Why I didn't notice this when trying each in isolation is a mystery to me; I guess I've mistakenly 'swapped' one with the other and put back in the same as I took out. I received a new one and now everything works ok. \$\endgroup\$
    – RobIII
    Nov 6, 2018 at 12:41

Your Answer

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

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