2
\$\begingroup\$

I have a valved exhaust system in which the valve is rotated by a 12V motor, but the electronics that came with it have died. I would like to integrate it into my Raspberry Pi dash system, using the 3.3V GPIO.

I understand that I need either a BJT or MOSFET (likely two) and I have simulated the circuitry, but I can only make a motor rotate in one direction. I need control to make the motor rotate in both directions, so I can open and close it.

How would I go about designing and implementing this? I'd be able to figure out the code to set the GPIO pins, just not the circuit design.

I used this question to figure out how to make the switching logic, but I can't manage to make it polarity reversible using logic only.

I know this would be a lot easier with a servo, but I cannot find any of these motor bodies that mount servos and not regular DC motors.

\$\endgroup\$
1
  • \$\begingroup\$ @Hedgehog I did approx. 3 hours of Google searching before posting here, but I will look up what an H Bridge is, thanks for the tip! \$\endgroup\$
    – lkv0315
    Sep 13 at 16:03
2
\$\begingroup\$

This is one of possible approachs how to drive a motor with reverse capability with 3v3 controll signals.

V1 and V2 are your GPIOs. Be sure they never be high together so do a software safety. Drive it with 1ms dead time at least. (Example after V1 become low wait 1ms to set V2 high)

When V1 high and V2 low ---> CW direction When V2 high and V1 low ---> CCW direction

For M1..M4 choose power types of mosfets with 30V Vds at least, current rating according motor draw. M1 and M2 are PMOS. M3 and M4 are NMOS.

enter image description here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I will give this a try shortly! I feel like maybe this had something to do with the way I worded it, but for the application I'm referencing, would it even be necessary to have both pins? \$\endgroup\$
    – lkv0315
    Sep 13 at 17:27
  • 1
    \$\begingroup\$ If you think about one pin control this wouldn't alow you to stop the motor. It's possible to rebuild it so, but the cirtuit would be more complex to ensure dead times and so... \$\endgroup\$ Sep 13 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.