# Interactive LED Programmable Canvas

54,636

690

27

Published

## Introduction: Interactive LED Programmable Canvas

The Aim of this project was to go one step further with the custom canvas'. It cost a bit more but the potential is much greater for this design

## Step 1: Theory

White LED Resistor Calcs

Vce = 0.3V @150mA

LED Voltage Drop = 3.2V @ 20mA

Vcc = 9V

9-0.3-3.2 = 5.5V -> 5.5/0.02 = 275R ~ 300R

****************************************************************************

Potential Divider to base of transistor

Ic = 20mA, BETA of 100

Ib = 20/100 = 0.2mA

Voltage divider on base needs 20 times 0.2mA = 20x0.2 = 4mA

Vin from Arduino = 3V3 and Vbe = 0.8 for 2N2222

3.3/0.004 = 825

Vout = Vin * R2/(R1+R2)

0.8 = 3.3 * R1/(1100)

R1 = 825*(0.8/3.3) = 200 (had a 200R resistor)

R2 = 825-200 = 625 (i didn't have a resister closer than 1K, still works)

****************************************************************************

Photodiode Calcs and Understanding

A photo diode works by changing the amount of current that it draws as the light increases and decreases.
The more light that it takes in the more current it will draw. As the current increases so does the voltage potential across it which is measured by the microcontroller through an ADC.

Resistor Calculation

LED Voltage Drop = 3 - 3.4V (I used 3V)

Current Draw = 20mA

R = V/I where V = 9-3 and I = 0.02

R = 6/0.02 = 300ohm

## Step 2: Parts List

I will be posting the progress i make on here, all of the mistakes, and the breakthroughs.

To start, here is a list of the items that i have purchased with links.

10x IR LEDs (http://www.ebay.co.uk/itm/110990614547)

The Canvas’ (http://www.artoncanvasdirect2you.co.uk/large-4-panel-multi-set-new-york-city-bridge-black-and-white-canvas-pictures-modern-home-decor-wall-4386-p.asp)

5x Photo Diode (http://www.ebay.co.uk/itm/PHOTODIODE-IR-FILTERED-Part-SFH203-FA-/271226770549?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item3f26601475)

Leonardo Pro Micro ATmega32U4 Arduino (http://www.ebay.co.uk/itm/231331757565)

1x White Bundle of Wire (http://www.ebay.co.uk/itm/10m-Bundle-7-0-2-Stranded-Wire-11-colours-Cable-Reel-Electronics-Arduino-Hookup-/151418997574?pt=UK_BOI_Electrical_Components_Supplies_ET&var=&hash=item2341468b46)

4 x Diffused White 3mm LED (25 pack) (http://www.adafruit.com/products/778#tutorials)

9V battery from any random store

## Step 3: Testing

The first stage of testing was to see what kind of signal the sensor was outputting in this arrangement. The output from the sensors is a negative value because of the way the sensors are wired with their anode down to 0V. As an object gets closer to the sensor the value becomes less and less. To test this, code was developed to read the sensor and display it on the terminal screen on the computer (i used putty).

The next stage was to write some code to turn the LED (which at this point was a green LED because i didn't have the white ones yet) On/Off with the swipe of a hand. this can be seen in video 1.

The next test was to make the LED fade in and out with distance. this can be seen in video 2/

The next stage of testing was to test one white LED with a transistor and the battery. The code used in the video was the same as the fading code, only the electronics changed.

The final stage of testing of testing was to test multiple LEDs controlled by multiple sensors. I did this (as shown in the pictures above) with 4 transistors, 8 IR LEDs and 4 White LEDs. The outputs of the sensors go to A0-A4 of the Arduino, the IR LEDs are wired in pairs to digital pins on the Arduino and the base of the transistors are wired to 4 PWM pins on the Arduino. The video shows the full array of settings that i have programmed.

Settings:

1 - Twinkle

3 - On/Off

4 - Reaction Game

The video shows me using the Leonardo to control the LEDs. It must be noted that the code did change slightly from the Mega to the Leonardo because i used the timerOne library in the game code on the Mega and it worked fine. On the Leonardo, the timerOne function caused issues with the PWM pins so i had to resort to using a different method in the game code.

## Step 4: Building

Step 1.

Select where the LEDs will be coming through the canvas and cut + shapes with a scalpel in those places. Remember the holes for the two IR LEDs and the Sensor. I placed them at the bottom of the canvas.

Step 2.

Get a piece of cardboard (i used a piece from a rigid envelope) and lay the canvas with the holes face down on it. Proceed to mark where the holes are on the cardboard by pushing a pencil through the holes and drawing on the cardboard.

Step 3.

Cut holes in the cardboard where the markings are.

Step 4.

Push LEDs through the holes in the cardboard and orientate them so all the anodes are pointing in the same direction.

Step 5.

Wire all the LEDs in parallel with 300ohm resistors between the anode and the 9V supply. Then wire all the cathode pins together. Wire the 1Mohm resistor to the anode of the Photodiode and wire the anodes of the IR LEDs together and the cathodes of the IR LEDs together. Also, solder the resistors in the correct configuration to the transistor base and connect its collector pin to the cathode of one of the LEDs.

Step 6.

Remve the components from the cardboard and push them through the holes in the canvas. Repeat for each canvas if you have multiple

Step 7.

If you have multiple canvas' (like me), fix the canvas' together by some means, i used thin pieces of wood nailed into the frame (shown in the picture).

Step 8.

Wire the canvas' together. The anodes of the white LEDs need to be connected together and the common ground needs to be created from the emitter of the transistor. This ground also needs to be connected to the Photodiode and the cathode of the IR LEDs.

Step 9.

Choose a position for the Microcontroller to sit in the canvas frame. Solder wires to the base resistor of the transistors, to the anode of the IR LEDs and to the anode pin of the Photodiode (not after the resistor, before),making sure that the wires can reach the relevant pins on the Arduino.

Step 10.

Connect the wires to the relative Arduino pins (tip: label the wires when you connect them) and connect the battery clip to the 9V line and ground. Make sure to connect a 9V wire and ground wire to the Arduino via the Vin or Vcc pin and GND pin respectively.

Tips:

It is easier to do steps 8-10 when the components are in the canvas because the wires can be flimsy.

Test each set of LEDs individually by applying 9V to the resistor end and cathode of the LEDs. This will find any dud LEDs, wrong orientations or bad solder joints.

## Step 5: Final Product

Here it is and here's the video of it working. The battery holder with switch broke so i had to resort to a simple clip where i have to remove the battery to turn it off.

There is two codes attached, game 1 and game 2. Game 1 has one game programmed in which is the reaction game. Game 2 has 2 game, the reaction game and a memory game.

Grand Prize in the
Make it Glow!

## Recommendations

• ### Arduino Class

69,087 Enrolled

• ### Woodworking Contest

We have a be nice policy.

## Questions

Im a pretty new to electronics, so what is the sensor used here? Is it the photo diode, ir leds or a whole different part? Thanks!

where to put this sensor?

2 replies

i was going to use it to switch power but it cant take 9V so some extra circuitry would be needed to use it

thanks! Very nice!

Woooooow. Just wow!

do you have the link of that image ?,

I made a similar device using an electron atom as my canvas picture. Where ever I had to connect a component to an off the board item, such as a LED I used a wire wrap tool and # 30 gauge wire. My canvas used 96 red LED's. I avoided any over heating with my soldering and also made replacement easier if needed. It worked quite well and helped my progress speeding along.

can it be made using arduino uno?

2 replies

The arduino Pro Mini (328 5v) is functionally equivalent to the Uno, and is stamp size.

yes, but you have to make sure it will fit in the canvas, that is why i used a very small arduino.

How long is the 9v battery lasting?

I see lots of potential for other effects/triggers. For example, use proximity sensor to activate the lights. Have a random light effect (fading, flashing, twinkle, etc) when someone comes near.

Lights in building windows random switch on/off, independent of bridge lights.

Also, if use low cost ultrasonic sensors (HC-SR04) you can get further distance detection (near 10+ feet).

Even add sounds effects (low volume) such as traffic/horns simulation.

Have random light effects come on at random times to create non-triggered effects.

I'd probably go with DC wall wart dedicated power so you can expand on abilities.

I can't believe no has commented on this yet. First off great job! That looks super entertaining and I have not anything like that so it would definitely entertain guest. Great Work!

Wow the effect is gorgeous!

4 replies

thanks, any ideas for other cool games or effects?

Could be a game controller ala Family Feud. Two people stand in front of different sections of the canvas. A question is given then the side lights up that is waved across first. The slower person's side is locked out and doesn't light.

However this could result in people slapping the canvas in their excitement.

maybe you can use RGB LED's ?

to make (almost) all the possible colors :D

it is something i thought about but i decided to keep the theme of the canvas (black and white). for my next project i will definatly consider tri-colour LEDs

This is awesome. I am curious to see what would happen if you cut out all the white spaces (laser cutter maybe? and then put a diffuser and some LEDs behind it, as it seems odd to me that only some of the lights in the picture actually work.