I have no background in electrical engineering at all, and only bought my first breadboard this week. I'm still completely new to this and just trying it out.

I'm trying do drive an 12V actuator, where flipping a switch reverses the polarity. Eventually I'll be replacing the switch with a raspberry pi, so the signal (is that what it's called?) is limited to 5V.

I've managed to create a circuit on my breadboard that does this using 2 SPDT relays (I don't have DPDTs), but this obviously isn't ideal.

My primary question is

  • how do I select the transistor to replace these relays?


  • Should I use FET or BJT?
  • What sub-variety of transistor should they be (npn/pnp?, JFET/MOSFET?, enhancement/depletion?)
  • Can This circuit be constructed more simply? i.e. with fewer components?

More generally,

  • Does it matter that the signal and power channels are different voltages?
  • What type of transistors should a new hobbyist stock up on?
  • How does one generally go about selecting a transistor for a given application. e.g. What is does the flowchart of transistor selection look like?

Diagram of functional circuit with relays. A simulation of the circuit is available here. Diagram of functional circuit with relays.

  • 1
    \$\begingroup\$ There are books full of these circuit details called Half and Full Bridges which depends on Power Loss from reactive loads and I^2 RdsOn (or Rce), switch risetime, commutating deadtime to prevent shootthru , learn the terms then search for details to write a better question if you are lost electronics.stackexchange.com/questions/308952/… \$\endgroup\$ May 6, 2021 at 12:09
  • \$\begingroup\$ Usually a full "H-bridge" consists of four BJTs or MOSFETs is used to reverse the polarity of a voltage source, so to change the direction of an actuator, eg, a DC motor. The most common cheap, hobbyist controller is L298N, which consists of two full H-bridges, in other words, control two actuators such as DC motors. You might like to read the following Q&A for more details. How to control DC motor speed by motor driver with PWM input? electronics.stackexchange.com/questions/510755/…. Cheers. \$\endgroup\$
    – tlfong01
    May 6, 2021 at 13:07
  • 1
    \$\begingroup\$ @tlfong01 Thanks, that's exactly what I need to know. Do you happen to know if the L298N can be configured to pulse? My actuator is a car door lock actuator, and I don't think they're supposed to be continuously powered... \$\endgroup\$
    – Anthony A
    May 6, 2021 at 13:27
  • \$\begingroup\$ @Antony A, (1) Are you sure that your door lock needs a bidirectional voltage source? Usually door locks are unidirectional, eg power on = lock, power off = unlock (as you say, no need to continuously powered. (2) Anyway, L298N can do, if your requirement is indeed bi-directional. (3) No sure not do you mean by "pulse", usually L298N can be used to control motor speed by applying PWM (Pulse Width Modulation) signal to ENABLE pin of L298N to control speed. / to continue, ... \$\endgroup\$
    – tlfong01
    May 6, 2021 at 13:44
  • 1
    \$\begingroup\$ @tlfong01 When voltage is applied in one direction the actuator arm is extended with force and resists being retracted as long as it is applied. The opposite happens when the polarity is reversed. The actuator arm engages or disengages the lock via a linkage rod. The reason that I want a pulse of power is that the force to engage or disengages the lock only needs to be applied to flip a crank arm on the latch. I don't think the actuator is designed to be continuously powered regardless of the polarity. I'll take a look at those links later today when I have a little more time. \$\endgroup\$
    – Anthony A
    May 6, 2021 at 14:03

1 Answer 1


The first thing we need to know is how many Amps the motor requires. We already know the motor is 12VDC.

The worst case with a DC motor is when it is stalled - the 'stall current'. Either the motor manufacturer with specify this (hopefully) or you can measure it. Use an Ammeter with the motor stalled and read the value.

Based on these values, we want what is called a 'H' bridge as Tony mentions. For smaller currents, there are integrated circuits that do this. Once you start getting up over around 10Amps, then we need a discrete approach. How do you chose what transistor device? There is no one choice and there are many variables to balance. Designing a 'h' bridge as a first project is not advised.

If all you really want to do is reverse the motor, then use relays. There's plenty of relay boards suitable for the raspberry pi (note the raspi logic levels are 3.3V NOT 5V) that have a suitable transistor and circuit. Relays are pretty hard to kill vs h bridges that one slip might turn them to smoke.

As well, you will want to put a varistor across the motor to suppress inductive spikes that will upset your raspi. Something like a 7mm or greater with a voltage of 14V or thereabouts. I can say conclusively from experience that this is required - a colleague ignored my suggestion and found out the hard way.

If you have batteries or power supplies that can supply many Amps of current, ensure the size of wire is adequate for the current (there are online tables of Ampacity) and that there is a fuse to protect the wire. Otherwise a fault might cause the wire to melt and cause a fire. For 12V there are auto fuses and holders that are easy to source and cheap.

  • \$\begingroup\$ Thanks for the comprehensive answer. The manufacturer unfortunately doesn't provide the amps and I don't currently possess an ammeter. It's a car door lock actuator, if that gives you any indication as to the amps it pulls. I've been able to get it to actuate with sufficient force with a 5V-12V step-up usb cable from amazon, but I'd guess that's under the ideal amperage. Since this is beginning to look more involved than I bargained for, would you suggest a controller module like this one? Also, do you know if these modules can be configured to pulse? \$\endgroup\$
    – Anthony A
    May 6, 2021 at 13:03
  • \$\begingroup\$ The L298 might work. As for 'pulse' operation - that's up to whatever is controlling it. \$\endgroup\$
    – Kartman
    May 6, 2021 at 13:11
  • \$\begingroup\$ Just to clarify, an H-bridge circuit should always have current running one way or another through it; is that correct? So an H-bridge by itself couldn't be used to pulse? But since modules such as those linked don't seem to be just H-bridges, but seem to contain some additional logic, I was wondering if a pulse mode would be part of it. I was just wondering if you knew off-hand if that was the case? \$\endgroup\$
    – Anthony A
    May 6, 2021 at 13:16
  • \$\begingroup\$ As far as I can see, the module you linked has no additional logic. Your controller tells it to go fwd, rev, open circuit or short. \$\endgroup\$
    – Kartman
    May 6, 2021 at 13:29
  • \$\begingroup\$ Ok, Thanks. I hope to learn more about ee overtime, but for now I'll just buy the module. I think I'm less likely to destroy my stuff that way. \$\endgroup\$
    – Anthony A
    May 6, 2021 at 13:37

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