car lock discussion

How do I select the transistors for this circuit?

Ask QuestionAsked todayActive todayViewed 49 times1

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. transistorsswitchescircuit-designdesigncontrolShareCiteEditFollowFlagasked 2 hours agoAnthony A311 bronze badge New contributor

  • 1There 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/… – Tony Stewart EE75 1 hour ago
  • 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. – tlfong01 48 mins ago    
  • 1@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… – Anthony A 29 mins ago 
  • @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, … – tlfong01 12 mins ago   
  • / cont’s, …or door lock, I don’t know why to need to use pulse. Of course you can use a pulse signal, instead of a on/off/switch, to switch on power, and a sequential pulse signal to switch off power. (4) It is by chance that I am doing answering an question you might be interested: “Use an RFID tag to unlock/lock a home door. The OP is using a relay to do the job, but I am proposing to use a MOSFET (door lock is an one direction actuator, therefore no need to use a bridge) / to continue, … – tlfong01 7 mins ago   
  • / cont’d. The Q&A is actually a troubleshooting/exploratory style project, and still in progress. I know you are not using RFID, but you might still find some inspiring ideas there. This is the project link and chat room: (1) Raspberry Pi , RFID , Relay Module and Magnetic Door Asked 12 days ago Active yesterday Viewed 115 times raspberrypi.stackexchange.com/questions/124290/…, (2) Chat Room: chat.stackexchange.com/transcript/123411/2021/4/25. Happy reading. Cheers.. – tlfong01 1 min ago   Edit   

Add a comment

1 Answer


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.ShareCiteEditFollowFlaganswered 1 hour agoKartman1,70811 gold badge22 silver badges88 bronze badges

  • 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? – Anthony A 52 mins ago 
  • The L298 might work. As for ‘pulse’ operation – that’s up to whatever is controlling it. – Kartman 45 mins ago
  • 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? – Anthony A 40 mins ago 
  • 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. – Kartman 27 mins ago
  • 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. – Anthony A 19 mins ago

Add a comment

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.