[mortenbs.com home]
Music
Music
IT
IT
Videos
Videos
Contact
Contact
[icon] DC motor control and H-Bridge | mortenbs.com
Last updated Dec 2011.

DC Motor Control
A digital motor control is able to turn the motor on/off, and maybe even reverse the motor.
An analog motor control is further able to regulate the speed of the motor.
Both types is used for many appliances.

Table of contents
[pil] H-Bridge
[pil] Analog H-Bridge of transistors
[pil] Digital H-Bridge of relays
[pil] Digital H-Bridge of four solid state relays
[pil] Digital H-Bridge with analog voltage regulator (Analog and digital combined, PNP version)
[pil] Analog (or PWM) voltage regulator separated
[pil] Controlling relays or 12 volt DC equipment by 5 volt DC signal
[pil] Combining 8 channels digital/analog switch
[pil] One direction motor control for Arduino 5v (PWM)
[pil] Example of a simple motor control for helicopter

H-Bridge
To reverse a DC motor it is needed to swap the power (+) and the ground [gnd] , with an H-Bridge.
An H-Bridge can also operate both digital and analog.
Below is one example of an analog bridge of transistors,- and two examples of a digital H-Bridge of relays.
It's also possible to combine the digtal and analog features into a motor control. See further below...

Analog H-Bridge of transistors
An analog H-Bridge can be used for small voltage, light motor loads, and for short periods of time.
It's not recommended to use a purely analog bridge for heavy loading, because of a number of problems.
These problems is to properly pull down transistors, and also to eliminate power spikes and noise from the motor.
Instead look at the Digital H-Bridge with analog voltage regulator section to find more info about that.
Rough theory of an analog transistor H-Bridge without pull-down could look like this:
[Image] [Image]
In example above, PWM-signals from an Arduino controls a ~12 volt motor.
Note that in the example, two analog (or PWM)-signals is required to drive the motor forwards and backwards.
In the picture, mosfet's was used, they could easily be replaced with smaller transistors like the BD135/BD136 or even BC547/BC557.
But again - the purely analog H-Bridge is not recommended for heavy loading and so on...

Digital H-Bridge of relays
Four solid state relays can be used, but even better two latching relays (bistable) of two relaxed states can be used.
Using latching relays, they only need to be pulled when reversing, unlike of using solid state relays, two of them needs-
to be pulled to even drive forwards. With four solid state relays it is easy to add braking feature. Using latching relays,
braking feature needs an extra solid state relay, to short circuit the motor plus and minus.

Digital H-Bridge of four solid state relays
Illustration below shows how to use four relays for an H-Bridge. One or two power supplies can be used.


[Image]

[Image]

Use rectifier diodes to set the relays for forward, backward and braking:

TerminalDescription
Fwd, Brk, BwdDigital signals
A1, B1Forward, for relay switch
A2, B2Reverse, for relay switch
A2, B1Brake (Motor short circuit)
NONEFree run (Nothing)

[Image] [Image]

[Image]

Digital H-Bridge with analog voltage regulator (Analog and digital combined, PNP version)
For combining the digtal and analog features into a motor control, two latching relays can be used to do the bridging, -
and then a PNP transistor is used to regulate the speed.
This way, one digital signal for reversing switch is needed, and one analog (or PWM) signal is needed to regulate the speed.

TerminalDescription
+12v12 volt DC, ex. battery
+24v24 volt DC, motor power supply
GndGround
REV sw.Reverse switch signal 5 volt DC
AMT pwmAnalog (or PWM) signal (speed)
OUTOutput for H-Bridge / motor
A, BMotor output
1 x Double latching relay (for reversing).
1 x PNP power transistor (like A1264n) (for regulating speed), with resistor R2 (47 ohm).
2 x BD135 NPN transistor (for relay + inverting PWM to ground signal), with resistors R and R3 (330 ohm).
2 x 1N4448 diode, 75V/0,1A (to protect the two 5 volt input signals).
1 x Large diode (to protect the output from motor spikes and noise).

Analog (or PWM) voltage regulator separated, for motor control
In example below, now three power transistors is combined to have more amp's available for the motor.

TerminalDescription
+24v24 volt DC motor power supply
GndGround
REV sw.Reverse switch signal 5 volt DC
PWM signalAnalog (or PWM) signal (speed)
OUTOutput for H-Bridge / motor
The PNP power transistor's signal is ground, therefore a BD135 NPN transistor is used to invert the signal to ground, from 5 volt DC signal.
Each power transistor output is protected by a large diode to protect the transistor from motor spikes and noise.
Resistors R (330 ohm) and resistors R2 (47 ohm) is to define signal voltage on the transistors.

Controlling relays or 12 volt DC equipment by 5 volt DC signal
Illustration below controls digital and analog equipment from 5 volt.
The 5 volt signal could be from Arduino PWM or digital outputs.

TerminalDescription
+12v12 volt DC, ex. battery
GndGround
A (Left)Output
A (Right)Signal, 5 volt DC
The signal input is protected by a diode, also output is protected from external spikes and noise.
Pull-down resistor (R2) on small transistors is to ensure turning off the switch when no signal.
The pull-down resistance (R2) must be higher than the signal resistance (R)...

Example of the switch above to control 12 volt DC equipment
Transistor (Small): BC547 NPN with resistor R (330 ohm), and pull-down R2 (10 KOhm), protected input 1N4448 diode (75V/0,1A).
Transistor (Large): BD136 PNP with resistor R3 (680 ohm), protected output 1N4007 diode (1KV/1A).

Combining 8 channels digital/analog switch
It's easy to combine multiple switches. Below is an example of 8 channels together...
Like in the example above all signal and outputs is protected by diodes.
The ground and power inputs is put together into single terminals...

[Image]

TerminalDescription
+12v12 volt DC, ex. battery
GndGround
1..8 inputsSignals, 5 volt DC
1..8 outputsOutputs, 12 volt DC



One direction motor control for Arduino 5v (PWM), Forward direction only.
One-Direction Motor Control
TerminalDescription
+7v7 volt DC, battery
GndGround
ASignal, 5 volt DC (analog, digital or PWM)
This simple circuit controls a motor with an Arduino/PWM signal (or any 5 volt input).
The circuit can be used for airplane or helicopters (when reversing the motor is not used).

Example (7-9 volt source power)
BD135 NPN transistors
22-47 ohm resistor


Example of a simple motor control for helicopter
Based on 2x "One direction motor control" as seen above
[Image] [Image]
1: Arduino GND (1 pin)
2: Arduino PWM Input 5v (4 pins)
3: Motor output 7-9v (4 pins)
4: Battery input 7-9v (2 pins)
5: Servo 1 output (3 pins) (powered from battery and controlled by PWM signal)
6: Servo 2 output (3 pins) (powered from battery and controlled by PWM signal)



[pil] Your comment or message

See also
[icon] Robots and robotics - Robots and robotics. Electronic circuits for robot, motor control and more…
[icon] Small circuits - Small electronic circuits. Delayed power on circuit, Delayed power off circuit, A simple...
[icon] Arduino - Arduino source code examples, Arduino projects and circuits, robotic projects and more....
[icon] Electronic components - Information about electronic components
[icon] Resistor - A resistor is used to lower the voltage in an electronic circuit. Resistor color values...
[icon] Transistor - A transistor is by it self a small power inverter. NPN-transistors reacts to positive and...
[icon] LPT relay board circuits - LPT relay board circuits. Information about LPT, videos, links etc. Before we had the...
[icon] IT - IT/Technology. Various projects and information about computer technology and electronic...


[icon] mortenbs.com