<div dir="ltr">Carl, Pete, I think you both missed the post I made where the relay board already has a transistor driver and opto-isolation, so he is only having to sink a couple milliamps (for the LED) per relay - nothing more.<div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 16, 2015 at 4:10 PM, Carl Nobile via TriEmbed <span dir="ltr"><<a href="mailto:triembed@triembed.org" target="_blank">triembed@triembed.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Using an ULN2003A in this case is very interesting. The only thing I'd be concerned about is opto isolation or the lack of it in this case. I'd put an opto isolator between the microcontroller and the ULN2003A so nothing can fry the circuit behind the ULN2003A. There is a built in clamping diode in the ULN2003A, so you shouldn't need to add an additional one across each relay coil.<br><div><br></div><div>All in all not a bad idea.</div><div><br></div><div>Carl</div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Jul 16, 2015 at 3:46 PM, Richard Prevette via TriEmbed <span dir="ltr"><<a href="mailto:triembed@triembed.org" target="_blank">triembed@triembed.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks Pete,<br></div>So what you are saying is the 595 is wired to the ULN2003a.  And the ULN2003a drive the relays?<br><br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 16, 2015 at 1:24 PM, <a href="mailto:pete@soper.us" target="_blank">pete@soper.us</a> <span dir="ltr"><<a href="mailto:triembed@triembed.org" target="_blank">triembed@triembed.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-family:'Calibri','sans-serif'">

Figuring that you've already bought the relays and lights, I suggest five ULN2003a relay drivers:<div><br></div><div><a href="http://www.digikey.com/product-detail/en/ULN2003A/497-2344-5-ND/599603" target="_blank">http://www.digikey.com/product-detail/en/ULN2003A/497-2344-5-ND/599603</a></div><div><br></div><div>Here's how to connect it (sorry about the hi-res):</div><div><br></div><div><a href="https://electrosome.com/wp-content/uploads/2013/05/Interfacing-Relay-with-8051-using-ULN2003.jpg" target="_blank">https://electrosome.com/wp-content/uploads/2013/05/Interfacing-Relay-with-8051-using-ULN2003.jpg</a></div><div><br></div><div>No way will the '595 drive the relays directly if they need 73ma and, as John said, if one gate does work, trying to get several on at once  is likely to exceed the limits for the whole chip, so the per-gate capability is only part of the story. Even if it could sink the current notice you don't get a full five volts out of the chip's gate and via Ohm's law the current through the coil will be lower. </div><div><br></div><div>Relay drivers will add more complexity, but the combination will work.</div><div><br></div><div>I agree with Robert that a triac would be the way to go from scratch for mains voltage lights, but if you already have all the relays and lights that was no doubt some significant cost.</div><div><br></div><div>This driver chip has internal diodes so it can handle inductive loads. An ordinary 74HC logic chip, if it could somehow handle the coil current, would be sent straight to semiconductor heaven by back EMF without a diode or RC circuit or varistor to constrain the voltage as the relay's magnetic fueld collapses (when the relay is turned off).</div><div><br></div><div>Oh, note this chip sinks current. So the '595 would drive an input and the corresponding output provides a ground path for the relay coil.</div><div><br></div><div>Finally, two more important details: The internal transustor and (yet another) diode in the driver will drop significant voltage, so for nice, reliable operation with five volt relays I strongly recommend six volts to end up with something clise to five going through the relay coils. </div><div><br></div><div>Here's a wall wart that looks like it would work well:</div><div><br></div><div><a href="http://www.digikey.com/product-detail/en/WSU060-3000/237-1626-ND/3105436" target="_blank">http://www.digikey.com/product-detail/en/WSU060-3000/237-1626-ND/3105436</a></div><div><br></div><div>Also, be sure to set up the relay supply with decoupling from whatever is powering the logic. The easy way is to use a separate wall wart for the driver commons.</div><div><br></div><div>Pete</div><div><div><div><br></div>



<br><div>----- Reply message -----<br>From: "Richard Prevette via TriEmbed" <<a href="mailto:triembed@triembed.org" target="_blank">triembed@triembed.org</a>><br>To: "Adam Haile" <<a href="mailto:email@adamhaile.net" target="_blank">email@adamhaile.net</a>><br>Cc: "<a href="mailto:triembed@triembed.org" target="_blank">triembed@triembed.org</a>" <<a href="mailto:TriEmbed@triembed.org" target="_blank">TriEmbed@triembed.org</a>><br>Subject: [TriEmbed] Driving 32 5v relays<br>Date: Thu, Jul 16, 2015 12:10 PM</div></div></div></div><div><div><br><div dir="ltr"><div>Thanks all for the comments.  Very informative.  Rodney, I wish I'd seen this board before I started but if had to buy more boards, I would look at solid state.  (I am using 4 8 channel boards.)<br><br></div>I found a 5v 3a wall adapter on Amazon $12.00.  Looks like that will do the job.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 16, 2015 at 10:33 AM, Richard Prevette <span dir="ltr"><<a href="mailto:prevette.richard@gmail.com" target="_blank">prevette.richard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>The answer the first comment is mostly money.  I am using c9 size Christmas lights for a yard display.  I have 16 PVC pips painted like candy canes with two lights per pole. <br><br></div>The second comment looks like just the ticket but would it have to be wired to car battery or a 12v wall adapter with at least<br></div>a 3 amp rating?<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 16, 2015 at 10:16 AM, Adam Haile <span dir="ltr"><<a href="mailto:email@adamhaile.net" target="_blank">email@adamhaile.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Stupid question... why not just use digital LEDs?<div><a href="https://www.youtube.com/watch?v=_nbuSgYoCSQ" target="_blank">https://www.youtube.com/watch?v=_nbuSgYoCSQ</a><br></div><div>Full disclaimer: I have a tiny business that does LED lighting stuff, but I am also just a huge fan of digital LED strips since they take away complications like those with relays and such.</div><div><br></div><div>More on your original question... no, no... not a resistor to do 14v -> 5v! You would be dropping 9v and @ 3A be dissipating 27W!   I have bins full of buck converters like the one linked below that will do 8-23V input and output a nice steady 5V. They work great and are very efficient.</div><div><br></div><div><a href="http://www.amazon.com/Nextrox%C2%AE-Display-Supply-Converter-Module/dp/B00CBCGAL8/" target="_blank">http://www.amazon.com/Nextrox%C2%AE-Display-Supply-Converter-Module/dp/B00CBCGAL8/</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Jul 16, 2015 at 11:10 AM, Richard Prevette via TriEmbed <span dir="ltr"><<a href="mailto:triembed@triembed.org" target="_blank">triembed@triembed.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div><div><div><div>I am making a Christmas light display using 32 relays.  Using arduino and four 74HC595n shift registers. <br></div>The relays are SRD-5vDC-SL-C.  Here is the question: I may be misunderstanding but the datasheet states each<br></div>relay takes 72ma.  I put  a meter across the power and that seems right.  At one point all relays will be on at the same time.<br></div>That looks like I need a power source that will supply about 2.3 amps.  32 x 72 x 1000 = 2.3a (Correct ?) <br><br></div>I have a Dell AC adapter that states output at 14v dc and 3 amps.  All I need is a resister to lower 14 to 5 volts and <br></div>I good to go?<br></div>
<br></div></div>_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<a href="mailto:TriEmbed@triembed.org" target="_blank">TriEmbed@triembed.org</a><br>
<a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" rel="noreferrer" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" rel="noreferrer" target="_blank">http://TriEmbed.org</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<a href="mailto:TriEmbed@triembed.org" target="_blank">TriEmbed@triembed.org</a><br>
<a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" rel="noreferrer" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" rel="noreferrer" target="_blank">http://TriEmbed.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<a href="mailto:TriEmbed@triembed.org" target="_blank">TriEmbed@triembed.org</a><br>
<a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" rel="noreferrer" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" rel="noreferrer" target="_blank">http://TriEmbed.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="">-- <br><div>-------------------------------------------------------------------------------<br>Carl J. Nobile (Software Engineer)<br><a href="mailto:carl.nobile@gmail.com" target="_blank">carl.nobile@gmail.com</a><br>-------------------------------------------------------------------------------</div>
</span></div>
<br>_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<a href="mailto:TriEmbed@triembed.org">TriEmbed@triembed.org</a><br>
<a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" rel="noreferrer" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" rel="noreferrer" target="_blank">http://TriEmbed.org</a><br>
<br></blockquote></div><br></div>