# Control 16 motors with 8 relays

I build a project using 8 relays in a matrix (charlieplexing) to control 16 motors (actuators), plus one relay to control two DPDT relays to reverse the power for the motor to turn reverse. I only need to run one motor at a time.

When testing it i found that current will run though the motors and start other motors in the grid.

Is there anyway this would be able to work or do I need a relay for each motor?

• That's so cool that you set out to test the matrix idea and found that motors are also generators! +1 for that.
– jonk
Commented Sep 13, 2020 at 4:02
• @jonk - They're not "generators", it's just that they end up in series and so are energized by the supplied voltage, just not as much as the selected motor. If it weren't for the requirement to be reversible, a simple diode per motor would solve this problem. Commented Sep 13, 2020 at 16:40

After several iterations (which can be seen in edit history), I think this arrangement is optimal for practical reasons: it requires the smallest number of separate relays to drive (7 relays), and they can all be of the same commonly available type DPDT.

To enable a motor, K1 and K2 are used to select the correct column. Then K3-K6 are used to select the row. The lower end of all other motors on active column gets disconnected, ensuring that no current flows through them. Finally, K7 can be used to reverse direction.

simulate this circuit – Schematic created using CircuitLab

• Hi @jpa, Congratulations, you have reduced the contact count by 4! The algorithm should be for the optimum number of contacts and not relays. As of now, it appears to be 20 + 4. Commented Sep 13, 2020 at 17:38
• Hi @jpa, I've considered DPDT as 4 contacts. That way, your tally now would be 21 against 20 for 16xSPST + 1xDPDT. Commented Sep 13, 2020 at 18:11
• this is really clever. You should probably flip K2 to show the circuit in the rest position, (all motors stopped) Commented Sep 13, 2020 at 21:45
• @jpa This would work instead of 16 + 1 DPDT you got it down to 11 saving me 5 relays and a lot of wire. Thanks Commented Sep 14, 2020 at 0:39
• @BobT The above circuit does allow disabling all motors. It's the default state as drawn. But yeah, for PWM speed control a MOSFET could be added near K7.
– jpa
Commented Sep 14, 2020 at 13:59

You could do it with 8 + 4 + 2 + 1 SPDT relays + 2 SPDT for direction/on-off, a total of 17 relays, but it would be simpler with 16 SPST and 2 SPDT for a total of 18 relays, or 16 SPST + 1 DPDT = 17 relays.

Also possible with 4 + 2 + 1 DPDT + 3 SPDT = 10 relays.

– jonk
Commented Sep 13, 2020 at 4:02

If not for the need to run the motors in reverse, it would have been simple to use 8 SPST relays and 16 diodes to carry out the task.

Four 5PST, four SPST and one DPST relay would be required to satify the reversing requirement.

• Wow, not only did you meet OP's original target for number of relays, you got reversing in as well! Too bad 5PST power relays are so rare... Commented Sep 13, 2020 at 14:17
• Hi @Harper - Reinstate Monica, Thank you! Yes, you're right, the 5PST relays would be quite expensive too. Commented Sep 13, 2020 at 16:34
• Hi @jpa, Your answer is more than valid, with 4 contacts less, and certainly deserves pride of place! Commented Sep 13, 2020 at 17:24
• That was my first thought then I realize it would work since I have to be able to go reverse (actuator) Commented Sep 13, 2020 at 17:25
• Hi @Bob T, Of course, every solution will have it's plus and minus points. For example, my solution requires 2 relays (1 each for row and column) activated to run a motor whereas JPA's requires up to a total of 5. Commented Sep 14, 2020 at 11:12

Charlieplexing works with LEDs for two reasons:

1: LEDs only pass current in one direction

2: LEDs require a minimum voltage below which there is no light produced.

Motors have neither of those features.

either you need one simple SPST (form A) relay for each motor or a tree of more complicated (muilti-pole dual throw) relays to select which motor to run.

• Could you select one of the 16 relays with Charlieplexing? Commented Sep 13, 2020 at 14:16
• maybe if you used opto-islated drivers, or added series zeners to improve the voltage threshold.and series diodes for selection, seems messy. straight 4x4 multiplex would be tidier, but uses lots of GPIO and other parts, especially compared ro 2 CD4017 and 2 ULN2803 Commented Sep 13, 2020 at 22:02