I was wondering how I could connect multiple 12v solenoids (more than the 53 allowed on mega because of the pins) on the Arduino Mega 2560 to get it to control the keys on a piano/keyboard/organ. Would 74HC595 shift register work for it with the 12v? (Many of them) Because there are so many high voltage solenoids is it possible to control a few of them at a time? I was wondering if someone has a link to somewhere that I could refer to. Thanks

  • 1
    you could also use a 74HCT259 or a PCF8574 to expand the number of pins – jsotola Jan 30 '18 at 18:33

Arduino I/O pins, and the output pins of 74HC595 shift registers are logic-level outputs, and are not intended to drive power-hungry items like solenoids. In either case (direct I/O or shift registers) you need to use the logic signal from the output pin to drive something else that switches the 12V source.

That something else can be a MOSFET or a relay, though often even relay coils are themselves driven by a MOSFET or other transistor that is switched by a microcontroller output pin.

One of the many search results that describe this is at http://hades.mech.northwestern.edu/index.php/Driving_using_a_single_MOSFET

| improve this answer | |
  • Ok thanks for the link and explanation - it'll help with the project! – Rocket1829 Jan 30 '18 at 18:20

the shift register has 2 features that will help you:

  1. a latch pin. When a the storage register pin is kept low the outputs won't change this allows you to shift in a new value without perturbing the outputs.

  2. a Qh' output this is the output from the last bit that bypasses the normal output. If you connect that to the next shift register you can daisy chain several registers.

The outputs of the chip are not meant to driver significant currents. Instead use them to drive a mosfet that in turn drives the relay. There are boards that contain all the support circuitry needed to drive relays using low power signals.

| improve this answer | |

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.