0
\$\begingroup\$

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.

\$\endgroup\$
  • 4
    \$\begingroup\$ The usual way of driving a coil (normally motors) in two directions is called an "H-bridge". Otherwise, you could do it with a few NAND gates.. \$\endgroup\$ – pjc50 Jul 17 '13 at 14:52
3
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

You haven't really given a necessary current but you could also search for "analog multiplexers" that are basically just SPXTs

http://www.vishay.com/docs/72308/dg2714.pdf

That's an example.

\$\endgroup\$
0
\$\begingroup\$

If you would still like to use your original approach, it sounds like a SPDT relay would work. Here is a datasheet for one I use often.

There is a control pin which allows you to digitally select between one or the other, but since you are using a microcontroller you will have to drive it with a relay driver circuit like this:
(source: comcast.net)

\$\endgroup\$

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.