# DC motor polarity reversal?

Discussion in 'Sensors and Actuators' started by supak111, May 12, 2013.

1. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
Is there any easy way say by a few transistors to revers the electrical polarity to a DC motor?

What I'm trying to accomplish: I am currently driving a DC motor with a 1 second a pulse of electricity from a switch. What I want to do tho is make the DC motor spin clockwise on the first 1 second pulse, then counter clockwise on the second pulse, and repeat the process...

Motor only needs to be active for the 1 second each time, as soon as the 1 second pulse is over the motor turns off too. So I just need a simple polarity flipper

Looked into latching relays, can't seem to figure out which one if any could do this?

I though maybe a flip-flop circuit could do it too but again I can't figure it out.

2. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
Alternating DC, by trigger pulse?

Is there any easy way say by a few transistors to revers the electrical polarity to a DC motor?

What I'm trying to accomplish: Say if I want to LOCK / UNLOCK car doors from a single switch momentary switch. Every time I send a pulse, door locks, then on next pulse it unlock.... The DC motor get a different polarity every other time

Looked into ratchet relays but they are too expensive.

Thought maybe a cheap alternating flasher could work but they are SPDT, I need DPDT?

I though maybe a flip-flop circuit could do it? I'm not smart enough to figure this one out please help

25,496
2,837
Jan 21, 2010

4. ### gorgon

603
24
Jun 6, 2011
You can also use a relay or two for this.

The important question is, how do you generate the memory of the last state, 'forward' or 'reverse'?

How do you generate the 1s pulse in the first place?

5. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
Pulse is just power from the 12v car battery though a momentary switch.

6. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
I'm thinking an H-bridge with a alternating ratchet relay should do the job? Or can a H-bridge be use alone?

Last edited: May 13, 2013
7. ### Laplace

1,252
184
Apr 4, 2010
Sounds like you would need to start with an H-Bridge motor driver. Google has much info available for H-Bridge.

8. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
yes I def will use an h-bridge but I still need to figure out whats gonna alternate the 1 input into 2 inputs

9. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
A latching relay is a pretty simple way to do what you want. A lot less wiring than an H-bridge.

I designed a circuit that uses a latching relay to control an antenna extender/retractor for another user. The diagram is at https://www.electronicspoint.com/need-help-needed-circuit-t254020.html#post1508062

Have a look at the whole thread and you will understand what that circuit does. The only change you will need to make is to interrupt one of the wires to the motor so that it only runs while the pushbutton is held down.

So you need a set of contacts that is closed only while the pushbutton is held down. You can either use a relay that is activated from the pushbutton, or you can use a pushbutton that has two independent contacts (this is described as a DPST momentary pushbutton, or you could also use a DPDT momentary pushbutton and ignore the two extra contacts).

If you can't figure out how to modify the circuit, let me know whether you want to use a DPST pushbutton, or a standard (SPST) pushbutton with an extra relay, and I'll draw up the circuit.

10. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
Yea I wouldnt really know how to mod the diagram to do what I need. 'm powering my device by an 2n222 transistor so basically transistor acts like a momentart push button switch.

11. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
Earlier in this thread you implied you were driving the circuit from a pushbutton. Now you say it's a 2N222 (I assume you mean 2N2222) transistor. What other information have you not given us?

Provide a thorough description of what you want to achieve, and a circuit diagram of what you have so far. I want to know all the details. I've been caught too many times in the past designing things that need to be redesigned because they don't fit the user's requirements because the user didn't explain their requirements properly!

12. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
Ok sorry, I wasn't specific before because I was hoping someone could point me at something of the shelf I could buy. Hard to believe there isn't a simple of the shelf circuit already.

Here is EXACTLY what I'm hoping to do. I am going to have a flash of light activated the DC motor in each direction. A light activated switch circuit, this one:

Will need to drive the circuit you designed. So we have: light activated circuit ---> your circuit ----> DC motor

PS if I wasn't clear enough my flash of light will be 3 seconds long so the motor should have a 3 second pulse as well. Reverse direction each time a new flash comes.

Last edited: May 14, 2013
13. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
That circuit may not give a very clean switching action. A Schmitt trigger would be better. Something like the circuit at https://www.electronicspoint.com/question-mosfet-t258206.html#post1536817 but driving a relay. But in the meantime let's stick with the circuit you've got.

What's the operating voltage?
What is the supply voltage coming from?
How much current does the motor draw?
Will the light flash be the right duration to turn the motor for the right length of time?

14. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
For my purpose the switching doesn't have to be ready clean. Power is DC 12v battery plenty of amps. The geared DC motor won't draw more then 1/2 amp. I can control how long the light stays ON pretty easy and precisely too

15. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
The switching does need to be clean and sharp in order to reliably switch the latching relay from one state to the other.

I've drawn up a Schmitt-trigger-based circuit to drive the first relay, K1. In the meantime you can use your existing circuit to drive it; just replace the collector load components in your existing circuit (the resistor and LED) with K1's coil and D1. But I recommend you switch to the Schmitt trigger circuit for reliability and repeatability.

K1 is a standard DPDT relay. While light is detected, the driving transistor energises it by applying 12V to its coil.

The bottom contact of K1 is used to flip the state of the latching relay through the timing circuits consisting of R1, C1, R2 and C2. The operation of this part of the circuit is probably described in the thread I linked to.

The top contact of K1 is connected in series with the feed to the motor. That's needed because the latching relay is always in one state or the other, and you only want the motor to run while light is present.

The relay part numbers I've suggested are available from Digikey (http://www.digikey.com). You should be able to find a local alternative for K1 (use one with a coil current around 12 mA or adjust RE accordingly) but latching relays are not widely available. Download the data sheets from Digikey so you know what to look for.

#### Attached Files:

• ###### SUPAK111.001.GIF
File size:
9.7 KB
Views:
228
Last edited: May 14, 2013
16. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
Thanks for all your help, I really do appreciate it. I will definitely built this if I don't find something thats already manufactured for cheap that I hopefully find by searching the net.

You really seem to know your electronics. I have a question for you, do you know of any small/cheap device that can have: 3 terminals, 1 input and 2 outputs so that every time the input pulses the output switches from between the 2 outputs?

I found a simple and cheap "alternating flasher" used for LEDs or turn signals and so on but it does it by time, and not by everytime the input is turn ON/OFF unfortunately. I did find a device that was used for something in cars about 6 months ago but I can't remember what it was called nor used for so now I can't find it.

17. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
I don't know of any single component that does that; if I did, I would have suggested it. You can create that behaviour using a latching relay with some external components as I showed. There's also a logic function that implements it, called a T-flip-flop (T stands for "toggle") which can be made from a D flip-flop such as a CD4013 or 74HC74, or a JK flip-flop such as a CD4027, but these devices need a power supply, components on the input to condition the signal, and components on the outputs, such as the H-bridge suggested by others in this thread, to allow it to switch heavy currents. The latching relay design I have given you is probably the simplest way to do what you want to do.

18. ### supak111★ƃuᴉɯǝɥɔs sʎɐʍlɐ★

334
4
Apr 29, 2012
Oh OK, if its the simplest way to go that's what I'll be doing.

Again thanks for all your help, I'm sure this will come in handy for many others in the future as I couldn't find help on this anywhere else online