I am in the process of designing a project that will allow a Raspberry Pi to "print" to an old (60s) electric typewriter. I have decided to have a push-solenoid for each key (24V), for 48 total keys. I have chosen a set of decoders (74VHC138M) to take a six-bit output from the RasPi GPIO pins to select the solenoids (one at a time).

I am trying to figure out how to drive the solenoids, and I think an optocoupler might be a good idea (something like this: LTV-847).

My question: can I drive the solenoid straight through the LTV-847 simply by triggering the optocoupler with the decoder? I was looking at this post and I'm wondering if will be necessary to build a Darlington (one for each of the 48 keys...). I'm hoping I don't have to do that, but if it necessary, I want to do it correctly.

  • 1
    \$\begingroup\$ LTV-847 : Error 404. But solenoids usually take more current than an opto can handle. Anyway assuming you only need to press 1 key at a time( * ), why not a 6*8 matrix? Eight 1-amp drivers on the low side and six PNP transistors on the high side, turned on by a 138. (* You may need a separate driver for the shift key!) \$\endgroup\$ – user_1818839 Feb 28 '15 at 17:49
  • 1
    \$\begingroup\$ Thanks -- fixed the link. Your suggestion is exactly what I was looking for, which is a better way to do it. And yes, a separate driver for the shift! Thank you! \$\endgroup\$ – Chris Gregg Feb 28 '15 at 18:23
  • \$\begingroup\$ And to save I/O pins, since type writers run one key at a time, you can use an additional 3-8 decoder for driving to the 1A low side drivers. This should lead to the need for just 8 I/O lines. [3] select PNP for high side. [3] select low side driver. [1] enable low side decoder for timing pulse. [1] to turn shift key driver on and off. \$\endgroup\$ – Michael Karas Feb 28 '15 at 18:33
  • \$\begingroup\$ @Brian Drummond: Don't forget that you need isolation diodes for each solenoid if you do a matrix. \$\endgroup\$ – Dwayne Reid Feb 28 '15 at 18:34
  • \$\begingroup\$ And isolation diodes don't combine well with flyback protection... I think a string of 6 TPIC595's might be a bettre idea (provided that they can handle the solenoid current, which the OP has not stated). \$\endgroup\$ – Wouter van Ooijen Feb 28 '15 at 18:57

My suggestion is to see if any of the TPIC family of shift registers from TI can handle the solenoid current. For example, the TI website says that the TPIC6595 is good for 250 mA continuous, 750 mA peak, 1.5 Amps pulsed.

I honestly don't know what the difference is between peak current and pulsed current but TI does make the distinction.

The TPIC6A595 (note the extra "A" in the middle) is good for about 30% more current than the 6595.

Also note that this family of chips contains circuits that clamp the inductive spike from the solenoids. You don't need catch diodes for your solenoids with these chips.

6 of these chips should be able to drive all 48 solenoids. You can either daisy-chain the serial out to in (slower) or drive the 6 chips with separate data lines (but common clock & latch lines) for faster operation. Personally, I suspect that the serial scheme would be fast enough (shift out 48 bits, assert the latch line, repeat as necessary).

  • \$\begingroup\$ Interesting idea, and six chips is many fewer than I thought I might need. This does not have to be fast -- you need to wait at least 0.1 seconds between key strikes, so the daisy-chaining would be plenty fast. Plus, I really like the simplicity of shifting in 48 bits on one line! \$\endgroup\$ – Chris Gregg Feb 28 '15 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.