Mood light (RGB) controller with 500mA outputs

From CaveLab
Mood light controller v1.1

The mood light controller can control all kinds of RGB light, max 500mA pr. channel. The module has no voltage regulator and therefore needs 5V=. It has two color modes: one and multi color. One color means that one color is stable at the time, this gives three colors. Multi color has two stable color at the time, and this gives six colors (red, yellow, green, cyan, blue and purple). The module is powerful enough to run Prolight LEDs.

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)

I/O

Inputs

  1. PC.2 DIP-Switch 1
  2. PC.3 DIP-Switch 2
  3. PC.4 DIP-Switch 3
  4. PC.5 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-2

Gallery

Schematic drawing

Mood-light-controller-circuit-d4w0yg.png

Parts list

Qty. Part
1 × AVR ATmega8-16PU, DIL-28, 16 MHz, 23 I/Os
1 × Cable tie mount, screw, 5.1 mm, White
1 × Capacitor, aluminium electrolytic, 10 µF, 25V
1 × Capacitor, aluminium electrolytic, 22 µ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, 800 mA, fast-acting
1 × Fuse holder, open, PCB, 5x20mm
1 × Fuse holder, open, PCB, Protective cover
32 cm2 PCB, stripboard, 100x160mm, 160cm2
1 × Power jack, panel, 2.1mm, plastic housing
4 × 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%
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 vertical male
3 × Transistor, NPN, 800 mA, 45V, 0.625W, BC337-25