Graceless tinkering


Tear it apart. Make it better. Fail!

Lighting controller

An Arduino UNO based lighting controller for an interactive exhibition.

Context

A while back a buddy of mine called me and asked me wether it is possible to programatically dim the lights in a room. You see, he had an aquaintance who wanted to control several lights in an exhibition on a per-minute basis for a whole week. The exhibition is somewhere in Austria so all planning had to be done via email.

I started thinking about phase cutting, solid state relays and optocouplers, maybe throw in an ESP8266 for controlling everything! Boy, was I wrong.

But, apparently I've been living under a rock! When I got the specs of the exhibition hall I was in awe! The technology gap is pretty big! The whole exhibition was already wired with a KNX/EIB bus. Naturally, I was cringing at the thought I would have to build an Arduino-KNX bridge without having any KNX devices to test on.

Everything worked out better than expected. The guys in Austria could provision the exhibition with an analog input for KNX [german/pdf] which can be programmed to accept a 5V analog input.

Design and development

By now I was leaning towards designing a small device able to fit inside the electrical panel and function autonomously. The Arduino UNO seemed a like good choice for the project. The 32KByte flash would be able to accomodate seven days worth of lighting values. The 7 * 24 * 60 = 10080 values would use up 20160 bytes, leaving plenty of space for the rest of the program.

I also wanted the device to have an LCD (2x16) in order to make it easy to operate. A quick shopping spree on farnell.com supplied be set me with everything I needed to get started, or so I thought. I completely forgot that the Arduino has no analog out pins (only PWM pins). I could have strapped a low-pass filter to one of the PWM pins, but decided however to spare no expense and buy a 6€ MCP4725 Breakout Board from a local supplyer (after all I was dealing with Austrians here).

To sum it all up, the lighting controller consists of an Arduino UNO, a 2x16 LCD, a MCP4725 DAC, three push buttons and a screw terminal for easy connection to the KNX module. Below are the wiring diagrams in schematic and breadboard view.

And here are some pictures from the actual build.

Software

The software development part went along pretty fast. The LCD used a Hitachi HD44780 comatible driver so the Arduino LiquidCrystal library worked like a charm. The MCP4725 was actually came from Adafruit, which are known for their high quality open source libraries, so no problem there!

While operating, the main screen shows the current day of the week and time. So far the menu allows you to set the time(and day of the week) as well as manually selecting an output value.

You can find the source code for the controller here. I will come back and polish it a bit later.

Enclosure

I decided against building a complete enclosure and opted for making a simple backplate. I made the backplate out of a thin laminate board I had lying around.

And now...

This project is pretty much wrapped up. Sometimes in the near future I'll try to post several software related aspects. But for now here are some press releases regarding the actual exhibition. Check them out here [german] and here [romanian].