The relays should just switch 12v polarity to the linear actuator to change direction. The issue to me seems to be in the 12v circuit. If you want to add "kickback" diodes, the easiest is a rectifier bridge at the relay with "+" and "-" connected to the 12 V supply and the "~" terminals to the actuator connections.Īs I mentioned in the OP, the logic signal goes correctly to the relay, as evidenced by the relays onboard LEDs which light up according to requirements.
Similarly, the PIR connections run together as bundles of three directly from the PIRs to the NodeMCU.įinally, the power for the actuator should run - as a pair - from the two battery terminals to the relay contacts and from them as a pair to the actuator. As you gather, "Vcc"on the relay module connects to the "5V" terminal on the NodeMCU and the two "in" terminals on the relay module travel to the NodeMCU bundled along with this connection, you do not connect the ground. You run the 5 V and ground as another pair from the converter to "JD-VCC" (with the link removed) and ground on the relay module. You run the 5 V and ground as a pair to the NodeMCU. On the "buck" converter module, the two grounds will actually be the same, however you must connect all the 5 V grounds back to the output ground, not to the input or battery.
This also applies to a control signal and its return, such as the switch you show. In all cases, you must run the supply and ground bundled together as a pair. Connect 12 V and ground from the battery to the converter. So you have a 12 V to 5 V "buck" converter module.