wiring solenoids to TLC5940

Hi All,
I have a working circuit to drive some micro solenoids directly from my Arduino card. ( top sketch picture.)The circuit works fine. But then I decided to set up a bank of TLC5940’s so that I would have plenty of pins for my project. The problem is that my circuit expects 5v sent to the transistor base to trigger the npn transistor but the pinouts of the tls5940s don’t supply 5v. Instead they act as grounds. ( see bottom picture.) How would I change the wiring to fire the solenoids when the tlc5940 makes a ground connection? Thanks for any suggestion.

Why tlc5940? That does not seem like a suitable chip for driving solenoids, even via transistors. Why not simply use 74hc595?

Your schematic makes no sense (even before you ripped and crumpled it up). Why is there a 1K between ground and ground? You should have a resistor in series with the transistor's base pin, otherwise the Arduino pin will be damaged. Is that where you meant to draw the 1K? The emitter should connect to ground and the collector to the solenoid.

A better chip for you to consider would be tpic6b595. It is like a 74hc595 but with built-in transistors, so it can drive the solenoids directly, as long as they don't require more than 150mA to operate. If that's not enough, there is tpic6a595 and tpic6595 that can handle more current.

The only reason I'm using the 5940 is because I didn't know the difference, until now when I tried driving the transistors and realized the voltage was negative instead of positive. Thanks for the advice. I will research using the 595s. Do they output 5v and can they be daisychained as well?

PaulRB:
Your schematic makes no sense (even before you ripped and crumpled it up). Why is there a 1K between ground and ground? You should have a resistor in series with the transistor’s base pin, otherwise the Arduino pin will be damaged. Is that where you meant to draw the 1K?

I couldn’t tell you. I just went by a schematic that I found somewhere, and it seems to work fine even driving 18 solenoids. I know almost nothing about electronics except for how to read schematics ( to some degree ) and to solder.

PaulRB:
Your schematic makes no sense (even before you ripped and crumpled it up). Why is there a 1K between ground and ground? You should have a resistor in series with the transistor's base pin, otherwise the Arduino pin will be damaged. Is that where you meant to draw the 1K? The emitter should connect to ground and the collector to the solenoid.

A better chip for you to consider would be tpic6b595. It is like a 74hc595 but with built-in transistors, so it can drive the solenoids directly, as long as they don't require more than 150mA to operate. If that's not enough, there is tpic6a595 and tpic6595 that can handle more current.

That is great advice. Thanks so very much! I was wasting hours and hours trying to figure out how I could make it work. I will order up a set of the tpic6b595's.

Well, good luck to you. I have to say that you seem to be trying to run before you can even crawl. At least you are not trying to run with scissors (=240V AC)! But you should have left that schematic in the trash where you found it, it was there for a reason. I hope that the tpic6b595 work out for you, they should be ok because your solenoids draw less than 150mA, don’t they?

Yes, the solenoids are rated at 120ma. I've already had a bank of 18 solenoids running on an arduino uno using both a 2222 transistor and a diode on each solenoid. It all ran fine with no detectable overheating to operate my player piano and I was even having it play chords with no issues ( multiple solenoids activated at once.) The solenoids are acting as air valves and mounted in racks that I designed and 3d printed. I'll need 90 something solenoids to operate all the notes plus some other system controls such as sustain, soft pedal, etc. Once again, thanks for your help. I've ordered the tpic6b595s and sockets and I'm upgrading to a Raspberry Pi 3 B+ which should be fun to play with and hopefully help me integrate with midi files to operate this system once I get this hardware up and running.

Ok then. When the tpic chips arrive, draw us a schematic of how you will wire them up to the Arduino/Pi and the solenoids. We can check that for you and hopefully prevent any damaged components.

PaulRB:
A better chip for you to consider would be tpic6b595. It is like a 74hc595 but with built-in transistors, so it can drive the solenoids directly, as long as they don’t require more than 150mA to operate. If that’s not enough, there is tpic6a595 and tpic6595 that can handle more current.

If your last citation was meant to be a TPIC6C595, it is rated for less current - 100 mA.

Paul__B:
If your last citation was meant to be a TPIC6C595, it is rated for less current - 100 mA.

No, Paul, it wasn't meant to be the "C" variant. Tpic6595 can sink 250mA per output.

How curious - funny numbering. It is wedged in between "A" and "B"! Will keep that in mind.

TPIC6C595 100 mA
TPIC6B595 150 mA
TPIC6595 250 mA
TPIC6A595 350 mA

jcmusix:
I couldn't tell you. I just went by a schematic that I found somewhere, and it seems to work fine even driving 18 solenoids. I know almost nothing about electronics except for how to read schematics ( to some degree ) and to solder.

Well its completely wrong - not only is that resistor in the wrong place, its the wrong value
and the collector and emitter of the 2N2222 are swapped.

emitter to ground
base via 220 ohm resistor to Arduino pin. 1k is too large unless you are only driving a couple of LEDs.
collector to solenoid, +ve to solenoid, diode across solenoid with cathode to +ve supply.