from LED to light BULB

Discussion in 'Embedded Systems and Microcontrollers' started by kiljoi, Oct 26, 2009.

  1. kiljoi

    Thread Starter New Member

    Oct 26, 2009
    2
    0
    hello...:D
    for my project i'm using a PIC18F452 and light sensors to turn on my LED.
    i manage to turn on the led according to the condition i've set using the pic and now i need to replace the led with a light bulb.

    i'm using a 4.8v 0.3A light bulb..

    i know that at the output pin for the pic, the current is only at 25mA@5v...the current is too small to turn on the bulb
    so my question is HOW DO I AMPLIFY THE CURRENT??...can i amplify the current?....is it by using a transformer??..can anyone help me???...i can't think of something better...:(:(

    it would be a lifesaver is someone can show me the circuit to amplify the current..

    i'm still an amateur in all this stuff...i ask a lot of people in order to make sure my led works..now the problem is to replace the led to a light bulb..

    FYI,i've tried replacing the led connection to the bulb...the voltage drop suddenly..the voltage at the output pin when i turn on led is 4.5++volt..and when i try it with bulb it around 0.05++v...it makes no sense..why does that occured??

    many2 thanks in advance..
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The easiest way would be to use a transistor.
    I don't know what is available where you are, but here in the USA, the 2N2222/PN2222 transistor is very frequently used as a switch for such tasks.

    1) Emitter is connected to GND.
    2) Base is connected to your uC I/O pin using a resistor. The resistor limits current from the I/O pin and going into the base. To ensure saturation of the transistor, you should give the base 1/10 of the desired collector current - however even that isn't possible.
    If your uC's Vcc is 5v, a 220 Ohm resistor from the I/O pin to the base of the transistor will give a base current of around 19mA. This will guarantee transistor saturation for a load of 190mA. It MAY work for a load as high as 400mA, but you may have to try several transistors before you can get it to work.

    3) Connect the collector of the transistor to the ground side of the light bulb.
    4) Connect the other side of the light bulb to +5v.

    When you place 5v on the uC's I/O pin, the transistor will turn on and sink current from the lightbulb.

    Another way is to use an N-channel logic-level power MOSFET.
    1) Use a 470 Ohm resistor from the I/O pin to the MOSFET's gate.
    2) Connect the MOSFET source terminal to GND.
    3) Connect the MOSFET drain terminal to the ground side of the light bulb.
    4) Connect the other side of the light bulb to +5v.
     
  3. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Simply because the PIC output pin is trying to supply 5V to the bulb and because of the low resistance of the bulb it can't.
    Go with Alberto's suggestion, or if you just need one bulb, any kind of darlington transistor wired as recommended will do (if it is ok for the current).
     
  4. kiljoi

    Thread Starter New Member

    Oct 26, 2009
    2
    0
    thanks guys for the guides..it really works!!...i've tried using the uln22803..the bulb lights on!!..

    using 3 bulbs connected to the uln2803..the lights turn on exactly as it should be but i couldn't help but notice that the brightness of each light is not the same...meaning that the 1st one is brighter than the 2nd and the 2nd is brighter than the 3rd..

    i want all light bulbs shine the same...what adjustment do i need to do??..can i do that??...

    thanks in advance...:)
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    It sounds like your power supply is getting loaded down with all of those light bulbs getting turned on.
     
  6. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    Do you light them permanently or in sequence? If the last, that could make for the difference.

    Are the bulbs of the same type? If not, that also could be the reason.

    Swap them and check where is now the weakest one. Always discard obvious / simple things before doing any change.
     
    Last edited: Nov 1, 2009
Loading...