Mood light (RBG) with 100 mA outputs

From StdOut
This page is kept for historical interest. It may document projects or methods that are obsolete and/or no longer relevant. The information here is not kept up-to-date.

I've later built a bigger and better mood light and controller.
Testing mood light circuit

Nine LEDs, three of each color (red, green and blue) is mounted in the bottom of a ice glass. The LEDs are soldered onto a PCB that lies at the bottom and point upwards, illuminating the entire glass. A AVR device controls the LEDs using PWM, this gives the option of regulating the intensity of the LEDs and fade between colors.

With four DIL-switches one can control how the light should behave:

  1. Pause between color change (long/short)
  2. Fade speed when changing color (long/short)
  3. Color change fade (on/off)
  4. Color mode (one color/multi color)

Video

This video is also available on YouTube.

I/O

Inputs

  1. PD.0 DIP-Switch 1
  2. PD.1 DIP-Switch 2
  3. PD.2 DIP-Switch 3
  4. PD.3 DIP-Switch 4

Outputs

  1. PB.1 (OC1A) Red LED
  2. PB.2 (OC1B) Green LED
  3. PB.3 (OC2) Blue LED

LEDs

Mood-light-rgb-connector-4nmm9q.png

Source code

Git-alt-brands.svg
Bascom-AVR source is available in a git repository:
https://github.com/thomasjsn/AVR-Mood-light-1

Gallery

Schematic drawing

Mood-light-controller-circuit-r4d164.png

Parts list

Qty. Part
1 × AVR ATmega8-16PU, DIL-28, 16 MHz, 23 I/Os
1 × Capacitor, aluminium electrolytic, 10 µF, 25V
2 × Capacitor, aluminium electrolytic, 47 µF, 25V
1 × Capacitor, ceramic, 1 nF, 100V
1 × DIL socket, 28-pin, 7.62mm
1 × Diode, rectifier, 1 A, 400V, 1N4004
1 × Enclosure, plastic (1591), 100x50x25mm
1 × Fuse 5x20 mm, 400 mA, fast-acting
1 × Fuse holder, open, PCB, 5x20mm
3 × LED 5mm clear, Blue, 4.9V, 20mA, 350mcd, 12°
3 × LED 5mm clear, Green, 2.1V, 20mA, 385mcd, 6°
3 × LED 5mm clear, Red, 2.0V, 20mA, 140mcd, 6°
1 × Power jack, panel, 2.1mm, plastic housing
10 × Resistor, carbon film, 0.25W, 330 Ω, 5%
4 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
4 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
3 × Resistor, metal film, 0.6W, 1 kΩ, 1%
4 × Rubber foot, adhesive, SJ-5012, Ø 12.7x3.5 mm
1 × Switch, DIP, PCB, 4-pin
1 × Terminal block, pluggable, 3.5 mm, 4-pin screw female
1 × Terminal block, pluggable, 3.5 mm, 4-pin vertical male
3 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B
1 × Voltage regulator +5V, 1 A, 7805PI

Resources