In Node-Red, whenever I put a single status type for reading the GPIO status or GPIO in/out in the flow, it turns on the relay. I cannot turn of it by injecting 0 value as string. When I delete all types that relates GPIO, the relays turns off.

My relay is http://www.circuitbasics.com/wp-content/uploads/2015/11/SRD-05VDC-SL-C-Datasheet.pdf

And the flow is:

{[{"id":"8b7dff4.351fe","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"cf51fbe9.097e28","type":"status","z":"8b7dff4.351fe","name":"","scope":["453e7f43.ea0a1"],"x":218.5,"y":227,"wires":[[]]},{"id":"453e7f43.ea0a1","type":"rpi-gpio out","z":"8b7dff4.351fe","name":"","pin":"11","set":"","level":"0","freq":"","out":"out","x":343.5,"y":296,"wires":[]}]}    
  • There are many different types of relay, each type requiring different control methods. You need to research the exact interface required to control your relay. If you want help you need to edit your question and link to the model of the relay and link to the relay specifications.
    – joan
    Nov 4, 2018 at 16:57

1 Answer 1


I don't think it is safe to drive that relay directly from the Pi.

There is no back EMF protection. You could destroy the GPIO and the Pi.

Also the coils require 5V to energise. The Pi GPIO are all 3V3.

Furthermore a Pi GPIO can only supply about 20ma at 3V3, that relay requires about 140ma to energise the coil.

I strongly suggest you ask this question on electronics stack exchange rather than here.

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.