<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">note that you have to subtract the voltage drop over the LED, hence it's R = (Vsupply - Vled)/ Iled, e.g. (5-2)/0.02 = 150 Ohm<div><br></div><div>/Mikael<br><div apple-content-edited="true"><br>
</div>
<br><div><div>On 8 Aug 2013, at 00:19, Ed Kelly &lt;<a href="mailto:morph_2016@yahoo.co.uk">morph_2016@yahoo.co.uk</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 12pt; "><div><span>Check Ohm's law.</span></div><div style="font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal; "><span><br></span></div><div style="font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal; "><span>V=IR, so the resistor you choose is the voltage you provide to the LED divided by the current it draws.</span></div><div style="font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal; "><span><br></span></div><div style="font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal; ">e.g. if the LED draws 20mA and you power it from 5V, then the
 resistor you need is 5/0.02 = 250 ohms in series with the LED. This current is drawn from the positive voltage supply through the resistor and then the LED, and then the transistor.</div><div style="font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal; "><br></div><div style="font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal; ">This is a fairly good tutorial:</div><div style="font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal; "><a href="http://www.ehobbycorner.com/pages/tut_transistors.html">http://www.ehobbycorner.com/pages/tut_transistors.html</a><br></div><div></div><div>&nbsp;</div><div>Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and
 iPad<br><a href="http://www.ninjajamm.com/">http://www.ninjajamm.com/</a></div><div><br><br></div><div>Gemnotes-0.2: Live music notation for Pure Data, now with dynamics!<br><a href="http://sharktracks.co.uk/">http://sharktracks.co.uk/</a>&nbsp;</div><br> <div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Charles Z Henry &lt;<a href="mailto:czhenry@gmail.com">czhenry@gmail.com</a>&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Epic Jefferson &lt;<a href="mailto:jeffreyconcepcion@gmail.com">jeffreyconcepcion@gmail.com</a>&gt; <br><b><span style="font-weight: bold;">Cc:</span></b> pd-list &lt;<a href="mailto:pd-list@iem.at">pd-list@iem.at</a>&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, 7 August 2013, 20:41<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [PD]
 electro-mechanical piano (player piano) - Arduino,        Solenoid Issue<br> </font> </div> <div class="y_msg_container"><br><div id="yiv5739215461"><div dir="ltr"><div class="yiv5739215461gmail_extra"><div class="yiv5739215461gmail_quote">On Wed, Aug 7, 2013 at 12:05 AM, Epic Jefferson <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:jeffreyconcepcion@gmail.com" target="_blank" href="mailto:jeffreyconcepcion@gmail.com">jeffreyconcepcion@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="yiv5739215461gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr">Hey Charles,<div><br></div><div>it seems like this might work. i got some pnp transistors and built the circuit from julianvogels site.</div>
<div>The only problem is that the LED on the test circuit barely lit up. I think it's because the transistors are not for 20mA, none were available. i'll check another electronics store to see if i find some.<br></div>
</div></blockquote><div><br></div><div>I think you just need smaller resistors.&nbsp; Every transistor in a 3-pin package I've ever seen could run 20mA or much greater.&nbsp; Swapping the transistors will have no effect on the amount of current.<br>
<br></div><div>Chuck<br></div><div><br>&nbsp;</div><blockquote class="yiv5739215461gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr"><div></div></div><div class="yiv5739215461gmail_extra"><div><div class="yiv5739215461h5">
<div class="yiv5739215461gmail_quote"><blockquote class="yiv5739215461gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
There are two ways to solve your problem:<br>
<br>
The proper one is to use PNP transistors or P-channel mosfets (remember<br>
I already told you about that ? :))<br>
<br>
See this document, you can find the wiring at the end:<br>
<a rel="nofollow" target="_blank" href="http://julianvogels.de/wp-content/uploads/2013/06/stromkreis_transistorschaltung_final-1024x627.png">http://julianvogels.de/wp-content/uploads/2013/06/stromkreis_transistorschaltung_final-1024x627.png</a><br>


<br>
<a rel="nofollow" target="_blank" href="http://julianvogels.de/extending-pwm-output-pins-with-a-texas-instruments-tlc5940-led-driver/">http://julianvogels.de/extending-pwm-output-pins-with-a-texas-instruments-tlc5940-led-driver/</a><br>


<br>
<br>
The good enough one is to put a pull-up resistor (10k works) on every<br>
NPN transistor base, and use the TLC as a pull down. In this case, the<br>
on-time on the TLC corresponds to the off-time on the solenoid. Also<br>
when the arduino reboots and every time the BLANK is issued, every<br>
solenoid will act for a veeeeery short time. This can be a big problem<br>
in your project. I did this for a 96 channels motor+led strip system,<br>
and I regret not using PNPs instead.<br>
<br>
<br>
Enjoy,<br>
<br>
--<br>
Charles<br>
<div><br>
<br>
<br>
Epic Jefferson wrote:<br>
&gt; Hey guys,<br>
&gt;<br>
&gt; updating on this project. I got the pwm shields and i've hit a wall. The<br>
&gt; driver circuit I'm using to control the solenoids via arduino is this one<br>
&gt; from instructables<br>
</div>&gt; (link&lt;<a rel="nofollow" target="_blank" href="http://www.instructables.com/id/Controlling-solenoids-with-arduino/">http://www.instructables.com/id/Controlling-solenoids-with-arduino/</a>)&gt;)<br>
<div>&gt; and<br>
&gt; it uses a single pin to control the pwm signal.<br>
&gt;<br>
</div>&gt; The pwm shield (link&lt;<a rel="nofollow" target="_blank" href="http://www.practicalmaker.com/products/arduino-shields/pwm-shield-assembled">http://www.practicalmaker.com/products/arduino-shields/pwm-shield-assembled</a>&gt;)<br>


<div>&gt; is<br>
&gt; based on the tlc5940 which requires each pin to have it's own ground<br>
&gt; instead of a common ground across all drivers. This is a problem because<br>
&gt; all of the information i've found suggest that the signal from the pin<br>
&gt; controls the gate (transistor - TIP102). But i think, in the case of the<br>
&gt; tlc5940, the 5v supply is constant and the ground is being controlled,<br>
&gt; that's why it works perfectly for LED's but seems to be ill suited for this<br>
&gt; circuit.<br>
&gt;<br>
&gt; Any suggestions on how to modify the instructables circuit for use with the<br>
&gt; shields? or would the circuit have to completely change?<br>
<br>
</div><div>_______________________________________________<br>
<a rel="nofollow" ymailto="mailto:Pd-list@iem.at" target="_blank" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a rel="nofollow" target="_blank" href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a><br>
</div></blockquote></div><br><br clear="all"><div><br></div></div></div><div class="yiv5739215461im">-- <br><a rel="nofollow" target="_blank" href="http://www.epicjefferson.com/">www.epicjefferson.com</a><br><a rel="nofollow" target="_blank" href="http://www.avmachinists.org/">www.avmachinists.org</a> Puerto Rico based Art Collective/ Non-Profit Org
</div></div>
<br>_______________________________________________<br>
<a rel="nofollow" ymailto="mailto:Pd-list@iem.at" target="_blank" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a rel="nofollow" target="_blank" href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br></div></div></div><br>_______________________________________________<br><a ymailto="mailto:Pd-list@iem.at" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br><br><br></div> </div> </div> </blockquote></div>  </div></div>_______________________________________________<br><a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a><br></blockquote></div><br></div></body></html>