2

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.

JRE
  • 67,678
  • 8
  • 104
  • 179
lkv0315
  • 23
  • 4
  • @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! – lkv0315 Sep 13 '21 at 16:03

1 Answers1

2

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

  • 1
    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? – lkv0315 Sep 13 '21 at 17:27
  • 1
    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... –  Sep 13 '21 at 18:24