Connect with us

NPN circuit not behaving...

Discussion in 'General Electronics Discussion' started by medic, Aug 8, 2013.

Scroll to continue with content
  1. medic

    medic

    7
    0
    Aug 8, 2013
    I'd thought I knew how to use an NPN but my circuit does not work...

    A momentary switch S1 is connected to a 3.7V battery. Pressing SW pulls U3 Enable high turning it on. A microcontroller is powered which latches U3 Enable high through D2.

    When VUSB is applied I want to force U3 Enable low to turn the Microcontroller off (maximize charging current to battery). But applying 5v to VUSB does not drive U3 Enable low.
    I put a LED in series between R3 and Q1 and that does turn off when VSUB is applied but U3 stays on....?

    Any help greatly appreciated....

    [​IMG]
     

    Attached Files:

  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,496
    2,837
    Jan 21, 2010
    Is the USB ground connected to your system ground?
     
  3. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Your circuit should work OK.

    What type of transistor are you using for Q1?
    What is the voltage on U3 pin 3 in each state?
    What is the minimum threshold voltage specification for U3 pin 3?
     
  4. medic

    medic

    7
    0
    Aug 8, 2013
    Hey there, thanks for asking!

    the USB is connected to the common ground of the circuit.

    I'm using a 2n3904 transistor.
    Output Enable (active high), U3 Pin 3 voltage is zero before button press and 3.3V in the latched state.
    The max 'off' voltage is 0.25V, the min 'on' voltage is 1.6V

    Thanks for your help,

    p.s. the circuit was my best idea at how to override the latch on the enable when USB (5V) is applied. If there's a better way I'd much appreciated suggestions.
     
  5. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    You say the CE pin voltage is 0V before the button is pressed, and 3.3V when the MCU has latched it ON. So what is the CE pin voltage when VUSB is present?

    That circuit is very straightforward and can be diagnosed step-by-step pretty easily. You understand how it works, because you designed it. So you should be able to figure out the problem with just a multimeter.

    Regarding how to unlatch the regulator enable, the way you've done it is fine, but you could do it by having the MCU drop its control output when it detects the presence of USB 5V (assuming it can detect this somehow). That would also allow you to impement a short delay while USB 5V is present, if you want to, so that the MCU can be confident that the USB connector is properly plugged in before it turns off the secondary supply.
     
  6. medic

    medic

    7
    0
    Aug 8, 2013
    Hmmm that's another idea.
    My reason for shutting the micro down was for two reasons.

    1. Bi-LED Status. The battery charger has a tri-state output which is a 1 pin output to a bi-led. The micro also uses 1 pin to drive the same LED so i needed to make sure the charger and micro did not drive the pin at the same time (i.e. one has to be high Z).

    2. Hard reset. Should the micro crash and leave power latched the user would need wait for the battery to discharge to recover. My design is supposed to force the micro off (by removing VCC) so that a hard reset occurs on USB insertion.

    Will take some measurements of CE pin when USB is present. My guess is that it's not being pulled low enough to turn the reg off..
     
  7. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    652
    May 8, 2012
    The BAV70 is two switching diodes in a single package. They share a common emitter pin only. I mention this because it's not properly drawn on your print.

    Chris
     
  8. medic

    medic

    7
    0
    Aug 8, 2013
    Indeed it is, and works nicely here as it prevents flow from the latch through to the button and vice versa.

    I could have drawn the diodes separately connected by a common cathode but wanted to represent that it was a single 3 pin package on my schematic. I guess I could have drawn two diodes with a box around them? How would you have drawn it?
     
  9. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Yes, I would have drawn it as a box containing two diodes, internally commoned at the cathode. That's how it's shown in the data sheet as well.

    The symbol you are currently using seems clear enough in meaning - at least, when shown in the context of the whole diagram. In fact I didn't consciously realise that it was wrong until Chris pointed it out - I immediately understood what it represented when I saw it. But it is not really explicit, and I believe that diagrams should emphasise clarity and avoid any possible confusion to the maximum possible extent. So I would never draw it the way you did.

    Edit: You don't need a double diode; a single diode from the microcontroller output is enough. You don't need a diode from the pushbutton as long as you have a diode from the microcontroller output.
     
    Last edited: Aug 17, 2013
  10. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,496
    2,837
    Jan 21, 2010
    Yes, that would be a way.

    The other way would be to just draw it a 2 diodes and label them as (say) D1a and D1b which tells us they're part of the same device.

    The way you suggest would be the clearest.
     
  11. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    652
    May 8, 2012
    I'm sorry but our industry doesn't accept schematic freestyle. We're not going to let what happened to the English language, do to texting habits, migrate to our field. Besides that point are you aware that a Programmable Unijunction Transistor is drawn very similar to what you drew?

    Yes, two common cathode diodes in a box; just like the manufacturer drew it.

    Chris
     
  12. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    On that subject, what do you guys think about my Darlington transistor symbol? It's a standard transistor with two arrows on the emitter - see Q1 and Q2 in the diagram on https://www.electronicspoint.com/help-amp-t262454.html#post1565548.

    I haven't seen it before; I just use it to save space, because I think the standard symbol is disproportionately big. Do you think its meaning is obvious? Do you consider it wrong?
     
  13. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    652
    May 8, 2012
    Kris, have you been texting? :p
    After beating up the new guy I'd be accused of nepotism if I said that was OK. ;)
    Send it off to the IEEE to see if they'll accept it. Hey, if they say it's OK who am I to argue?

    Chris

    PS. Yeh, Darlingtons do take up real estate.
     
  14. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,496
    2,837
    Jan 21, 2010
    I'd probably wonder if it was some strange sort of transistor I hadn't seen before.

    However, I'm not too much against drawing it as a normal transistor and then adding a note somewhere that it's a darlington.

    Another approach I've seen used (with some special MOSFET-like devices) is to place them in a square rather than a circle.

    Drawing a darlington is probably just as complex as drawing a mosfet with a body diode. And we often don't draw the body diode (to simplify the drawing?)
     
  15. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Thanks Chris and Steve for the feedback.

    I'll create a new symbol that shows both transistors but doesn't take up a huge amount of space.
     
  16. medic

    medic

    7
    0
    Aug 8, 2013
    Hey that's a good thought! I used a double diode as I imagined it would protect each source from the other, but I guess the latch will never be higher than the button source (battery).

    I did solve my BJT problem (not grounding CE). It turns out the 2N3904 left 39mV on the CE pin when the base was at 5V, this was enough to keep the Vreg on. I played around in Multisim with other diodes and ended up with a DTC114EET1G which did properly ground CE and has pre-bias resistors build in saving on soldering and baord space.

    Thanks to all for comments, much appreciated and learned along the way.
     
  17. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    But you said earlier:
    (Highlighting mine.)

    39 mV is pretty low - low enough to be considered "low" by every discrete semiconductor and IC that I've ever heard of. And it's a lot lower than the minimum low threshold of the CE pin on that IC. So you haven't explained what the problem was.
     
  18. medic

    medic

    7
    0
    Aug 8, 2013
    Shoot... your right, I had read that as 25mV. So it's still a mystery why the NPN wont ground that pin against a 10K pull up...
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-