+5 votes
by (420 points)
I have a small 12v gear motor and am driving with an ESP32. I am reading the encoder and starting/stopping the motor just fine. I now realize I need to reverse the motor for this application which requires a polarity switch on the power wires. Is anyone aware of a module that might perform this function? Ideally, it would take a 5v signal HIGH for "normal" polarity and LOW for "reverse". Thanks for any ideas you might have.  
I have a small 12v gear motor and am driving with an ESP32.

3 Answers

0 votes
by (1.5k points)
H-Bridge motor driver is the term you are looking for.  
0 votes
by (6.3k points)
H-Bridge, modules w/L293 500mA or L298 2A. You can get in a module for a few bucks to about $5. They have two inputs that select the polarity of each side of the motor and an Enable pin. Or DPDT relay to select direction and whatever you are currently using to on/off the motor. But you have to drive the relay.  
by (420 points)
@dispassionate thank you so much. Got them today and they are exactly what I need! Already have them working in the solution, so that is awesome. Thanks again.  
by (6.3k points)
@nothingness16551 no problem. I always have a few in the parts drawer.  
0 votes
by (3.8k points)
What's the use-case?  
by (420 points)
A 12v portable system to flip up a heavy plate on demand. I already have the IoT stuff for other similar applications and now need to drive a motor to flip up a plate. Once up, the motor needs to reverse to resting position. I have a fairly inexpensive 12v geared motor with encoder. If I reverse polarity I can step back to original position.  
by (3.8k points)
@nothingness16551 got it - was going to suggest a stepper motor (high torque, precision control, bi-directional with the right driver)
by (420 points)
@hyperostosis8688 actually doing a stepper too, but they are just a bit more expensive, but a reasonable backup. Thanks for the thoughts!  
by (420 points)
Oh, and I need a geared stepper, which I have, but as I said, expensive.  
by (3.8k points)
Are you building a battle-bot?  
by (420 points)
@hyperostosis8688 no, but that is always something I think about. I worry that my idea for weapons might be frowned upon.  
by (3.8k points)
I can relate!  
The Smart Home Group is where you can always find questions, answers, advice, reviews & recommendations from other community members about smart home automation with zwave, bluetooth, and zigbee IOT devices.
...