LTSpice simulation not matching breadboard?

Discussion in 'Programmer's Corner' started by beezerlm, Apr 15, 2016.

  1. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    Hi,

    I am working on a simple circuit that will monitor the status of a motor drive's (Gecko G320X) fault output signal. If the fault signal is +5VDC, It should have a green LED lit indicating the drive is powered and enabled. If the fault signal goes low, the green LED should turn off and the red LED should turn on.

    I have drawn a simulation and built the matching circuit as shown in the attached screenshot. On the breadboard, the green LED performs as it should, but the red LED (D2 on left circuit) only runs about 1.5ma of current instead of the 15ma the simulation shows. There is also a voltage drop of about 3v from the emitter to the collector of the 2907 transistor? I checked all the resistor values and replaced the 2N2907 with a new one yealding no results.

    Can someone point me in the right direction? I must be missing something.

    The LTSpice Simulation Circuit.
    Circuit.jpg
     
  2. dannyf

    Well-Known Member

    Sep 13, 2015
    1,834
    367
    A red led has a forward voltage drop of about 1.8v. So Q3's base should sit at about 2.5v. That means a base current of 0.5ma. That should be more than enough to drive a pnp into saturation. Maybe your wiring is wrong, or your pin-out is messed up.

    BTW, the design is quite atypical.

    Sure it does something, however indifferent from what it did before.
     
  3. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    I am thinking the same thing but I can't for the life of me find the error. All the voltages match the simulation except for the voltage drop across the 2n2907.

    Yea I figured that. I am about as novice as novice gets.
     
  4. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    I think I may have the pinout of the transistor backwards. Looking at a different datasheet, I think I misinterpreted the pinout of the first datasheet. I don't have the breadboard in front of me but I will give that a try when I get back to work.
     
  5. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    Yep, the first data sheet was drawn in 1st angle projection and I interpreted it as 3rd angle projection.
     
  6. dannyf

    Well-Known Member

    Sep 13, 2015
    1,834
    367
    Transistors work when emitter / collectors are swapped, except with very low beta - consistent with what you observed.
     
    beezerlm likes this.
  7. eetech00

    Active Member

    Jun 8, 2013
    652
    112
    As long as the input is either +5 or ground, wouldn't a transistor Flip Flop work for that?
     
  8. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    If the 5V fault signal can source enough current to drive a green LED at adequate brightness directly you could simplify the circuit considerably.
     
    Last edited: Apr 16, 2016
  9. eetech00

    Active Member

    Jun 8, 2013
    652
    112
    You could use logic level mosfets.

    CTL = 5v = GRN ON
    CTL = 0v = RED ON
    CTL = NC = RED+GRN = OFF
     
  10. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    I think it can, but the signal functions as an input and an output. It can't source too much and If i pull it low it will disable the drive. I would also like to connect this circuit to an input on the control side to notify the operator there is a fault via the computer screen. The input is on a breakout board that is operated by a PC running Mach4.

    I did a retrofit on two of these machines (Moore G18 CNC Jig grinders) around 2010 and it's time to upgrade from Win XP to Win 7 and from Mach 3 to Mach 4 control software. I am trying to add a few more bells and whistles to make things more convenient for the operators. On the current Xp/Mach 3 setup, the operators have to open the cabinet to see if the drives have a fault. I want the indicators and reset to be on the outside of the cabinet so they don't have to open it. Plus it will help keep all of the metal grinding dust from getting on the electronics.
     
  11. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    I haven't used Mosfets in the past. Perhaps its time I do.
     
  12. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    Here's a couple of suggestions.
    The second circuit could only be used if the fault signal Input could drive the green LED directly.
    GreenRedSwitch.PNG
    GreenRedSwitch2.PNG
     
  13. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    Thanks! I like the simplicity of the second circuit. I'm sure they are both more efficient than my first circuit. I may give that a whirl on Monday to see if the fault signal can drive the led directly.

    BTW what is the 5 in the "1.K5" on the first circuit resistor value?
     
  14. dannyf

    Well-Known Member

    Sep 13, 2015
    1,834
    367
    The whole thing depends on the drive capability of the signal pin. The circuits proposed so far assumed it could drive a 1-2k resistor to 5v. That implies a current output of 2ma minimum.

    If that's the case, that pin is perfectly capable of driving most (signal) LEDs directly. No driver is needed.
     
    Last edited: Apr 16, 2016
  15. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    It's a standard notation meaning "1.5 k", i.e. 1500 Ohms.
     
  16. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    I see. I don't think I have seen that before. Obviously my skills do not reside in the field of electronics lol.
     
  17. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    I tried your 2nd circuit but the input signal could not source enough current. I only got about 2ma current through the green led

    I built the your 1st circuit, and the fault signal on the drive kept dropping low disabling the drive. I increased the value of R1 from 2.2K to 2.7K and it functions as expected. If I measure the voltage of the fault signal coming right out of the drive it now only measures 1.6V. It is about 5V when it is not connected to a load. Do you think this could be a problem?
     
  18. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    Hmmm, sounds rather marginal if 2.2k doesn't work but 2.7k works. I don't know enough about your drive to say if there would be a problem. The 1.6V measurement suggests there is a ~6.8k resistor in series with its output, which would possibly allow the output pin to be shorted to ground without harm (but of course would disable the drive). If you are concerned, you could replace Q1 with a Darlington NPN transistor and increase R1 by a factor of at least ten.
     
    beezerlm likes this.
  19. eetech00

    Active Member

    Jun 8, 2013
    652
    112
    Here is a variant of Alex_T's circuit.
    It important that the monitor circuit use an external 5v power source and not use power from the fault pin to power the circuit.
    It sounds like the fault signal has very limited power.
     
    beezerlm likes this.
  20. beezerlm

    Thread Starter New Member

    Apr 4, 2012
    18
    0
    This is interesting. What are the 47k resistors going to ground used for? Maybe to clean up any residual current from the base of the transistors?
     
Loading...