Question on reversing polarity for DC Motors - Page 1
Forum section: electronics / projects

author: gammzy98
author_rank: Newbie
timestamp: January 23, 2019, 06:14:13 pm
content: I was wondering if anyone can help me with this situation. I have a 12V DC Motor. It will be powered by a 12V power supply, no batteries involved. It will be hooked up to a switch. The function I want to achieve is as follows:When the switch is flipped one way, the motor spins clockwise for "X" amount of seconds, then stops. X being a defined number that can be programmed or controlled.When the switch is flipped the other way, the motor spins counterclockwise for "X" amount of seconds, then stops. X being a defined number that can be programmed or controlled.What would be the easiest way to accomplish this function? Preferably off the shelf components that you can buy, but I am open to ideas. Here is the link to the motor:https://www.ebay.com/itm/500-RPM-Hobby-Project-12-V-DC-Gearhead-Motor-High-Torque-6mm-D-Type-Shaft/283249435191?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649Any help with this in the right direction would be greatly appreciated. Thank you.

author: MasterT
author_rank: Frequent Contributor
timestamp: January 23, 2019, 06:41:36 pm
content: Arduino UNO + H-Bridge Motor driver shield. Look on-line tutorial, basic functionality you can get in a few hours.

author: gammzy98
author_rank: Newbie
timestamp: January 23, 2019, 11:11:06 pm
content: Quote from: MasterT on January 23, 2019, 06:41:36 pmHey! Thanks so much for the reply! I will definitely look into this. I am just curious why this method specifically? Is this the most efficient and basic way to achieve what I am looking to do? So Arduino is the way to go?

author: coromonadalix
author_rank: Super Contributor
timestamp: January 23, 2019, 11:14:39 pm
content: you have some cheap timed relays boards on ebay with trigger pins etc, many models and modes to choose, you define/programm your needed timings ??

author: MasterT
author_rank: Frequent Contributor
timestamp: January 24, 2019, 12:03:01 am
content: Quote from: gammzy98 on January 23, 2019, 11:11:06 pmI think so. The alternative is to do some circuitry using logic IC or 555, but it would not be less pricey or less time consuming.With arduino you can add extensive functionality latter on, like soft start-up, RPM control etc.

author: james_s
author_rank: Super Contributor
timestamp: January 24, 2019, 02:16:34 am
content: An Arduino Uno and H-bridge shield is about the least efficient way of doing what you want, but if money is not an issue then it is a quick and easy way to get a prototype going.You can do the same thing FAR cheaper with a bare AVR and an H-bridge IC, or you can build your H bridge the old fashioned way out of separate transistors. Or you could go an even simpler route and use a 3PDT switch, use two of the poles to control the direction wired directly to the motor and the third pole to trigger a one-shot timing circuit. This could be as simple as a R-C delay or a bit fancier using something like a 555.

author: beanflying
author_rank: Super Contributor
timestamp: January 24, 2019, 02:30:45 am
content: Plenty of options to do this sort of thing. If you want to keep the electronics simple then it can be done with an Arduino or another micro and a few libraries using a Brushed ESC like this oneeBay auction: #332135735707these also have the benefit of a brake function (motor hold) if that is of value to what you are trying to do with the gearmotor.If you want to skip the micro then 555 timer and some bits to generate a switched 1-2mS pulse can also be used to drive it.

author: amyk
author_rank: Super Contributor
timestamp: January 24, 2019, 03:01:09 am
content: I suspect you're trying to control something that needs to be moved between two positions? If so, a set of limit switches and relays would probably be a better choice, given that trying to do open-loop position-reckoning of a non-stepper motor by time alone is going to significant drift.

author: gammzy98
author_rank: Newbie
timestamp: January 28, 2019, 01:35:43 am
content: Hey everyone, just coming with an update on this. Appreciate everyone's help so far! I filmed a video to better explain what I am trying to accomplish. Here is the link:Here is also a diagram to better explain as well (click on to zoom in):https://ibb.co/Qb4bzkTReally hoping to finish this within the next two months as it is a birthday present. They would be amazed and absolutely love it! If anyone can help out it would be GREATLY appreciated.

author: beanflying
author_rank: Super Contributor
timestamp: January 28, 2019, 02:19:40 am
content: Personally I wouldn't try and reinvent the Linear ActuatorThere is a huge variation available and they can be very cheap depending on the requirements. Do a search on AilExpress or EBayThey are available with or without limit switches and a range of layouts to incorplorate into whatever base you need.

author: JagV12
author_rank: Contributor
timestamp: January 28, 2019, 08:35:55 am
content: Timing is definitely not the best way to go. Limit switch is way better in this situation. Micro-switch or Reed switch & magnet will do. I had a 12V wiper motor to extend-show and retract-hide a 1 meter wide Hand fan (through a chain reduction gear). It was wired like this :(See attachment. Hey, how can I insert the attached image here ?)SW2 and SW3 are NC (Normally Closed). If SW1 is in the down position, B is +12V and A is 0V. Motor will rotate "forward" until SW3 opens. If SW1 switches to up position, A is +12V and B is 0V. D2 is passing current until SW3 closes again and motor rotate "backward" until SW2 opens. If SW1 switches to the down position again, D1 will pass the current until SW2 closes and motor will rotate "forward". Of course 1N4148 are probably not suitable for the motor startup current, choose the diodes and switches accordingly. In case of Reed switch & magnets, relays will be necessary...Zip file is to be opened with Proteus ISIS for simulation (and fun !)EDIT :New versions without diodes

author: Zero999
author_rank: Super Contributor
timestamp: January 28, 2019, 11:03:09 am
content: Quote from: JagV12 on January 28, 2019, 08:35:55 amThat will work and is a common limit switch configuration. Yes, of course don't use the 1N4148 (I'd recommend Schottky diodes such as the 1N5822) and the switches should be rated to carry the full motor current. I agree, using relays is a good idea and is a must if the motor draws over a few Amps. If SW1 is replaced with two relays, the control and limit switches and associated wiring only needs to carry a small current.Adding in-line images is a bit of a pain. Attach them and post as usual. Go to your post, open the image you've just attached. Copy the address to the clipboard (the exact procedure depends on your browser). Edit your post and paste it between the  tags.Here's an example, using your schematic.Note, please use png format for schematics, because it saves space, results in a clearer image and makes it easier for others to edit, if necessary. You can save even more bandwidth by converting the image to indexed (256 or fewer colours) which will not affect the image quality of schematics, since they hardly use that many colours anyway.

author: Raj
author_rank: Frequent Contributor
timestamp: January 28, 2019, 02:04:12 pm
content: contactors maybe? for heavy motor ,it's easiest

author: Zero999
author_rank: Super Contributor
timestamp: January 28, 2019, 03:46:51 pm
content: Quote from: Raj on January 28, 2019, 02:04:12 pmYes, contactors are a good idea if failure to stop could cause a lot of damage and mandatory if it could result in injury.