NPN Transistor Switch Help

Discussion in 'The Projects Forum' started by Dmm, Feb 17, 2016.

  1. Dmm

    Thread Starter Member

    Apr 13, 2015
    31
    1
    I have a working circuit that is a 0-99 counter via a push button, Arduino and a couple 4026 decade counters. This works just fine. I'm trying to make a custom 7-segment display from and LED strip. The LED strip is one of those that you can cut every so often. I've cut mine so that there are 6 LED on the segment. It looks like there are two resistors on the strip as well labeled 151. See attached picture.

    So right now, I'm trying to disconnect one of the 7-segment outputs from the decade counter and run it through a transistor in order to turn on the LED strip. The LED strip runs on 12v and I measured the current when connected directly to 12v batter at 36 mA. I've attached a sketch of the circuit. The LEDs & R1s shown is my best guess at how that LED strip is wired together. The arduino side runs on about 5v and I have the LEDs connected to a separate 12v battery.

    If I need 36mA to flow from collector to emitter, and from what I've read you can assume a gain of 100-300 for this transistor, then the required current on the base would be 36mA / 100 = 0.36mA. I measured the voltage on the output signal (from the decade counter) at 4.83v. Then calculating R2 I used [ 4.83v - 0.7v ] / 0.72mA = 5.7 k-ohms. I used 0.72mA instead of 0.36mA as I read somewhere you want to increase this by factor of 2 to ensure fully saturated for a switch.

    When I connect everything the LED strip does not come on. I switched R2 to a few different value 5.6 kohm, 2.2kohm, and currently connected with a 1k for R2 and nothing has worked.

    Any insight on what I'm doing wrong? I checked the transistor with a multimeter set on diode setting and with (-)ive on emitter and (+)ive on base I get a reading of 0.654v and (-)ive on collector and (+)ive on base I get 0.652v. Then between collector and base is no reading.
    IMG_0111.JPG IMG_0109.JPG
     
  2. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,227
    The LEDs should come on if you connect R2 to the 4.8V supply.
    Are you certain the transistor is connected correctly?
     
  3. dannyf

    Well-Known Member

    Sep 13, 2015
    1,775
    360
    Ground connected? Wiring correct? Polarity correct? Code collect? ...
     
  4. Dmm

    Thread Starter Member

    Apr 13, 2015
    31
    1
    The arduino code is correct as I tested with the dual 7-segment display before disconnecting just one output to test an LED strip. The LED strip that I cut requires about 7.1v for the LEDs to come on real dim. At 12v it is pretty bright. So connecting the LED strip directly to the decade counter output will not light it up. Hence the need for the transistor and the extra 12v battery.

    I did swap the transistor in case I just had that in backwards, but it still does not light up.

    I double checked the 12v connection to the bread board and I have 12v power going into the LED strip and to the correct side (+12v battery to + of the LED strip, -LED strip connected to transistor collector) and I tested the LED strip I have connected and it comes on between the 7v to 12v range. The other segments are still connected to the dual 7-segment display so that side of things are working just fine...and if I reconnect my output that is now going to the transistor base (through R2) and put it back on the 7-seg display that portion lights up correctly on the 7-seg display. I'll do some more with the multimeter and see if I find something that may be helpful.
     
  5. Dmm

    Thread Starter Member

    Apr 13, 2015
    31
    1
    If I reconnect to the 7-seg display and measure the current at that one segment I get about 1.5 mA (between output of counter and the segment.) But if I connect the decade counter segment output to my transistor base through R2, and measure current in line between the output and the R2 I don't register any current flowing. My transistor emitter is connected to the ground of the 12v battery. And the 7-seg display is grounded to the 5v arduino circuit. Does that have anything to do with it since they are grounded to different voltage sources?
     
  6. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,518
    1,247
    The two most likely causes are grounding and pinout. Note that not all small signal transistors have the same pinout. Also, are the +12 battery return, the ardiuno GND, the 4026 Vss pins, and the transistor emitter all tied together? With Vdd = 5 V, a 4026 can source around 1 mA at a 4.6 V out. I'd set the base resistor at 3.9K and see what the voltage drop across it is, and the transistor Vbe. Also, replace the LED strip with a 10 K resistor and measure the collector voltage. If the 10 K pulls the collector up to 12 V, then the collector current is zero, not just weak. Another clue.

    ak
     
  7. Dmm

    Thread Starter Member

    Apr 13, 2015
    31
    1
    Is there a good way to verify which pin is which on the transistor? I found a YouTube video talking about that and I described what I measured back at the end of my post #1.

    The arduino is currently powered via USB cable from computer. The LED strip is powered by the 12v battery. The only real connection between these two separate circuits is the "data" wire or the output from the decade counter - I have 1 of those segments connected over to the breadboard with the transistor with my LED strip segment. I attached a picture of the circuit.
    IMG_0112.JPG
    @AnalogKid No, all those "grounds" are not tied together. The arduino side is separated right now. Is that an issue? The only thing on the 12v battery ground is the emitter.
     
  8. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,518
    1,247
    Datasheet.

    Yes!

    Think about it. That transistor circuit is called "common emitter." That's because the emitter is common to both the base circuit and the collector circuit. Base current coming from the arduino power system and collector current from the battery are flowing through the emitter at the same time, yet have to return to their respective sources. Therefore, both returns must be tied to the emitter. Run a wire connecting together the grounds on the two protoboards.

    ak
     
  9. Dmm

    Thread Starter Member

    Apr 13, 2015
    31
    1
    That fixed it! Thanks for the help everyone!
     
  10. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,518
    1,247
    Glad it's working. The clue was sitting there in your first post. When you draw a schematic, include *everything*, follow the little electrons around, and see where they don't go.

    ak
     
Loading...