Using BJT Transistors as switch for 8x8 LED Matrix display

Discussion in 'The Projects Forum' started by Kkein, Feb 6, 2016.

  1. Kkein

    Thread Starter Member

    Jun 10, 2011
    46
    0
    Hello Folks,
    I'm using proteus version 7.9 to simulate 8x8 led matrix and using BJT transistors in sourcing configuration. All load limiting resistors for the leds are digital resistors in the simulation. The placement of the resistive loads create problem for the circuit. When the resistors are placed between the transistors collectors and the common anode side as shown on the diagram, the simulation does not work; LEDs don't light up. But when I placed the digital resistors on the cathode side, (i.e. between the shift registers and cathode side of led matrix), the simulation works fine.
    • the base resistors are 2k7 each,
    • the bypassed load resistors on the collectors, or anode side are 33ohms each
    • the load resistors on the cathode side are 150ohm each
    I have not built the breadboard version yet. Is this problem with Proteus software?
    Thank you for response.


    [​IMG]
     
    Last edited: Feb 6, 2016
  2. Sonoran Desert Tortoise

    Member

    Oct 30, 2014
    53
    34
    Why do you have one NPN transistor and 7 PNP transistors controlling your anode multiplexing?
     
  3. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,518
    1,247
    A single resistor sourcing 8 LEDs will not work well in the real world. Keep the current limiting resistors on the cathode side.
    As part of the HC series, the 595 probably cannot sink 20 mA per output.

    As a general practice for this type of schematic, move the LED source power and the anode transistors to the top part of the schematic. Power and signals move from left to right and top to bottom. When in conflict, signal flow trumps power flow. I would move the 74HC7595 to the left near the microcontroller, placing more of the system signals together on the left, and the system "output", the display, on the right.

    ak
     
  4. Kkein

    Thread Starter Member

    Jun 10, 2011
    46
    0
    Thanks guys. I originally had all NPN transistors, but changed to PNPs and forgot to replace that one!

    I concur that I should keep the load resistors on the cathode side because as i now see it, putting 33ohm resistors on the anode side would allow160mA to flow, and the 74HC595 isn't capable of sinking that much current per pin.

    However, I'm not sure if moving the power and signals from left to right and top to bottom would change the behavior of the circuit. Is that just to keep things neat?

    Also, why aren't the leds in the matrix lighting up when the load resistors are between the cathode and the emitter of current sinking BJT transistors (PNP), but work when the resistors are between the ground and the collectors (see attached)?

    Thanks.


    [​IMG]
     
    Last edited: Feb 7, 2016
  5. Sonoran Desert Tortoise

    Member

    Oct 30, 2014
    53
    34
    Changing the schematic with power + on top & - on bottom, and signal source on left and signal destination on right just make it easy to read. Upside down ground symbols make the reader work to understand and schematics can be misunderstood if the common layout is not followed.

    As for your question about resistor position....

    To turn a PNP resistor on (allow current to flow), the base signal must be pulled 0.7 volts below the emitter. How can that be done if the transistor is connected to ground? PNPs are placed closer to the + power rail for that reason. Adding the resistor between the PNP and ground "lifts" the PNP some volts above ground (by current X resistance = volts).

    Notice that LIFT is in quotes. It is common to use words like lift and raise when describing voltage of a schematic when the standard layout rules are followed. Since your PNPs are upside down according to standards, saying LIFT can get confusing.
     
  6. dannyf

    Well-Known Member

    Sep 13, 2015
    1,775
    360
    Swith the high side with a pnp and the low side with a npn.
     
  7. Kkein

    Thread Starter Member

    Jun 10, 2011
    46
    0
    Thanks folks. Using PNP for highside does not work for me. I have simplified the simulation by using logic State components and analogue resistors. Here is the circuit. For some reasons, the highside PNP is always ON regardless of the state of logic State. Everything works fine without the PNP. But when I replaced the highside PNP with NPN, it works, however; the current through the LED halved. I suspect Proteus software might be an issue. Kindly help.
    Thanks

    [​IMG]
     
  8. Sonoran Desert Tortoise

    Member

    Oct 30, 2014
    53
    34
    I think your simulator is getting confused by your jumper across the resistor above the PNP.
    -or-
    Your digital supply connected to the emitter of the PNP may not really be at 5 V (you wrote 5V but did you measure it. If it is set to 12 V, then the PNP will not turn off.

    That's all I can think of.
     
  9. Kkein

    Thread Starter Member

    Jun 10, 2011
    46
    0
    Hi folks, got it working. Apparently, 2n3906 was the problem. Everything works when I replaced it with BC556AP. Could be problem with Spice model. Anyone knows how I should update the spice model for this transistor.
    Also, the reason why the led matrix did not display anything when the load resistors are between the cathode and the low side npn transistors is because the resistors are digital ones. It works when I changed them to analogue. However, there is too much lags, and proteus couldn't simulate properly. I'm sure it will work well in real life.

    Attached is my schematic.

    [​IMG]
     
  10. thumb2

    Member

    Oct 4, 2015
    66
    4
    Throw away simulators and start studying electronics.
     
Loading...