Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Easy transistor

Status
Not open for further replies.

demestav

Member
Hello there. I am trying to drive an LED out of the PWM pins of a microntroller. When the LED is not connected on the mc the signal is fine, i can see pulses on the osciloscope from 0~5V. However when i connect the LED these pulses drop to 0~1V. I assume the mc cannot provide enough current out of the pins. Is this correct?

Now that means i have to use transistor to drive the LED. And because I am not good at all with analog I wanted to ask you how to do that.

Would the following be ok?

Thanks and sorry if this is too silly.
 

Attachments

  • mc.jpg
    mc.jpg
    76.6 KB · Views: 491
Your skem for the LED driver will work, but you should add a 10K resistor in series with the base to limit base-emitter current.

When you first connected the LED directly to the controller pin, did you have a current limiting resistor in series with it? If not, the LED may have been drawing more current than the line could handle. Also, most devices can sink more current than they can source. In that case, connecting the anode of the LED to the positive supply through a current limiting resistor and the cathode to the controller output might work. But then the LED will light with a LOW from the controller. It all depends upon what you need.

Dean
 
Thank Dean for the reply.

When i connected it in the first place with the mc i had a resistor connecting the pin and the anode of the diode. the cathode was connected to the ground.

I will try the transistor thing today as you suggested it.

Also, most devices can sink more current than they can source. In that case, connecting the anode of the LED to the positive supply through a current limiting resistor and the cathode to the controller output might work.

Hmm why that happens? If that was the case why it did not work in the first place?

Thanks a lot for your time, and it would be great for me to learn something from this thread. :idea:
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top