RGB LED experiment Arduino


Posted on Feb 6, 2014

This evening as I came home from a paragliding appointment, I had a feeling that I must improve my yesterday-written RGB LED driver code. So I cleaned it up a bit, and wrote a lot of comments to make it more useful for educational purposes. I`m alredy over this level, but it`s fun to play with it. An RGB LED is just three LEDs in a single package:


RGB LED experiment Arduino
Click here to download the full size of the above Circuit.

red, green and blue, from here comes the TLA. If you have no RGB LEDs currently, you can replace it with a red, a green and a blue LED. For a good result, the LEDs` (visible) brightnesses have to be similar. The idea is, that from the three basic  colors (r, g, b) a lot of colors (but not all) can be mixed. This mixing is performed by three individual PWM signal applied by the AVR controller on the Arduino board. See more about PWM at. I think the whole thing is very simple, but it looks nice, and you can experiment with the generation of different waveforms. Try to modify the code to use a harmonic (sine) function as input for the lightness. For more advanced users: avoid the built-in sin() function, but produce sinusoidal output. Hint: arrays This video may not be as exciting as the previous one (see here ) because my phone`s camera is unable to capture the fine changes in the color of the LED. It seems much more better in reality, so you really must build one. The other side of the breadboard (and the rest of the parts)is used in another project and it`s not connected to the board now. I was just too lazy to disassemble it. This doesn`t need explanation. Just connect your RGB LED to the Arduino board in series with three 560 © resistors as you can see on the figure above. (200 © is fine too these resistors define the current which flows through the LEDs. The current cannot exceed 50mA (each), as it could damage the...




Leave Comment

characters left:

Related Circuits

  • New Circuits

    .

     


    Popular Circuits

    Hi-Fi Headphone Amplifier
    RIAA Phono Equaliser
    IR Encoder/Decoder with PIC12C508
    Square-wave-pulse-extractor
    LED Hat Display with Pong using an Arduino
    Nokia 7610 MMC Corrupt Problem Picture Help
    pH Sensors LMP91200 Schematic Diagram
    Oatley K272 JAN 6418 Valve (Tube) Preamplifier / Headphone Amp Kit
    op amp Reducing noise in audio circuit (optical pickup + op amp)
    Can a Hartley Oscillator be built using Fixed Inductors
    rear wheel tachometer
    High-Quality Stax Headphone Adapter
    How To Build An Anti-Hijack Vehicle Alarm
    BA5173 produced by multi-function lamp dimmer



    Top