Roman Haefeli,
It turns out, your solenoiduino code was useful in this project. the handshake stuff is very convenient and all i had to modify was the duty cycle in the arduino code. Instead of "how many milliseconds will the solenoid be activated?", i just re-purposed the data for the pwm values (velocity) in the Tlc5940 library's Tlc.set(pin,pwmValue); function. If you don't mind, i would like to release the code as part of the project's documentation, giving you credit for you contribution, of course.
On Thu, Aug 8, 2013 at 5:59 PM, Epic Jefferson jeffreyconcepcion@gmail.comwrote:
it works! i had forgotten to ground the arduino to the circuit. Here's the circuit.[image: Inline image 1]
2 practical maker pwmshields > Arduino's 5 volts through PNP 4403 transistors > TIP102 transistors to drive the solenoids with ~18 volts. I still have to check the resistors because I'm only getting about 4 or 5 volts at the end (it drives the motor but not the solenoids). Getting closer.
If anyone's interested, I'll be posting photos and updates on twitter and fb as 'Epic Jefferson'. Full documentation will be released a bit later.
Thanks again, you guys are the greatest. Special thanks to Charles Goyard for the PNP tip.
On Wed, Aug 7, 2013 at 8:21 PM, Martin Peach martin.peach@sympatico.cawrote:
It depends on the colour and the LED technology. The energy of red light is about 1.5eV and blue is 3eV. Add to that internal resistance of the device. An ordinary diode (not a LED) emits infrared around .6eV, which is the voltage drop of a silicon junction.
Martin
On 2013-08-07 20:02, Ed Kelly wrote:
Oh, thanks.
That was dumb I didn't remember that!
Is it really 2 volts drop for an LED? I should know this stuff... Ed Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad http://www.ninjajamm.com/
Gemnotes-0.2: Live music notation for Pure Data, now with dynamics! http://sharktracks.co.uk/
------------------------------**------------------------------**
*From:* Mikael Fernström <mikael.fernstrom@ul.ie> *To:* Ed Kelly <morph_2016@yahoo.co.uk> *Cc:* Charles Z Henry <czhenry@gmail.com>; Epic Jefferson <jeffreyconcepcion@gmail.com>; pd-list <pd-list@iem.at> *Sent:* Thursday, 8 August 2013, 0:26 *Subject:* Re: [PD] electro-mechanical piano (player piano) - Arduino, Solenoid Issue 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 /Mikael On 8 Aug 2013, at 00:19, Ed Kelly <morph_2016@yahoo.co.uk <mailto:morph_2016@yahoo.co.uk**>> wrote: Check Ohm's law.
V=IR, so the resistor you choose is the voltage you provide to the LED divided by the current it draws. 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. This is a fairly good tutorial: http://www.ehobbycorner.com/**pages/tut_transistors.html<http://www.ehobbycorner.com/pages/tut_transistors.html> Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad http://www.ninjajamm.com/ Gemnotes-0.2: Live music notation for Pure Data, now with dynamics! http://sharktracks.co.uk/ ------------------------------**------------------------------*
*------------ *From:* Charles Z Henry <czhenry@gmail.com mailto:czhenry@gmail.com> *To:* Epic Jefferson <jeffreyconcepcion@gmail.com <mailto:jeffreyconcepcion@**gmail.comjeffreyconcepcion@gmail.com
*Cc:* pd-list <pd-list@iem.at <mailto:pd-list@iem.at>> *Sent:* Wednesday, 7 August 2013, 20:41 *Subject:* Re: [PD] electro-mechanical piano (player piano) - Arduino, Solenoid Issue On Wed, Aug 7, 2013 at 12:05 AM, Epic Jefferson <jeffreyconcepcion@gmail.com <mailto:jeffreyconcepcion@**gmail.com<jeffreyconcepcion@gmail.com>>>
wrote:
Hey Charles, it seems like this might work. i got some pnp transistors and built the circuit from julianvogels site. 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. I think you just need smaller resistors. Every transistor in a 3-pin package I've ever seen could run 20mA or much greater. Swapping the transistors will have no effect on the amount of current. Chuck There are two ways to solve your problem: The proper one is to use PNP transistors or P-channel mosfets (remember I already told you about that ? :)) See this document, you can find the wiring at the end: http://julianvogels.de/wp-**content/uploads/2013/06/**
stromkreis_**transistorschaltung_final-**1024x627.pnghttp://julianvogels.de/wp-content/uploads/2013/06/stromkreis_transistorschaltung_final-1024x627.png
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/
The good enough one is to put a pull-up resistor (10k works) on every NPN transistor base, and use the TLC as a pull down. In this case, the on-time on the TLC corresponds to the off-time on the solenoid. Also when the arduino reboots and every time the BLANK is issued, every solenoid will act for a veeeeery short time. This can be a big problem in your project. I did this for a 96 channels motor+led strip system, and I regret not using PNPs instead. Enjoy, -- Charles Epic Jefferson wrote: > Hey guys, > > updating on this project. I got the pwm shields and i've hit a wall. The > driver circuit I'm using to control the solenoids via arduino is this one > from instructables > (link<http://www.**instructables.com/id/**
Controlling-solenoids-with-**arduino/http://www.instructables.com/id/Controlling-solenoids-with-arduino/ )>) > and > it uses a single pin to control the pwm signal. > > The pwm shield (link<http://www.**practicalmaker.com/products/** arduino-shields/pwm-shield-**assembledhttp://www.practicalmaker.com/products/arduino-shields/pwm-shield-assembled
)
> is > based on the tlc5940 which requires each pin to have it's own ground > instead of a common ground across all drivers. This is a problem because > all of the information i've found suggest that the signal from the pin > controls the gate (transistor - TIP102). But i think, in the case of the > tlc5940, the 5v supply is constant and the ground is being controlled, > that's why it works perfectly for LED's but seems to be ill suited for this > circuit. > > Any suggestions on how to modify the instructables circuit for use with the > shields? or would the circuit have to completely
change?
______________________________**_________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/**listinfo/pd-list<http://lists.puredata.info/listinfo/pd-list> -- www.epicjefferson.com <http://www.epicjefferson.com/**> www.avmachinists.org <http://www.avmachinists.org/> Puerto Rico based Art Collective/ Non-Profit Org ______________________________**_________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/**listinfo/pd-list<http://lists.puredata.info/listinfo/pd-list> ______________________________**_________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/**listinfo/pd-list<http://lists.puredata.info/listinfo/pd-list> ______________________________**_________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/**listinfo/pd-list<http://lists.puredata.info/listinfo/pd-list>
______________________________**_________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/** listinfo/pd-list http://lists.puredata.info/listinfo/pd-list
______________________________**_________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/** listinfo/pd-list http://lists.puredata.info/listinfo/pd-list
-- www.epicjefferson.com www.avmachinists.org Puerto Rico based Art Collective/ Non-Profit Org