Maker Pro
Maker Pro

Switching polarity to load with two transistor circuits

Hello, my electronics experience is quite limited.

I am using a raspberry pi to control a servo - But I am switching it on/of via a transistor, not using pwm. Reason being, pwm is limited to the servo's 90 degrees rotation. I power the servo motor directly to get 360 degrees rotation.

Problem: To turn the servo the other direction, I need to reverse the polarity.

Currently I have the following circuit (the lamp is my servo):
mNwrG4E.jpg


This works fine, but I can only rotate the servo one way when switching gpio to high.

I am thinking of a way to do the following somehow:
- duplicate the transistor circuit using another gpio
- use the same voltage source for the second transistor circuit in reverse - somehow blocking flow with diodes maybe to prevent the short circuit? Only one of the gpio/transistor bases will be on at any point in time.

I would appreciate any advice.

Thanks
 
Top