Digital SPDT switch

arduinomicrocontrollernetduinoswitchestransistors

I know this is probably a stupid question but I am hobbyist and could not find a solution to this problem.

I have a micro-controller that sends a PWM signal to a transistor that lets current flow through a coil in one direction but I want to be able to change the direction the current flows in every time I send a digital output from another pin on the micro-controller. For that I will have to use another transistor that can let current flow in the other direction.

My problem is that I need a way to switch to which transistor the PWM signal is send to by sending a pulse from a another pin. I am guessing that I will need some sort of digital SPDT switch. Is there anything like this any reference to a component or circuit will help.

Best Answer

A two input H-Bridge made out of 2 NPN inputs, with the motor drive made out of 2 NPN & 2 PNP transistors and 4 diodes.

enter image description here

The specific transistors you use would be rated for your coil, doesn't have to be those specific ones.