![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Hello, I am still fairly new to this so please bare with me.
For my first project I want to have 5 RGB LEDs to fade slowly from color to color. I plan on using a ATMega168 for the PWM. Right, I need to know if my connections shown in my schematic will work. I know that a microcontroller by itself can run a single led from its pins. Since I need to run 5, I used the ULN2003 IC. I found this info here. Here's my schematic: ![]() Thanks for your help! |
|
|
|
|
|
|
(permalink) |
|
(how will you make PWN without capacitors ? and with only 1 bit for each color ?)
The i.c. in your design is an power darlington driver, i guess... it is meant to drive dc motors and step motor coils... but it will work for your design, you only need to change the the pins used to control the colors to pins that have PWM outputs, or just make 3 simple 8Bit / 4Bit D/A conv. that with your i.c. will work very nice have fun
__________________
Best Regards, Tiago Silva. Last edited by TiagoSilva; 7th June 2008 at 08:04 PM. |
|
|
|
|
|
|
(permalink) |
|
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
![]() Last edited by Hank Fletcher; 7th June 2008 at 10:01 PM. |
||
|
|
|
|
|
(permalink) |
|
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
On a 28-pin DIP they are: PD6 - OC0A - Pin 12 PD5 - OC0B - Pin 11 PB1 - OC1A - Pin 15 PB2 - OC1B - Pin 16 PB3 - OC2A - Pin 17 PD3 - OC2B - Pin 5
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 7th June 2008 at 10:27 PM. |
||
|
|
|
|
|
(permalink) |
|
Thanks, that helps a lot! Here's an updated picture of my schematic. If I put that button on pretty much any pin from PC0 - PC5, I will be able to detect when it's pushed right? Please excuse my noobiness.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
If you pull it high, then when you press the button the switch should connect to ground. If you pull it low, then when you press the button the switch should connect to 5V. Your pullup/pulldown holds the MCU pin at the switch-off voltage level. When you press the button, the switch connects directly to 5V or ground and overpowers the pullup/pulldown. Have a look at how the pulldown resistors are connected on the schematic on this page.
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 7th June 2008 at 11:10 PM. |
||
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
That's probably true. I'm too lazy to look at the datasheet right now. PICs have internal pullups on some ports too.
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
|
|
|
|
|
|
(permalink) |
|
I got another question (I'm full of 'em
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
Your message inspired me to dig out the RGB LED I bought last order and tinker with it. I'm putting up an article on my site now. It'll be ready in 10 or 15 minutes. Nothing terribly earth shaking. Just a simple little newb article.
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
||
|
|
|
|
|
(permalink) |
|
I prefer common anode devices simply because there's a much larger selection of parallel and serial/spi "sinking" drivers (ULN2803, MIC5821/5841, TPIC6C595, etc.) available to work with compared to "sourcing" drivers like the parallel MIC2981/2982.
Mike |
|
|
|
|
|
|
(permalink) |
|
PwnToaster, I just looked at your circuit and there is a problem with the way you want to drive the 5 rgb leds.
In the circuit you have shown GND connected to the common Anodes where it should be a positive voltage. Also, you are driving them in parallel with only 3 resistors in total. This would not work properly as each led has slightly different turn-on voltage and so some will glow brighter than others. It needs a resistor for each led (15 in total) to ensure each one gets the same current. Alternatively you could multiplex them to reduce the resistors to 3 but requires using 5 more outputs on the microcontroller. It is not essential to use the hardware pwm , it can be done in software for this application. Last edited by picasm; 8th June 2008 at 12:45 PM. |
|
|
|
|
|
|
(permalink) |
|
I recently made up a RGB project with a PIC micro, although different controllers, perhaps the way I went about it might lend you some ideas?
Video of the project ![]() Source code and explanations can be found here Spency's digital-diy 18F PIC micro Tutorial - Red Green Blue (RGB) LED's Its generally a very small difference in brightness, if noticeable at all with good LED's
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| LEDs | RayH | General Electronics Chat | 33 | 12th June 2008 08:10 PM |
| 180 leds! | justDIY | Electronic Projects Design/Ideas/Reviews | 4 | 8th February 2007 05:46 PM |
| LEDs | zachtheterrible | Electronic Projects Design/Ideas/Reviews | 25 | 5th October 2004 03:41 PM |
| RGB LEDs with PWM?? | seahkw | Micro Controllers | 2 | 27th August 2004 01:30 AM |
| LEDs-Super Bright White LEDs $1.35USD ea | ssullivan777 | Datasheet/Parts Requests | 0 | 27th February 2003 02:02 AM |