diy

DIY LED Strip Controller

On a whim I decided to add LED lighting to my desk hutch. I already had a reel of LED strips but nothing to control them. As I wanted to build a controller that afternoon, I constructed it from parts which could be purchased locally. The controller I made has an on/off switch and two knobs: one to control the brightness and the other to control the color of the lights. Here is how I built it!

This project required the following parts: two 10K ohm potentiometers with knobs, an on/off switch, a project box, a 5 volt power supply, a power jack, some wire, and a small Arduino compatible microcontroller. RadioShack sells the Arduino Micro, but I used a Teensy 2.0 I had on hand as it is a much cheaper alternative. Of course, you also need some programmable LED strips. I used some 5 volt WS2812B LED strips (similar to Adafruit’s NeoPixel strips). It’s also useful but not required to have some connectors for the LED strips so that they can be detached from the controller. I used some JST connectors from my project stash.

The first step is to make holes in the project box. I did this with my trusty Dremel. Drill five holes: two for the potentiometers, one for the power switch, one for the power jack and a one for where the LED strip wires will enter the project box. Once the box is drilled out, place the power switch, potentiometers and power jack into the project box. Solder the power wires to the components.

IMG_9702

Next, I assembled the LED strips. If you are adding connectors to the LED strips, solder those on to the strips. If you’re connecting multiple strips, be sure that you bundle the wires together properly. I’ve found that using colored wire or marking wires with different colors of tape makes it easier to keep everything straight.

IMG_9722

Next, solder the potentiometers and LED strips. Mark the data lines for the LED strip and the potentiometers so you know which wire corresponds to a given component. It makes coding the microcontroller easier.

IMG_9761

Next, solder the microcontroller.  Keep track of the pins and their corresponding data lines. When soldering the potentiomenter to the microcontroller, make sure to connect the potentiometer data wire to pins that can support the analogRead function. These pins generally begin with the letter ‘A’.

IMG_9767

Now it’s time to program the microcontroller. The simple code can be found here. Update the code to reflect the length of your LED strip and the pins that correspond to your components. Be sure to test everything!

IMG_9771

Once you’ve verified that everything works, tape up any solder joints so that there are no shorts. Close up the box and you’re done!

IMG_9772

DIY Night Vision Camera

I found this Instructable about how to make your own night vision camera. It seemed to be a fun project, so I decided to give it a try.

The first step is to remove the infrared (IR) filter from the camera. I broke my first camera attempting to do this. I was far more careful with my second one and successfully removed the filter. The little blue chip is the IR filter:

IMG_5319

This is how the photos look with the IR filter removed:

P1010003
Kitty is not impressed.

After successfully removing the filter, the next step was to build an IR LED array to be used as a light for the camera. With a little bit of help, I was able to laser cut a perfect array of holes for the LEDs. Following the instructions, I assembled the LED array and turned it on, only to be disappointed by an incredibly dim light.

What went wrong? Here’s the point where I confess that I am relatively new to electronics, and so there are certain lessons that are yet to be learned.  I wired the LEDs incorrectly. I got a second batch and wired them together.

IMG_8372

And still the array was too dim. It was time to really understand how the circuit of the array worked. There was something more at play here. I found a really cool LED array calculator online that helped me get to the bottom of my problem. I had to examine the LEDs more closely. The instructions use infrared LEDs from Radio Shack, which have a 940 nm wavelength, a 100 mA forward current and a 1.28 volt forward voltage. My first two attempts used LEDs that had a forward voltage of 1.5 volts, which meant that the LEDs were not getting enough power. I ordered a new set of IR LEDs with a lower forward voltage of 1.2 volts and assembled the array for the third time.

IMG_8378

The third attempt was better. With the new array, I was able to capture photos in the dark!

A hand in the dark

 I did a little test to get a feel for how well the camera worked. First, I set up a small scene to photograph. I was interested to see how the camera could capture color and detail. Here is the control photo, taken with my normal camera:

Control Photo

First, I took a photo with the lights on. The room was somewhat dark, so the photo did not come out very clear:

Lights on

Next, I took a photo with the lights off, about one foot away from the objects. The detail was still somewhat clear, although differentiating colors was not really possible.

P1010082

The second photo was taken from two feet away. At this point, some objects are no longer visible.

Two feet

The final photo was taken from three feet away. The objects are almost imperceptible at this point.

P1010079

Although it was fun to build this, it isn’t very practical for real-world use. The major problem seems to be the power, as the 9 volt battery drains very quickly and is not strong enough to power many high-power infrared LEDs. If I go back to this project, the first step would be to build an array with a larger power supply and brighter LEDs. In the interim, I will just have to be content with taking nighttime pictures of things up close.