HOW-TO: Fancy Room Lighting Control Panel

Hey!

This post will show you how I made a control panel that has three 12 volt power output ports which can be controlled with knobs at the front. I will be connecting the lighting in my basement to the three outputs, so that it can be controlled through the panel.

The panel has a nice and ambient light pulsation when it’s passive, and when you turn the knobs, the internal light indicates how much the knob is turned, with a separate color for each knob.

Even though I am no expert, merely a beginning hobbyist, I will assume that you have some basic knowledge of electronics (more specifically, how a mosfet works). If not, this is a good resource: https://www.youtube.com/watch?v=o4_NeqlJgOs

Video below, written text tutorial follows!

 

Step 1: Overview

Here’s a list of the resources I have used. I have linked to a search where relevant, but for instance the 12 volt power supply is something I found on my “old electronics” shelf. There are many different variations of power supplies, and many might work, but for me it had to be something that looked subtle, or that could easily be hidden or covered up, as it would be on the wall. It also has to deliver a decent amount of current, depending on how much light it will be supplying power to.

Supply list:
Arduino Nano: http://goo.gl/ltyX2M
Potentiometer: http://goo.gl/RnmVWj
Knobs: http://goo.gl/VftEsk
Mosfet: http://goo.gl/BnON8z
Voltage step-down: http://goo.gl/6Q1ScO
RGB LED-strip: http://goo.gl/GDIoMA
Button: http://goo.gl/aKWRMQ
Female power connector: http://goo.gl/jP5O3E

Wood
Acrylic glass
Wood glue
Metal angle fitting
Screws

Tools used:
Soldering iron & station
Table saw
Contour saw (can use hacksaw instead)
Wood clamps

 

Step 2: Perf board & mosfets

Perf board & mosfets
vlcsnap-2016-08-30-09h01m23s200.pngvlcsnap-2016-08-30-09h01m56s868.pngvlcsnap-2016-08-30-09h01m46s270.png

As I didn’t have a large enough perf board, I used two separate perf boards which I joined together by putting the Arduino in the middle. At the picture you can see that I soldered the Arduino directly to the perf board, which is not ideal. When it broke later I soldered on some female to male heder pins instead, so that I could take the Arduino in and out effortlessly.

Next thing I did was to attach four mosfets in line next to each other to the perf board. The mosfet is what will switch on and off the power outputs, and can do PWM dimming (PWM vs Potentiometer) for the light. The observant reader will understand that we need one mosfet for each power output, and ask why I used four, when I initially said it will have three power outputs. The answer to this is that I thought I would be using the fourth mosfet internally with the button. I haven’t done that yet, but I still might. If you’re following my design, feel free to only use three mosfets, or to add a fourth power output.

Step 3: Creating a common ground

Creating a common ground
vlcsnap-2016-08-30-09h03m35s485.pngvlcsnap-2016-08-30-09h03m43s404.png
vlcsnap-2016-08-30-09h04m08s100.pngvlcsnap-2016-08-30-09h04m34s842.pngvlcsnap-2016-08-30-09h04m57s497.png

The ground of the Arduino and the ground of the power supply needs to be tied together, as I understood it when I did the research for this project. I don’t have deep enough understanding of the electronics to comment on why, but If anyone could give a more thorough explanation that would be welcome.

To achieve this, I used the wire from some resistors (as I didn’t have any other thin uninsolated wire) to create a line of wire running parallel with the mosfets, with some spacing between. From now on I will refer to this wire as the common ground.

Then I connected every source port of the mosfet to the common ground we created before. Now four wires, one from each mosfet, should connect to the common ground cable.

Finally I drew a regular cable from the GND pin of the Arduino, to the exposed common ground wire.

Step 4: Mosfet to Arduino

Mosfet to Arduino

To be able to control the mosfet from the Arduino, we have to be able to deliver a small current to the mosfet, which will tell it to open. This current goes to the gate pin, and connects to an available pin that can be written to on the Arduino. This has to be done for all four mosfets, and all of the mosfets needs to connect their gate to a separate arduino pin. So in total: four different wires, going from four different mosfet gates, going to four different pins on the arduino.

Step 5: Prepare for power

Prepare for powervlcsnap-2016-08-30-09h06m23s035.png

In this step we’ll prepare the external electronics units, as the power connectors and the potentiometers which the knobs will attach to. We can’t connect it right to the Arduino yet, as it has to go through our wood frame, and we haven’t made that yet.

So we solder a black wire for negative to the long pin of the power connector, and a red one for postive to the shorter pin, which should be right in most cases. To make it a little sturdier, I covered the connector with some appropriate sized shrinking tube. I made four of these as well: 1 for input power (connects to our power supply), and 3 for output power (connects to our appliances which we want to control, e.g. lighting). Just prepare them, and put them away for later use.

Step 6: Potentiometers!

Potentiometers!
vlcsnap-2016-08-30-09h06m57s974.pngvlcsnap-2016-08-30-09h07m05s583.png
vlcsnap-2016-08-30-09h07m46s059.pngvlcsnap-2016-08-30-09h07m36s898.pngvlcsnap-2016-08-30-09h07m55s400.png

Surprisingly enough, we’ll use four potentiometers as well. These are prepared the following way:

Negative wire to leftmost pin, goes to Arduino ground.
Positive wire to rightmost pin, goes to Arduino 5v output.
Middle wire (signal wire), goes to an analog Arduino pin (any analog input).

Now the potentiometer, which is a variable resistor, decreases the voltage that goes to the analog input pin when it is turned. When we read the value later from the analog input in the code, it will map the voltage value to a value between 0 (low) and 1023 (high), which we can make use of.

Step 7: Assembling an acceptable frame

Assembling an acceptable frame
vlcsnap-2016-08-30-09h08m13s786.pngvlcsnap-2016-08-30-09h08m18s737.png
vlcsnap-2016-08-30-09h08m22s214.pngvlcsnap-2016-08-30-09h08m30s384.pngvlcsnap-2016-08-30-09h08m34s093.png

As a programmer and computer engineer, I am a relative beginner to both electronics and woodworking, I don’t expect to be able to produce perfect results – neither give the best advice on the subjects. But what I definitely can and will advice you to do, is to try new things out and not be afraid to fail. If the outcome is not the most perfect, it doesn’t matter, what matters is that you’re doing it, and it’s going to take you somewhere!

I began the frame – or the box if you will, by cutting out some wooden pieces with equal width. Using a router, I made an indentation in the wood right next to the edge, which was as deep into the wood as my acrylic glass was thick (about half a cm, 0.2 inches). This is to make the acrylic lie flush with the wood later, to make a nice and flat surface.

I cut 2 equally sized short pieces of wood using the miter saw on a 45 degree angle, and then I did the same with 2 equally sized longer pieces of wood. Make sure that the mitered edge is so that the shortest side of the wooden pieces will be the one facing inwards, else they can’t join together to form a rectangle.

By using wood glue, many clamps, and some time, these should form a nice looking frame in the end.

Step 8: Contours

Contours
vlcsnap-2016-08-30-09h09m09s597.pngvlcsnap-2016-08-30-09h09m28s893.png
vlcsnap-2016-08-30-09h09m49s935.pngvlcsnap-2016-08-30-09h09m56s014.png

Using the contour saw, I cut out out a piece of wood that was exactly the size of the inner edges of the box, so the piece would slide in. I was a little rough with the saw, so I used a file to grind it down a little bit. I am going to use this a socket to mount the final panel on, so the fit better be snug.

Furthermore I measured the length and width of the routed out edges at the front. This is the size my acrylic glass would be, and hence the front of the panel. Using the contour saw again, I cut it out, and crossed my fingers it would fit.

Step 9: Holes and paint!

Holes and paint!
vlcsnap-2016-08-30-09h10m47s132.pngvlcsnap-2016-08-30-09h10m52s365.png
vlcsnap-2016-08-30-09h11m06s202.pngvlcsnap-2016-08-30-09h11m18s813.pngvlcsnap-2016-08-30-09h13m07s528.png

This step is very simple, we want to drill holes to stick our potentiometers through. So plan out how you want to arrange your knobs and buttons, then mark it, and drill holes. To not crack the acrylic, I suggest starting out with a thin drill bit, and then increasing the size. I had to use a really large one in the end, as the thread on the potentiometer didn’t get through the thick acrylic glass. I drilled a hole wide enough for the screw to fit in. Luckily the knob will cover this up later.

vlcsnap-2016-08-30-09h13m21s535.png

Lastly, I removed the plastic protection on the acrylic glass on the backside, and spray painted it white. This might not be needed if you are able to get your hands on some opaque acrylic.

 

Step 10: More holes, stain & power again

More holes, stain & power again
vlcsnap-2016-08-30-09h11m49s034.pngvlcsnap-2016-08-30-09h13m26s673.pngvlcsnap-2016-08-30-09h13m56s800.png

Next I planned out where my power connectors would go. For my setup, the most practical will be to have them going out the top. If it’s possible I believe going from the bottom would have been a more subtle solution. I wanted to separate the input connector from the output connectors, so I ended up with three holes on one side, and one on the other.

I found some nice stain in the garage, and rubbed it on with a piece of cloth, before I threaded the power connectors we made earlier through the holes we just drilled. If they’re hanging loosely in there, it might be a good idea to apply some hot glue on the inside. For me it was a tight fit, and I really had to use some force to get them in so I think mine will be fine without any glue.

Step 11: Last part of electronics

Last part of electronics
vlcsnap-2016-08-30-09h14m45s398.pngvlcsnap-2016-08-30-09h15m06s593.png
vlcsnap-2016-08-30-09h15m29s929.pngvlcsnap-2016-08-30-09h15m37s422.pngvlcsnap-2016-08-30-09h16m11s992.png

For the input power connector: connect the negative to the common ground, then connect the positive wire to something where several wires can attach to it. I just selected an empty spot on the perf board, and used solder bridges to connect to it later.

For all the output power connectors: Connect the positive wire to the positive wire from the input power connector, then connect the negative wire to the drainof the mosfet.

To power the arduino we need to step the voltage down from 12 volt to 5 volt. Using a multimeter I turned the tiny variable resistor on the voltage step down board until the output part was 5 volts with a 12 volt input. I connected the inpositive & negative on the voltage step down board to the positive and negative wire of the input connector, and then I hooked up the out part of the step down board with the VIN and GND pins on the Arduino.

vlcsnap-2016-08-30-09h19m50s990.png

By loading in some code, connecting a 12 volt power source to input, and a LED-panel to one of the output, I could verify that it was actually working.

Not on the first try though.

Step 12: I mean, this is the last electronics part

I mean, this is the last electronics part
vlcsnap-2016-08-30-09h20m05s586.pngvlcsnap-2016-08-30-09h20m19s556.pngvlcsnap-2016-08-30-09h20m13s213.png

To make the box a little fancier, I attached some RGB LED-strip all the way around the edge of the box, just below where the acrylic would sit. The positive and negative wires goes to 5v out and GND pins on the Arduino respectively, while the signal attached to any available digital pin on the Arduno. This way we can control it with the Arduino. Personally I am a big fan of the FastLED library.

The observant reader will also notice that I need some practice in cable management. Cough!

Step 13: Finishing up!

Finishing up!
vlcsnap-2016-08-30-09h20m52s165.pngvlcsnap-2016-08-30-09h20m59s972.png
vlcsnap-2016-08-30-09h21m06s299.pngvlcsnap-2016-08-30-09h21m28s904.png

Alright, we’re close now.

I fetched the acrylics, because with the time I spent fiddling with the electronics the paint had tried several times already. I removed the protective film on the front side, then pushed the potentiometers through, and tightened the nut around the screw, so it would stick in place. Then I pushed on the Aluminium knobs, and put the acrylic on top of the box. The acrylic had a snug fit here as well, and would stay well in place. Personally, I like to be able to take it off easily so I wont glue it to the frame or anything, but if you’re worried some silicone around the edges would probably keep it safe.

Lastly, I drilled the wooden socket to the wall, and then pushed the whole panel firmly in place on top of it.

Final message to observant reader: You might notice I left out talking about the button. Well, that’s because I never found a use for it. I attached it to 12 volt so that it lights up blue, but I haven’t really given it a function yet. (the 4th mosfet was initially there to be able to control the LED light on this button). It looks cool though.

Step 14: Why it’s cool

Why it's cool
vlcsnap-2016-08-31-07h03m55s617.pngvlcsnap-2016-08-30-09h22m05s904.png
vlcsnap-2016-08-30-09h21m52s412.pngvlcsnap-2016-08-30-09h21m55s549.pngvlcsnap-2016-08-30-09h22m01s135.png

I like this a lot because the light control is centralized and digital. Which means I anytime can extend the functionality, and make it controlled by another interface. Also I am a sucker for LED lights, and I love how the light on the backside of the panel will change color and gradually wrap itself around the box, following how much and in which direction you turn the potentiometer. Basically working as an indicator to when light is off, when it’s full, and when it’s half-dimmed. The box itself also has a certain aesthetic appeal, and when it left alone (no knobs turned) for about 5 seconds, it will start a light pulse. Blue if any of the potentiometers are turned in an on position, and orange if all the potentiometers are turned all the way down.

Here is a link to my github and the code I wrote for this. I will not comment it here, but if you have any questions about it (e.g. you are trying to use it, but you don’t understand / can’t get it to work) I promise I will help you out if you contact me. Having that said, I really encourage you to try to write something cool on your own!

I know this was a long one, if you’re still reading this, I want to say thank you and to tell you to stick with us here and on YouTube for more content!

Until next time,
Hansi, Natural Nerd

Leave a Reply

Your email address will not be published.

*