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 '18 at 16:57

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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