Will this blow up my microcontroller? DC motor controller

Discussion in 'General Electronics Chat' started by StrongPenguin, Jan 10, 2019 at 3:58 PM.

  1. StrongPenguin

    Thread Starter Member

    Jun 9, 2018
    137
    5
    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
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    16,591
    4,906
    Thought of using Mosfets?
    Max.
     
    Reloadron likes this.
  3. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,890
    1,774
    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: Jan 10, 2019 at 7:30 PM
  4. StrongPenguin

    Thread Starter Member

    Jun 9, 2018
    137
    5
    @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.
     
  5. ericgibbs

    Moderator

    Jan 29, 2010
    6,524
    1,265
    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
     
    Reloadron likes this.
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    9,000
    2,123
    The maximum allowable collector current of a BC547 is only 100mA. Your motor start-up current is likely to be much more than that :(.
     
    Reloadron likes this.
  7. MaxHeadRoom

    Expert

    Jul 18, 2013
    16,591
    4,906
    Although if controlled from a micro as shown, the initial current can be controlled by gradual acceleration.
    Max.
     
    Reloadron likes this.
  8. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,890
    1,774
    I believe Eric has that question covered:

    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
     
  9. MaxHeadRoom

    Expert

    Jul 18, 2013
    16,591
    4,906
    I am lost at sea quite frequently!!:p:D
    Max.
     
    Reloadron likes this.
  10. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,890
    1,774
    Me too but I find with age things no longer bother me. :)

    Ron
     
  11. StrongPenguin

    Thread Starter Member

    Jun 9, 2018
    137
    5
    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.
     
  12. StrongPenguin

    Thread Starter Member

    Jun 9, 2018
    137
    5
    @ericgibbs The datasheet states the transistor could withstand 50 V, so I didn't think it would mind 12 V.

    @Reloadron Thanks for the tip on complementary mosfets, I will get a hold on a pair when we reach shore :)
     
  13. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,890
    1,774
    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
     
  14. ericgibbs

    Moderator

    Jan 29, 2010
    6,524
    1,265
    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
     
  15. StrongPenguin

    Thread Starter Member

    Jun 9, 2018
    137
    5
    @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: Jan 13, 2019 at 12:18 PM
  16. ericgibbs

    Moderator

    Jan 29, 2010
    6,524
    1,265
    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.
     
    Last edited: Jan 13, 2019 at 2:23 PM
    Reloadron and StrongPenguin like this.
  17. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,890
    1,774
    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
     
  18. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    9,000
    2,123
    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.
     
  19. BobTPH

    Senior Member

    Jun 5, 2013
    1,285
    267
    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
     
  20. StrongPenguin

    Thread Starter Member

    Jun 9, 2018
    137
    5
    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.
     
Loading...