Shop OBEX P1 Docs P2 Docs Learn Events
LED issues — Parallax Forums

LED issues

raejjraejj Posts: 14
edited 2009-04-06 05:24 in Learn with BlocklyProp
Hi all,

I'm having difficulty getting any response from my led circuit. I have a green led in series with a 120 ohm resistor. This is in parallel with five other led-resistor combinations. This is driven by a 2n2222a transistor. The base of the transistor is connected to the digital pot ad5220. Here is the schematic below. Does anyone have any suggestions as to why it doesn't work? I would greatly appreciate any input.

Thanks in advance.
572 x 274 - 17K

Comments

  • mikedivmikediv Posts: 825
    edited 2009-03-28 23:08
    raejj·I am sure you already checked this but make sure you have the LED's in the correct direction I have so many that some ended up having thier leads cut so I didint know what way to place them without checking each one,, any way that aside, what are you using to control the pot??? have you tried removing the pot and wiring direct just to rule out the pot ???? I would work my way backwards first testing the LED/Res group to make sure it lights
    if I am reading the schematic corectly all the LEDS are on or off at the same time you are using the pot to regulate intensity?
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-28 23:23
    You show 1K resistors in series with the LEDs. You didn't say what the total resistance is of the digital pot, but I assume it's 10K. A green LED has a forward voltage of anywhere from 2.1 to 2.7V depending on the specific LED construction. Say it's 2.5V. That leaves roughly 2.2V to drop across the 1K resistor assuming (ideally) that the drop across the 2N2222 is maybe 0.3V. That gives an LED current of 2.2mA per LED which would certainly give you a dim LED.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-03-28 23:30
    You're using a bipolar transistor in a circuit that was designed for a MOSFET. A bipolar transistor requires a base resistor to limit base current when the pot is at its high extreme. Omitting this could destroy either the transistor, the digital pot, or both, due to excess current.

    -Phil
  • raejjraejj Posts: 14
    edited 2009-03-29 13:36
    Hi,

    I apologize for the schematic. I was really in a rush and forgot to update it. Anyways, I checked the LED direction and they are all correct. Even if you cut them, there is a flat edge on the capsule indicating that side is the cathode. To answer your questions, I am using the Basic Stamp 2 to control the pot. And yes, I have all the LEDs on and off at the same time. Thanks for the suggestions on debugging. I'll have to try it.

    Mike, the digital pot is 10k. I changed the resistance to 120 ohms and from the calculations, I got a current of 18.333mA flowing through the LED. Using KCL, the current through the collector is roughly 110 mA. With a beta of 100 (worst case), the base current would be 1.1 mA. Is this current too large with the resistor at the base being 50k?

    Phil, you are so right. I connected a 50k resistor to the transistor 2N2222a. Do you know it could work with a mosfet BS170? That was my original plan but I realized there would be no voltage divider across the base of the mosfet.
    691 x 274 - 19K
  • Craig EidCraig Eid Posts: 106
    edited 2009-04-06 05:24
    raejj,

    The 2N2222A will not saturate with a 50K base resistor and your LED's will stay dim at best. You can calculate the base current required· to saturate the transistor using the Stamp specification for·VOH· and the 2N2222A specifications for hfe and VCEsat·.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com
Sign In or Register to comment.