Will this blow up my microcontroller? DC motor controller

Thread Starter

StrongPenguin

Joined Jun 9, 2018
307
I'm trying to make my own DC motor controller for this 12V motor i snatched from a DVD player. Nothing fancy. It consists of four BC547 transistors, unknown (at this time) diodes, and 1k resistors. 1k seems a bit too small, but my next jump is 10k.

The uC is a MSP430G2553. Don't mind the uC on the schematic, it's just for show.
Mín egna.png
 

Reloadron

Joined Jan 15, 2015
7,501
If you are after a H Bridge design you want two NPN and two PNP transistors. What you have won't work. Next, as Max mentions, consider using MOSFETs. Finally you can buy a simple H Bridge module relatively inexpensive designed to work with a uC.Anyway, as to your drawing you want 2X NPN and 2X PNP.

You may want to give this a read. While he mentions 2.2 to 9.6 volts the circuit will do fine on 12 volts. Also, the base resistors are chosen based on the max current the transistors will need to handle. Also, a Google of Transistor H Bridge will get you a few dozen hits. The link will also explain the diodes and why a specific type diode is preferred.

Ron
 
Last edited:

Thread Starter

StrongPenguin

Joined Jun 9, 2018
307
@MaxHeadRoom Yes, I have, but I don't own any mosfets, and I can't order any since I'm at sea for the next few weeks.

@Reloadron I don't quite understand why it wont work with this setup. I thought the only difference between a NPN and PNP, was that a PNP should have the base grounded in order to activate. Something I am missing? I can see all the bridges use both, guess I need to read up on PNP's.
 

Reloadron

Joined Jan 15, 2015
7,501
@MaxHeadRoom Yes, I have, but I don't own any mosfets, and I can't order any since I'm at sea for the next few weeks.

@Reloadron I don't quite understand why it wont work with this setup. I thought the only difference between a NPN and PNP, was that a PNP should have the base grounded in order to activate. Something I am missing? I can see all the bridges use both, guess I need to read up on PNP's.
I believe Eric has that question covered:

hi SP,
As the two upper NPN are High side switching, consider what the Emitter voltage will rise too, as you apply 5v to their Base pins.??
E
This is why using 4 NPN or for that matter 4 PNP is not a good design practice. When choosing your transistors you want to choose transistors capable of handling the voltage and current for your motor load and you also want to choose transistors which are complementary or close to complementary. Just for an example a 2N3904 would be complimentary to a 2N3906 or for slightly higher current a 2N2222 would compliment a 2N2907. Your base resistors will limit the base current to a safe level on your uC driving the transistor and with your load what base current is required for saturation at your load current.

While I was able to find several H Bridge designs online using for example 4 2N2222 transistors what I am saying is that it is not a good design practice. While I can appreciate being at sea having been there and done that you can try working with what you have but you likely will get marginal results.

You also need to consider what Alec and Max have mentioned above.

Ron
 

Thread Starter

StrongPenguin

Joined Jun 9, 2018
307
The motor is a MDB2B, 12V @ 268 mA, so my 547's will probably struggle. I haven't tried it yet.

I also read this article, which I found interesting. I need some "all around" mosfets for my mixed parts kit. I don't wanna mess around with this, if it's most likely too fail. I have done enough of that already, with the stuff I have here at sea.
 

Reloadron

Joined Jan 15, 2015
7,501
The motor is a MDB2B, 12V @ 268 mA, so my 547's will probably struggle. I haven't tried it yet.

I also read this article, which I found interesting. I need some "all around" mosfets for my mixed parts kit. I don't wanna mess around with this, if it's most likely too fail. I have done enough of that already, with the stuff I have here at sea.
Considering that I would look for some general purpose MOSFETs with a focus on logic level mosfets. Just as a few examples the IRL 540 or the IRLZ44. In the case of running reversible small motors (low current) there are off the shelf "H-Bridge) modular circuits designed to work off of uC logic level inputs.

Ron

Ron
 

ericgibbs

Joined Jan 29, 2010
18,766
The datasheet states the transistor could withstand 50 V, so I didn't think it would mind 12 V
hi SP,
I was not referring the transistor maximum voltage.
You cannot turn fully ON a High side driver, which has it Emitter connected to a 12V load, by applying 5v to the transistors Base.
The Emitter voltage will only rise to 4.3V, not 12V.
E
 

Thread Starter

StrongPenguin

Joined Jun 9, 2018
307
@ericgibbs Is this because of the physics of the transistor? Would a BC557 have the same issue?

@Reloadron The whole idea with this circuit is only to try to learn something, I don't really need it. I'm looking at the mosfets you mentioned now. For an inexperienced bloke like me, It's a jungle to navigate in. The IRL 540 could be used for a high side switch, and be turned on by a uC? I couldn't just use, say a
FQP30N06L?
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,766
hi SP,
This sim shows the effect of having the load in the Emitter.
Note Ve can never get higher than 4.3V, because the transistor requires that Vbe has to be ~0.6v to turn it ON.
E

Update: @StrongPenguin
Added the circuit showing the additional transistor in order to drive a PNP.
 

Attachments

Last edited:

Reloadron

Joined Jan 15, 2015
7,501
@ericgibbs Is this because of the physics of the transistor? Would a BC557 have the same issue?

@Reloadron The whole idea with this circuit is only to try to learn something, I don't really need it. I'm looking at the mosfets you mentioned now. For an inexperienced bloke like me, It's a jungle to navigate in. The IRL 540 could be used for a high side switch, and be turned on by a uC? I couldn't just use, say a
FQP30N06L?
Actually the FQP30N06 is one of my pet mosfets while if we look at the data sheet it is not actually a Logic Level MOSFET I have used it extensively with 5 volt logic circuits just fine at currents of 300 mA. It is an N Channel MOSFET better suited for low side switching. What I find to be a good compliment is the FQP27P06 which is a P Channel MOSFET. The kicker with the FQP30N06 is some data sheets reflect a L suffix and the data sheets call it a logic level MOSFET while other data sheets do not reflect the L suffix and do not reference it as a logic level MOSFET. Anyway I have found both to work well with assorted u controllers in N and P channel applications.The IRL 540 is another very good general purpose N Channel Mosfet which works well with micro controller logic.

Ron
 

Alec_t

Joined Sep 17, 2013
14,280
The IRL 540 could be used for a high side switch, and be turned on by a uC?
In the absence of a boost circuit, only if you're prepared to lose a few volts across the FET and hence have, say, 8V-9V across the motor when the drain voltage is 12V. This is because the gate needs to be a few volts higher than the source to turn the FET on.
 

BobTPH

Joined Jun 5, 2013
8,804
As you have already heard, you need a PNP or P channel MOSFET for the high side switch. The voltage to turn off that swich will be close to 12V, so you need another transistor as a level shifter.

Bob
 

Thread Starter

StrongPenguin

Joined Jun 9, 2018
307
Thanks for all the helpful inputs, all.

I'm having some fun here with transistors, and I found out a BC557 (BC547 gets burning hot!) high side can drive the motor. But the funny thing is, as soon as I connect my battery, the motor starts turning at 3.7V, even if base is connected high through a 1k resistor (also tried 5k and 100k, no difference).

Measurements at low base:
Uce = 2,7 V ; Ube = 2,1 V ; Ucb = 0,77 V

High base:
Uce = 8,7 V ; Ube = 8,01 V ; Ucb = 0,67 V

Both with 1k base resistor

Should the resistor be even lower? I tried with just my jumper, which shorted my transistor.
 
Top