0% found this document useful (0 votes)
54 views7 pages

Motor Controller

This document provides instructions for building a DC motor controller using two relays. It begins by discussing common solutions like using an H-bridge module, but notes these have limitations for larger motors. It then presents a better two-relay solution that allows controlling a motor's direction without risk of short circuit. Wiring diagrams and an explanation of the four possible relay configurations are provided. It notes this approach is intrinsically safe and uses less components than a four-relay H-bridge. Finally, examples are given for controlling a motor with limits using a three-way switch and endstop switches wired to the relay module.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views7 pages

Motor Controller

This document provides instructions for building a DC motor controller using two relays. It begins by discussing common solutions like using an H-bridge module, but notes these have limitations for larger motors. It then presents a better two-relay solution that allows controlling a motor's direction without risk of short circuit. Wiring diagrams and an explanation of the four possible relay configurations are provided. It notes this approach is intrinsically safe and uses less components than a four-relay H-bridge. Finally, examples are given for controlling a motor with limits using a three-way switch and endstop switches wired to the relay module.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

instructables

DC Motor Controller With Two Relay

by garzo

In several projects one big task is the control of a DC which is the same concept of a motor shield but its
motor, and by "control" i mean start/stop and switch control pins are designed to be more accessible.
between cw and ccw movement and to proper use
some endstops. Second: this task becomes harder as the motor
becomes bigger, at some point the required current
I saw several ways to approach this probelm, some can't be managed by the most common h-bridge
are clever, some aren't so smart. Since i mostly saw modules. Moreover most transistor based H-bridge
"less than optimal" solutions i decided to write this doesn't provide galvanic isolation (even if it's
tutorial. theoretically feasilble it's just not a feature of the most
common h-bridge modules), and this could also be an
First: as long as the motor is "small enough" the issue for your project if it's sensitive to electrical
cheap and easy solution is to use an H-bridge noise.
transistor based control module. The most common
devices are the Arduino's "Motor Shield" (amazon, ba Then what should you do to a big DC motor?
nggod) or the L298N module (amazon, banggod),

DC Motor Controller With Two Relay: Page 1


Step 1: First Solution (bad)

The first solution is somehow suboptimal but still it's Several projects use four relay to build a mechanical
the usual solution that you'll see surfing the web. copy (relays are mechanical switches) of a transistor

H-bridges. Long story short: the four NO connections the same time you'll short the power supply, and this
(NO means "normally open", the relay's contacts that could cause damages to the power supply and/or the
don't conduct current when the relay is not active) are circuit itself.
set up as the conceptual H-bridge switches.
You may replay: ok, good to know, but you would
While the concept is theoretically valid the practical have the same issue with transistor based H-bridges,
application isn't so effective. with relay or bigger contactor is only a little more time
expensive. Yes, indeed, it's generally valid for every
The main issue is that the H-brige requires a precise H-bridge but the transistor module is faster, it use
control of its switches: you must first open a switch smaller current and it's mostly used paired with a
and only after a little delay close the other one. If you microcontroller (maybe with it's own library).
do the opposite bad things will happen because of an
inherent issue. For example: lets pretend that the top Moreover, because of shit happens, the situation
lef switch (S1 in the image) is closed. In this case you could be worse: if you overload a relay you risk to
can safely close only one of the switches on the right melt its contacts and you might not be able to open it
(S3 or S4), for instance we can assume to have the also using the proper command input, so aven a brief
S4 closed, so the motor is spinning in one direction. mistake can lead to a destructive runaway.
In order to change the spinning direction you have to
open S1 and S4 and then close S2 and S3. On the Beside the safety reasons 4 relays are not an optimal
paper is not a big deal, in reality a "little yet not solution because only two relays are actually
negligible" amount of time is phisically required to required, so happy days: a better solution actually do
open a relay. This means that you need to introduce exist and it's even cheaper!
at least some delay between the operations.

If you have both S1 and S2 or S3 and S4 closed at

DC Motor Controller With Two Relay: Page 2


Step 2: Second Solution (good)

If you discard the H-bridge, transistor based or four The wiring is quite easy, you only have to connect the
relay based, and if you take a two relay module (ama power supply plus and minus "at the same side" of
zon, bangood)and follow this wiring scheme you'll be the two relays. Fast and easy. With this solution you'll
able to properly control a DC motor in both directions have only four possible outcomes, which are all safe
without any risk of short circuit and without spending and that won't damage anything. By the way, the
unnecessary money. module is also optocoupled, therefore the control

circuit is two times protected from the power side of conduct current on both terminals!
the device.
There's another possibile advantage of this solution
As you can see in the second image it doesn't matter respect to the transistor H-bridge: if you set the two
if you don't provide a delay or if you give a wrong relays in the same state you'll short circuit the motor's
input, the motor won't behave in the right way (well, terminal. This short circuit allows the circulation of
you are providing a wrong input, what do you expect? currents that can brake the motor thanks to the Lenz's
miracles?) but the circuit and the power supply will Law. This law basically says that if you try to spin a
suffer no damages. Every possible configuration is DC motor you'll cause a variation in the magnetic field
ok, and that's not the case with four relays. Funny in which the motor's coils are in, therefore you are
story: in some forum some people were discussing creating a potential difference at the coil's ends.If this
about adding two more relay to the first four to - voltage can be "discharged" through a connector it
somehow. provide a mechanical interlock and keep will create a counter-rotating force that tends to
the four ones safe, I call this the Xzibit (Pimp My contrast the spinning momentum, so it tries to brake
Ride) solution. the motor. You can easily try this effect with any DC
motor. Try to spin a motor with its contact open and
Please note that the Xzibit solution is still less safe then shortcircuited, you'll notice the difference.
than the proposed one because the two additional
relays AREN'T a 100% safe interlock because they Please note that "spinning power" will be dump on
can't assure that two relays on the same bridge side the short circuit conductor, which is a common cable,
can't be close at the same time. As stated before a therefore the motor can dissipate only a certain
relay can be "glued" in a conducting state despite the amount of power. If you exceed the conductor's
control signal. disspating power you'll burn it.

A proper mechanical interlock is intrinsic in the


two realys, if properly used, in this case using a
single relay to act as a full side of the H-brige. A
relay can be "glued" in one state but it can't

DC Motor Controller With Two Relay: Page 3


Step 3: How to Use the Relay Module

This module is really easy to use. You have to terminal on the relay module. Since you have to pull
provide 5V to give it power and you have to pull to the voltage to ground you have to use
GND voltage the two input pins. You can do that digitalWrite(pin, LOW) to activate a relay. This ible
using a microcontroller, a PLC, or you can also do wasn't ment to be a relay-arduino tutorial but if you
that with electromechanical switches. For instance, want also this write a comment and i'll provide few
with an arduino you can use the digitalWrite function lines of code as an example.
on the digital pin which is connected the input

DC Motor Controller With Two Relay: Page 4


Step 4: Electromechanic Example

Think about a winch, a hoist, a garage door, a gate or voltage to power up your motor. You might find
generally about any mechanism, operated by a DC interesting this portable variable power supply that
motor which that has two movement direction and its i've described in this ible.
proper range of movement is well defined (not a fan,
which has no limit switches ne need to reverse the If you did the wiring properly this device will behave in
rotation). this way: with the 3 way switch in the central position
the motor should brake, no matter of the endstops
With a three-way switch (three-pole unipolar diverter) state. If you move the switch the motor should spin in
and two endstop switches we have all the control we one direction until the related endstop is pressed.
need. Once the endstop is pressed the motor goes again in
a braking configuration and it will remain steady as
Wire your module as per the attached image: the long as the endstop is pressed or the switch isn't
endstops must be wired on the NC (normally close) switched to the other side. If you move the switch to
and C (common) contacts, the switch must be the other side the motor will spin again in the other
connected to ground on the central pin and to one direction untill the other endstop is pressed or the
side of each endstops on the other pins. The switch moved in the central position.
remaining two endstops wires must be connected to
the two input pin on the module. Now you only have It's convenient, itn'st it?
to provide 5V to power up the module and the right

https://www.youtube.com/watch?v=0IOd8TCc14I

DC Motor Controller With Two Relay: Page 5


DC Motor Controller With Two Relay: Page 6
Step 5: Upgrade

Your task might be required to control the motor Don't worry, we can use the same technic used in the
speed but the previous example can set the motor trasistor based H-brige by adding another module
only in the forward/step/backward state. wired in series to the motor's power supply. Good
news: to do that we do need only one big transistor
The trasnsitor based H-bridge can control the motor an not four as it would be required for the same motor
speed using the PWM technic, which is nothing more with a transistor based H-bridge.
than a fast flickering of the transistors. This input is
perceived by the motor as an intermediate voltage Since we are talking about 10A rated relays we can't
and not as a stream of on/off voltage. Theoretically use the common, small, modules. These are a couple
the relays can do a PWM modulation, practically they of link for a proper size PWM modulator: amazon, ba
are too slow and they will have a very short life ngood.
because they will worn out (mechanical) while
transistors won't.

Step 6: Downgrade

If you landed in this tutorial looking for a "DC motor power (otherwise you won't move the motor untill
control" how-to but you don't actually need this much you'll manually unlock the endstop).
current, you can also choose other modules. Luckily
there are some integrated module with all the That's all, happy DC motor, folks!
discussed features (start/stop - cw/ccw, 0/100 speed).
If you need less than 3A of current for your motor you ps: if you find this -ible interesting or it helped you
can take one of these: amazon, bangood. The please consider a little paypal donation, it will be
downside is that ther's some hack to do if you want to appreciated.
integrate some endstops that don't simply cut the

DC Motor Controller With Two Relay: Page 7

You might also like