[LTSpice] Trouble with a simple simulation

Discussion in 'General Electronics Chat' started by exscape, Jan 19, 2012.

  1. exscape

    Thread Starter New Member

    Jan 19, 2012
    28
    0
    Hi, everyone!
    I'm new to electronics (and even newer to LTSpice, having started yesterday or so), and I'm having some trouble with a simulation.

    I have a simple circuit with a transistor and two LEDs (see the attched picture and/or LTSpice file; the screenshot is the exact same circuit, just to make it easier for some).
    I've built the circuit, and it appears to work as expected. However, I did not know quite how to add a push button in LTSpice; in the real circuit, it's on the wire along the very right.
    With the push button "open", one LED is lit. When the button is held down, the other LED is lit.

    Now, the problem is that LTSpice tells me there's a 3.23 amp current on the transistor's base pin! :confused:

    I assume that's not accurate (not only because it doesn't make any sense to me, but also because my circuit works with my arduino via USB as a power source), but what is causing it? Some quirk of SPICE I'm unaware of? Or am I actually doing something wrong with the circuit itself?
     
  2. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
    The circuit on you diagram cannot work properly.
    I attach correct diagram.

    Use Ctrl+ R to rotate the part and Ctrl+E to mirror
     
  3. exscape

    Thread Starter New Member

    Jan 19, 2012
    28
    0
    Thanks, but is there something in particular wrong with my circuit? The error is clearly in my LTSpice model, since it works exactly as it should IRL. It might be a dumb mistake I'm not seeing, or something I'm just doing wrong with LTSpice.
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,233
    The simulation is correct. You have the +5V directly connected to the base which, in real life, will draw a large base current and zap the transistor. Did you mean to have the +5V connected to the base through R1?
     
  5. exscape

    Thread Starter New Member

    Jan 19, 2012
    28
    0
    Whoops. No, I did mean to have it connected directly, though clearly I shouldn't. I pretty much learnt about transistors this morning, and not thoroughly yet, either!

    I tried to copy this schematic... So now two options remain:
    1) I don't really know what "IN" is supposed to be connected to (that's a fact, by the way, not just a possibility)
    2) That schematic is also faulty.

    Which options is it? ;)
    Also, since I really don't know what "IN" really means in this context, could someone give a brief explanation? Thanks.
     
  6. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    That doofus in the video doesn't know what he is doing.
     
  7. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
    The correct answer is two (That schematic is also faulty) or he use the MOSFET instead of BJT in his video.
    BJT always need resistor in series with the base, which reduces the base current is to a safe value. See my diagram in post 2.
     
  8. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Your schematic is good for simulation, but the voltage-controlled switch may confuse a newbie.
     
  9. exscape

    Thread Starter New Member

    Jan 19, 2012
    28
    0
    Thanks! However, your schematic differs in purpose from mine (actually I'm not 100% sure what yours does). Mine switches between two LEDs (green with the button up/open, red with the button pressed), though with the "slight" issue of a short.
    Can I simply add a resistor to the transistor base pin? If so, what ballpark resistance should I use? 10k?
     
  10. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    This should do what you want.
     
Loading...