1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Basic problem with transistors

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by giftiger_wunsch, Jul 25, 2009.

  1. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,442
    Likes:
    933
    Location:
    Canada, of course!
    The 12 ohms resistor robs the 200mA motor of most of its voltage. 2.4V is gone and is making heat. The motor will not start running. What is the function of the resistor?

    The PNP upper transistors are fine when the motor's power supply voltage is the same as the supply for the micro-controller.
    But the 330 ohm base resistors provide a base current of only 6mA. 20mA is needed.
     
  2. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Would a SN754110 or TC4427 work? They make great half bridge drivers for small motors and are not expensive.
     
  3. giftiger_wunsch

    giftiger_wunsch New Member

    Joined:
    Jun 15, 2009
    Messages:
    813
    Likes:
    3
    Location:
    Kent, England
    Okay I don't understand most of this now and I don't see any obvious solution so I think I'll give up. It was worth a try. Thanks for all the help.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada

    Huh? What was wrong with using the SN754110? One IC can drive two small motors.
     
  6. giftiger_wunsch

    giftiger_wunsch New Member

    Joined:
    Jun 15, 2009
    Messages:
    813
    Likes:
    3
    Location:
    Kent, England
    I don't know what they are, I probably wouldn't understand the datasheet, and don't know enough about electronics to be able to build my circuits. I started this project expecting that the wiring would be prety simple, and I've found I barely understand the principles behind it. Maybe I'm better off sticking with software development.

    Thanks anyway.
     
  7. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
  8. giftiger_wunsch

    giftiger_wunsch New Member

    Joined:
    Jun 15, 2009
    Messages:
    813
    Likes:
    3
    Location:
    Kent, England
    The page you linked to says that the chip is only suitable if the motor draws less than 100mA under load; the schematic also shows a 9.6V to 18V supply, but my supply is only 3V.
     
  9. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    My Mongoose kit uses 3V motors and a SN754110. The manual includes the schematic.
     
  10. giftiger_wunsch

    giftiger_wunsch New Member

    Joined:
    Jun 15, 2009
    Messages:
    813
    Likes:
    3
    Location:
    Kent, England
    That's a pretty neat kit, I'll take a look at the manual and the datasheet for SN754110 and try again to wrap my head around some of these problems...

    Speaking of problems, I understand that the voltage drop of the transistors 12Ω resistor I needlessly inserted (I figured 12Ω with 3V = max 250mA current so no chance of drawing too much current or something but clearly my logic was flawed there) would make the circuits inefficient and prone to overheating, but I still don't understand why audioguru said the diodes in my schematic will do nothing.

    My theory was that if PA1 was high and PA2 low, current would flow through the upper left transistor, through the motor and the lower right BJT, through the green-coloured wires on my schematic, and then to PA2 to complete the circuit. I inserted the diodes because without them, the low-resistance connection between PA1 and PA2 would simply cause a short-circuit between the two uC ports which would cause the vast majority of the current to flow through this direct low-resistance route to the other terminal.

    I am probably missing something which is obvious to most people viewing the schematic :eek: but could someone briefly explain why my schematic does not fulfil the function I described above? Obviously excluding the other issues with the schematic. :eek:

    I apologise for the slightly resigned attitude just now, this is just a lot more complicated that I initially expected. I appreciate it's difficult to help someone who is on the verge of giving up anyway. I'm going to read over some of the issues highlighted more carefully, read some of the datasheets, and do a bit of research on any of the basic stuff I don't understand as of yet. Thanks for all the support. :D
     
    Last edited: Jul 31, 2009
  11. marcbarker

    marcbarker New Member

    Joined:
    Jul 5, 2009
    Messages:
    727
    Likes:
    7
    Location:
    London, UK
    I think the SN754110 solution posted is the best one yet.

    What 12ohm resistor? I didn't see one.

    The uC supply can be 3 V to 5 V with no problem, can't it?

    What's wrong with 6 mA base drive? They're not hometaxial BJTs you know! :) Yes the uC can deliver more mA, so might as well up the base current.
    [​IMG]
     
    Last edited: Jul 31, 2009
  12. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    A 3V Toy motor will run fine (just faster) with a couple more volts.
     
  13. giftiger_wunsch

    giftiger_wunsch New Member

    Joined:
    Jun 15, 2009
    Messages:
    813
    Likes:
    3
    Location:
    Kent, England
    Marcbarker, I note that the primary difference between your schematic and mine is the addition of 330Ω resistors on the µC circuits and that your schematic uses PA0-3, while I'm trying to minimise the use of too many bits since I have 5 motors and a limited number of parallel port bits to use. What is the function of the 330Ω resistors?

    Also, your schematic simply connects the µC GND to the battery ground, while if possible I would like to run the µC circuit between the PA0 and PA1 ports without using the actual GND terminals on the µC, if this will be possible. I explained this in previous posts. Could you suggest a way this might be achieved? As I mentioned in my last post, clearly my reasoning must have been faulty but hopefully you can see what I was trying to achieve.

    Either way, I'm going to pore through some of the documentation, etc. suggested, especially the IC suggested by blueroomelectronics.

    Thanks for the continued help, everyone :D
     
  14. marcbarker

    marcbarker New Member

    Joined:
    Jul 5, 2009
    Messages:
    727
    Likes:
    7
    Location:
    London, UK
    I still think the IC solution posted earlier is better...

    µC GND to the battery ground is intentonal, you have to connect uC somewhere to the battery circuit, you just do OK?:), so it's negative here.

    330 Ohm 's set the base drive current into the BJTs. They'll set 6 mA of current. As AG points out it could benefit being higher, say 20 mA. I'll discuss this later.

    Here's a 'trade secret' in circuit analogies. When using a transistor to switch a significant current, it's a bit like "grasping a nettle'". If it's done half-heartedly, you get stung, but if you grab a nettle hard it doesn't sting you. When driving a transistor to switch a significant amount of current, you need also to be sure you're driving it more than it needs, then the transistor doesn't heat up or fry.

    It's done by analysis. Very roughly, you can look at how much motor current you're going to be switching (200 mA?). Then look for the hFE parameter in the datasheet, as near that current you can find. Say it's hFE=100 @ 50 mA. Now it's 200 / 100 = 2 mA of base current needed. 2 mA is considered 'not grasping the nettle', you'll need to overdrive it some. If you don't overdrive it, it's not the end of the world, but you'll start smelling burning and maybe burn your finger.

    Once you've decided on how much to drive the BJT, you do some sums. Say if it's 3 V supply to uC, and you'd chose 10 mA. It's roughly 2 / 10 (kohms) = 200 Ohm. Where '2' came from is the voltage across the resistor that you want to use. That's a guess by me based on experience, which is 'knock off a volt' for this particular circuit, it'll take too long to explain:)

    If you overdrive the BJT too much (lower resistor value), it won't harm the transistor, but the uC could warm up too much. You'll probably be able to drive a total of 100 mA with the uC.
     
  15. mneary

    mneary New Member

    Joined:
    Feb 27, 2007
    Messages:
    4,502
    Likes:
    67
    Location:
    California USA
    Do you mean 754410?
    At a glance, looks like L293D, (even pin compatible) in case one of them is easier to find.
     
    Last edited: Jul 31, 2009
  16. giftiger_wunsch

    giftiger_wunsch New Member

    Joined:
    Jun 15, 2009
    Messages:
    813
    Likes:
    3
    Location:
    Kent, England
    I realise that, but if you look at my schematic you'll see that I was trying to use the opposing uC parallel port bit as a ground: if PA0 is high and PA1 is low, then PA1 will be used as GND. If PA1 is low then I believe PA1 is essentially connected the to uC GND anyway: testing with a voltmeter between the ports and GND yields a very low resistance. Clearly I didn't do this right in my circuit, but that's what I'm trying to achieve. I understand that the circuit needs to be completed by connected the uC to the battery circuit at some point, I just would prefer not to do it the way you have in your schematic, if it can be done the way I have described. Any suggestions?


    As to the explanation about the transistor: if it could benefit from being at 20mA, why use a resistor at all? The max output current of my uC's parallel ports is 20mA, and it'll be used to drive two transistors per port, so each transistor should receive ~10mA.
     
    Last edited: Jul 31, 2009
  17. marcbarker

    marcbarker New Member

    Joined:
    Jul 5, 2009
    Messages:
    727
    Likes:
    7
    Location:
    London, UK
    I see what you're getting at now with the opposing PA bits. Minimising connections & the green diodes that always seemed to look wrong. It's not really the 'done thing' though, to chop ground return about on the fly, when it's digital and especially when it's a project you're developing. Think about how you're going to test it, with the 'ground' of the battery flying around! Something I've noticed over the years, is that circuits which are too unusual way of doing a job, are more likely to dissapear from common usage, because people find them hard to understand.

    Good point about not using the resistor, and letting the IC regulate the current, but that's not the done thing either, and you'll find in practice the current will be higher than 20 mA though. It makes things difficult to test too, because it makes the IC output voltages look 'wrong', especially to anyone else looking at the circuit. Another reason why is the total output current of the IC needs to be limited, or the IC gets hot. No, you have to have the base resistors with a BJT.
     
  18. giftiger_wunsch

    giftiger_wunsch New Member

    Joined:
    Jun 15, 2009
    Messages:
    813
    Likes:
    3
    Location:
    Kent, England
    Is there a better way of having the same functionality then? Using PA0 and PA1 as a complementary pair is so that both logic high is the same as both logic low, not to save pins - everything could ultimately be connected to a single GND pin on the µC anyway. Many of the H-Bridge circuits linked to on this thread have had the same functionality that I am trying to achieve.
     
  19. marcbarker

    marcbarker New Member

    Joined:
    Jul 5, 2009
    Messages:
    727
    Likes:
    7
    Location:
    London, UK
    You really ought to directly link h-bridge ground to uC ground, you'll probably use the same ribbon cable as for the IOs.

    Logically, you need 2 IO's per motor, you cant get away with that.

    Well you can actually use less, if you utilise any PWM function available on the uC, in which case it can be just one IO per motor. But I'd stick to h-b for your first go at this.
     
  20. giftiger_wunsch

    giftiger_wunsch New Member

    Joined:
    Jun 15, 2009
    Messages:
    813
    Likes:
    3
    Location:
    Kent, England
    One IO per motor? How does that work? No, I'm fairly sure I'm going to need to use two parallel port bits per motor - logically the motor needs to be in at least three states: forward, reverse, stop. Two bits gives me a total of four combinations. All I'm trying to achieve here is to make both 1,1 and 0,0 stop the motor. I don't really see why that part is so difficult, or why I'll need a direct connection to the GND pin when I can use PA0 an PA1 to complement each other, thus obtaining the required functionality.
     
  21. marcbarker

    marcbarker New Member

    Joined:
    Jul 5, 2009
    Messages:
    727
    Likes:
    7
    Location:
    London, UK
    i still think the IC solution is the best.

    The "third state with from single IO" can be two things:

    1. Duty Cycle of a PWM square wave signal from that output. ( can be H, L or anywhere in between)

    2. The uC software changes the IO into an Input, as required. (A third state)

    Number 2. Might be worth looking into some more.
     
    Last edited: Aug 1, 2009

Share This Page