Please review wiring for PIR sensor and solenoid project

Thread Starter


Joined May 19, 2024
Folks, have been working on the project and I'd appreciate any help with checking if everything wired correctly and if there's anything needs to be added or is redundant.

Project is straightforward: PIR sensor activates solenoid valve. There's switch for PIR sensor with indicator light and a button that turns on solenoid right away.

I tried assembling the above without switch/button/led and it seemed to be working. However I noticed that 12V input for Mosfet module needs to be connected to the left side of the breadboard as it loses voltage if it is on the right side (to 5V approx) as if PIR sensor acts a resistor. I tried using diode between PIR module and breadboard but in the end couldn't connect the button and the switch.

Furthermore, I have doubts on:

  • the need for pull-down resistor(s)
  • wiring of button and placement of diodes
I'm a newbie, so any advice and help is welcome! Thank you!

PIR first pass_bb.png


Joined Jun 19, 2012
This seems way over complicated, or maybe it's the hateful way Fritzing fritzes electronics into incomprehensible garbage.

The push button can simply be connected across the MOSFET module.
(but is the module switching the high side or the low side? Connect the switch across where the voltage goes to zero when the PIR triggers.)

A single flyback diode should be placed across the solenoid, cathode to the positive side
The LED, PIR and switch seem to be wired correctly.

Note that some breadboards have breaks in the power supply rails, check with ohm meter.

Don't feel bad about being confused here, Fritzing and all these poorly documented modules are not helping anyone really learn electronics.


Joined Aug 1, 2013
The circuit will work only partially. It assumes that the MOSFET module switches the +12 V. It doesn't; it switches the - (GND). You have the -IN and -OUT connected directly together through the protoboard, bypassing the FET module. The solenoid will be on continually, ignoring both the MOSFET module and the pushbutton switch.



Joined Jan 23, 2018
That wiring diagram is a bit hard to follow, for starters. While the schematic circuit of the mosfet module is easy to follow, the six terminals on the wiring diagram do not seem to be identified at all. And clearly the the V+ terminals could be left unused, because they offer no benefit at all.
While a wiring diagram may help in assembling a circuit it provides very little information as to what the circuit does..
The "pull down" for the output of the motion sensor is provided by the LED /resistor on the mosfet module.
T make the system work, which I a guessing will be to operate the solenoid when the motion detector senses motion, you will need to connect the positive supply, the motion sensor positive wire, and one of the solenoid leads together. then connect the motion sensor trigger output to the motion sensor trigger input. Then connect the supply negative to the mosfet module negative in and the motion sensor negative terminal. Last, connect the other solenoid lead to the mosfet module V-OUT terminal.
Al three motion sensor wires should now be connected, and there should be four terminals on the mosfet module connected.
At this point it should work IF the mosfet module can be switched with tjhe output of the motion sensor.
Last edited:


Joined Dec 11, 2013
I concur with Sensacell that the push button can be used directly across the switching mosfets and that the free wheeling diode is a need.


Joined Jan 23, 2018
If you look closely at the circuit of that mosfet module you will observe that the mosfets already have internal diodes.Does the solenoid load really require THREE diodes??


Joined Feb 7, 2024
Instead of building everything from the ground up like you should, you chose those modules. Now you have to make your mosfet module work for your circuit. Because they are not all the same. So the project is a PIR with a solenoid. Wired burglar alarm PIRs are already set up for your need and would be the price of half the parts you are using.

Also the data for the PIR needs to be supplied. Because most of them are designed to interface to a microprocessor.

Not everything is created the same.