I would like to control 16 separate solenoid locks using PWM (It is not imperative that the lock is 12V, it could be 6V for example). The PWM source is this 16-channel servo driver from Adafuit. Is this possible?

I will only ever be driving one solenoid lock at a time. If it's not possible to do using the servo driver, I would like suggestions on how I could go about controlling all 16 locks.

2 Answers 2


PWM and solenoids, hmm doesn't sound like a good idea.

The solenoids you refers to are either on or off, why do you want a half locked/open lock?

I would propose 16 relays with driver circuits since the Raspberry Pi can only drive 16mA per GPIO and and not exceeding a total for all GPIO of 50mA.

  • I guess my question is: Is there a way I can set the PWM to give a basically always-on/100% duty cycle that mimics a DC signal? The board is very easy to use and program, so I want to keep using it if possible to drive my locks.
    – cornflake
    Sep 5, 2017 at 10:00
  • Yes of course 100% = On and 0% = Off. but it can only control 5V/25mA per port and the datasheet for the solenoid mention 12V/500mA per Solenoid. And be aware that the PWM board has no fly back diode protection.
    – MatsK
    Sep 5, 2017 at 14:47

It managed to do it. I needed a MOSFET to switch enough current and a flyback diode to protect the transistor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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