Greenhouse automation with NodeRed and Pi - Flyback Diode question

227 views
Skip to first unread message

Rob Jameson

unread,
Mar 21, 2017, 12:18:23 AM3/21/17
to Node-RED
Hi Node-Red Gurus,

I've recently begun a greenhouse automation system with NodeRed. The NodeRed part is super easy....  Inject node -> Interval node -> GPIO output.... I'm amazed.

In the process I'm learning about making the circuit and have a question... my current wiring is below, which is tested and working.  I know that it's good to use a flyback diode like this (https://www.adafruit.com/products/755) somewhere in the jumper cables used on this wiring to keep the relay from surging and messing up the pi. However I don't know where this should go! 

I'm running the relay off the 5v, a ground pin, and sending the signal via Pin 17. Should the diode be on the 5v then? or Pin 17?

Also, in some instructables, I've seen people use transistors, and I'm unsure if this is needed if using 5v.  (http://www.instructables.com/id/Raspberry-Pi-Controlled-Irrigation-System/step9/Circuit/)

So my questions are 1) Where does the flyback diode go? and 2) Do I need a transistor?

Thank you!! I'm happy to share the simple flow if needed.... 


Dave C-J

unread,
Mar 21, 2017, 2:44:37 AM3/21/17
to node...@googlegroups.com
Normally it good across the coil of the relay BUT it looks like you have one of those integrated relay boards that should already have both the transistor and diodes already built in. So no need for extra.

Rob Jameson

unread,
Mar 23, 2017, 1:33:09 PM3/23/17
to Node-RED
Well that's the best kind of answer :)

Thank you Dave C-J!

Csongor Varga

unread,
Mar 23, 2017, 1:39:34 PM3/23/17
to Node-RED
I am also using these generic Chinese relay boards. I think most even have opto isolation. It works with a piece of wire, nothing else. Just note that some of them are active low not active high. But you figure that out very quickly.

Julian Knight

unread,
Mar 23, 2017, 1:46:26 PM3/23/17
to Node-RED
I think that the opto isolation thing came up a while ago, I vaguely remember there is a way to differentiate the isolated ones from the non and I think most of the cheap ones aren't?

But take that with a pinch of salt, I am definitely not an expert on that.

Csongor Varga

unread,
Mar 23, 2017, 2:56:24 PM3/23/17
to Node-RED
Yeah, could be. If you see a 4 pin black blob, that is most probably opto isolation. I do not underestimate Chinese manufacturing. We may thing it is more expensive, but it could be the other was around.

Colin Law

unread,
Mar 23, 2017, 5:24:41 PM3/23/17
to node...@googlegroups.com
Yes, the four pin black chip is the opto-isolator. Don't bother trying
to use a board without the optos.

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/4dd5cc1f-8e14-4503-b8b0-762e0a1c76ad%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages