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.

LED's and Microcontrollers

Status
Not open for further replies.

MrMikey83

New Member
I have a bank of tri color LED's that I need to be able to use 4 outputs from an ATMEGA32 on. Actually, 3 outputs will go to the possitive side of the LEDs turning on one of three transistors to choose the color of the bank. Then, an output to each LED to light them individually.
My question is do I need to have a transistor on the negative side or can I feed each LED's negative to an output on the Microcontroller so it is on when there is a 0 on the output pins?
~Mike
 
You only need transistors if the current requirements exceed those the micro-controller can supply - as long as the current requirements are low enough you don't need a driver (at either the top or bottom of the LED's).
 
Be aware that once you start asking for a lot of mA out of a chip, you won't get 0 or 5v out. You may lose half a volt or more due to pin impedance as you approach the pin's max current capacity. In a voltage critical device like an LED this can seriously affect the intensity.

It's worthy of note that the pulldown may be slightly stronger than the pullup since n-channel technology is better than p-channel. Thus I think you will see somewhat less voltage drop in the chip if you were to use a pulldown (anode through resistor to Vdd, cathode to the pin assigned as 0). I haven't tested this myself, though.
 
OK, I tested this setup and it seems to work fine.

Another question though...

I am using the tri color LED's. They have 4 pins, one for each color (red,green,blue) and a common cathode.
Each color works fine on its own. Blue and Green can be turned on at the same time, but if I try red and blue or red and green, or all three colors, only the red lights. Why would this be?
~Mike
 
MrMikey83 said:
OK, I tested this setup and it seems to work fine.

Another question though...

I am using the tri color LED's. They have 4 pins, one for each color (red,green,blue) and a common cathode.
Each color works fine on its own. Blue and Green can be turned on at the same time, but if I try red and blue or red and green, or all three colors, only the red lights. Why would this be?
~Mike

The red LED has the lowest operating voltage and so gets all the current. If you put three separate resistors in the anodes then it should work fine.

Mike.
 
Status
Not open for further replies.

Latest threads

Back
Top