Manual H-Bridge DC Motor Switch
A lever makes a motor turn forwards or backwards. It is the principle of a toy car with reverse or of a door opening and closing. Two LEDs, green and red, show the direction.
Bill of materials
Everything you need to build it, with the reference you will see on the schematic.
| Qty | Part | Ref. |
|---|---|---|
| 1 | DPDT toggle switch (6 terminals, two changeover circuits) | S1 |
| 1 | Small 3 to 6 V DC motor (type 130, toy motor) | M1 |
| 1 | 330 Ω resistor (orange-orange-brown) | R1 |
| 1 | green LED | D1 |
| 1 | red LED | D2 |
| 1 | Holder with 4 AA batteries (6 V) | BT1 |
| 1 | Breadboard (400 tie-points or more) | |
| 2 | Jumper wires |
Missing parts? The kits recommended by Impeca Tech include almost all of them. See the kits
Schematic & wiring
On the left, the circuit diagram; on the right, the same circuit built on a breadboard. Both connect exactly the same things.
Wire it step by step
-
Place the components
- 330 Ω resistor R1 (bands: orange, orange, brown, gold): one leg in 3f and the other in 6f (either way round).
- green LED D1: the long leg (+, anode) in 6g and the short leg (−, cathode, flat side) in 7g.
- red LED D2: the long leg (+, anode) in 8f and the short leg (−, cathode, flat side) in 9f.
-
Add the jumper wires
- Orange wire: from 6j to 9j.
- Turquoise wire: from 7j to 8j.
-
Connect the external parts
- DPDT toggle switch (S1), one wire per terminal: C1 → 3j; A1 → the + rail; B1 → the − rail; C2 → 8i; A2 → the − rail; B2 → the + rail.
- Small 3 to 6 V DC motor (M1): one wire to 3i and the other wire to 8h.
-
Connect the battery
- Connect the holder with 4 AA batteries (6 V): the red lead to the + (red) rail and the black one to the − (blue) rail. Do this last, once everything else is in place.
-
Test the circuit
- Put the lever in one position: the motor turns and one LED (green) lights. Move it to the other position: the motor turns the other way and the red LED lights. With the multimeter, the motor voltage should be about +5 V in one position and about −5 V in the other (the sign changes). The sign depends on how you connect the probes.
How to read the holes: the letter is the row and the number is the column of the breadboard (for example 7f). The red (+) and blue (−) rails are the two long lines along the edge.
How does it work?
- 1The motor connects to the two centre terminals of the DPDT switch
- 2In position 1 the upper centre goes to the positive and the lower one to the negative
- 3In position 2 the connections cross over: current runs through the motor the other way
- 4The motor reverses and the LED for that direction lights (green or red)
A DC motor turns one way or the other depending on the direction current flows through it. A DPDT (“double pole, double throw”) switch is two changeover switches moved by the same lever, with six terminals. The two centre ones (C1 and C2) go to the motor. The outer ones are joined crosswise: A1 and B2 to the battery positive, B1 and A2 to the negative. In position 1 the motor gets the positive on one side and the negative on the other; moving the lever, the crossover swaps the polarity and the motor turns the other way. The green and red LEDs are wired in opposite directions with a 330 Ω resistor, so each only lights for one polarity: green forwards, red backwards (about 10 mA). With the 6 V pack (4 AA batteries) the type 130 motor draws about 0.25 A. Reverse when the motor has almost stopped: flipping suddenly at full speed causes a current surge and can damage the toy’s gears. Do not grip the shaft: a stalled motor draws up to 1.5 A and overheats the switch contacts.
Testing & troubleshooting
What you should see
- Lever in position 1: motor turns forwards (green LED)
- Motor voltage≈ 5.50 V
- Green LED current≈ 10 mA
- Lever in position 2: motor turns backwards (red LED)
- Motor voltage≈ -5.50 V
- Red LED current≈ 11 mA
Approximate values, calculated with typical parts. With real parts they can vary by 10 % or more.
If something does not work
The motor always turns the same way
The crossover is wrong. Check that the wires to the positive are A1 and B2 (diagonal) and those to the negative are B1 and A2. If you join A1 and A2 to the same pole nothing will reverse.
The motor does not turn in either position
Check the motor is connected to the centre terminals (C1 and C2), not the outer ones. On a toggle switch, of the three terminals in each row the middle one is the common. Also check the batteries.
Both LEDs light together or neither does
The LEDs must face opposite ways (the anode of one with the cathode of the other) and share the 330 Ω resistor. If they face the same way, both light on the same polarity.
Want to automate this circuit with code?
Learn how to program sensors and custom schedules in our e-book “Arduino from Scratch”.