Light switch module mounted on wall. Heat-sink used for 5V voltage regulator.
Light switch module mounted on wall. Heat-sink used for 5V voltage regulator.

I used to have a very small apartment, and in that apartment I made a lot of the LED lights myself. To make it easier to control and power them I also built this electronic light switch. With a voltage regulator, and large heat-sink, it took 9 to 24 volts in; and gave out four channels of 5 volts. I used dual-color red and green LEDs to show the state of each output, and push-buttons to toggle them. After 10 seconds on inactivity the LEDs would turn off. The maximum load pr. channel were 500mA, not a lot but enough to drive some LEDs.

Table of content

Details

Junction box for LED lights.
Junction box for LED lights.

Power to the module was provided with a power jack at the bottom, and the outputs and signals through a 9 pin d-sub plug. I used a multicore cable down to a junction box, and from there to all the different LED lights. This did leave me with a lot of cables going to all the different lights, but I was single and didn’t really care.

The unit had a “lights out” input that turned all the outputs off. This allowed some external controller or service to turn off the lights when I left or went to bed. But the lights could only be turned back on using the push-buttons.

Using relays the electronic switch module could of course be used to control all kinds of stuff. But I built it to control and power the LED lights listed below.

Lights

I used this unit to power and control three lights:

Two white and one UV LED in self-made LED uplight.
Two white and one UV LED in self-made LED uplight.

Two channels were used for four dual color LEDs. One channel for the white lights, and one for the colored.

A green LED in a flower pot, shining green light on the plant.
A green LED in a flower pot, shining green light on the plant.

A green LED in the pot of my tiny Bonsai tree.

A powerful LED mounted in a small plastic case, used as downlight in a window post.
A powerful LED mounted in a small plastic case, used as downlight in a window post.

And two LED dot lights mounted in the window frame of my living room window.

I/O

Inputs

  1. PA.0 Push button 1
  2. PA.1 Push button 2
  3. PD.0 Push button 3
  4. PD.1 Push button 4
  5. PD.2 Signal to turn all lights off

Outputs

Status LED

  1. PB.0 LED 1 green
  2. PB.1 LED 1 red
  3. PB.2 LED 2 green
  4. PB.3 LED 2 red
  5. PB.4 LED 3 green
  6. PB.5 LED 3 red
  7. PB.6 LED 4 green
  8. PB.7 LED 4 red

LED light outputs

  1. PD.3 LED light output 1
  2. PD.4 LED light output 2
  3. PD.5 LED light output 3
  4. PD.6 LED light output 4

D-Sub 9-pin

  1. LED light output 1
  2. LED light output 2
  3. LED light output 3
  4. LED light output 4
  5. Lights out signal, 0V (optocoupler)
  6. Lights out signal, 12V (optocoupler)
  7. Constant 0V out
  8. Constant 5V out

Please leave a comment or tweet if you have any questions or feedback on this project.

Schematic drawing

Schematic drawing for electronic light switch; with AVR ATtiny2313.
Schematic drawing for electronic light switch; with AVR ATtiny2313.

Source code

AVR-Electronic-switch-4-channels

Electronic switch for LED lights, 4 channels, written with BASCOM-AVR. Last pushed 2 weeks ago.

Master Releases


0 0 0 v1.0 Visual Basic

Image gallery

Parts list

Project: Electronic switch with 4 channels and voltage regulator by Thomas Jensen is licensed under CC BY-SA 4.0 with attribution required.

Similar projects


  •   Created Feb 10, 2007
  •   Last modified 4 days ago
  •   Project status: Completed

Comments