Introduction: Arduino Touch-point Light Drum
If you're looking for a simple arduino based project for a beginner then look no further! I'm going to show you how to make a Touch-point activated "light drum", which will consist of 6 flashing LEDs, an analog switch, and 2 conductive Touch-points that allow the human body to manually influence functionality.
Step 1: Step1: Parts
You will need:
- 1 Arduino Uno
- 1 Solderless Breadboard
- 6 LEDs (5mm preferred)
- I used two sets of red, green, and blue but you can change this to your liking
- 7 220 Ohm resistors
- Wire & Wire Stripper/Cutter
- Use jumper wire if available for connecting the arduino and breadboard
- 1 analog dipswitch (any amount of switches on the component will do, all you need is one for this project)
- 1 A/B USB cable
- w/ a USB wall plug (I used my Samsung adaptive phone charger which can have an output of either 5v or 9v)
- 2 touchpoints (any conductive metal/material)
- 1 Soldering iron and a length of Solder
Step 2: Step 2: Plan
I wanted to make my first arduino project use light in some way, but without any prior experience I wanted to make something simple to construct and dynamic to interact with. Luckily I found a perfect solution in the Arduino Built-in Examples, which can be accessed from here, or if you're using the Arduino Sketch program it's located under file-->examples. The two main functions we'll be utilizing is the "ForLoopIteration" and "Analog Input" examples. The "ForLoopIteration" will provide the basic code, with some additional inputs for the switch and touchpoints.
The code is as follows:
int timer = 100; // The higher the number, the slower the timing.
const int sensorPin = 12;int sensorState = 0;
void setup() { // use a for loop to initialize each pin as an output: for (int thisPin = 2; thisPin < 8; thisPin++) { pinMode(thisPin, OUTPUT); } pinMode(sensorPin, INPUT);
}
void loop() {
// loop from the lowest pin to the highest: for (int thisPin = 2; thisPin < 8; thisPin++) { // turn the pin on:
sensorState = digitalRead(sensorPin);
if (sensorState == HIGH) {
digitalWrite(thisPin, HIGH); delay(timer); // turn the pin off: digitalWrite(thisPin, LOW); } else { digitalWrite(thisPin, LOW); }
}
// loop from the highest pin to the lowest: for (int thisPin = 7; thisPin >= 2; thisPin--) { // turn the pin on:
sensorState = digitalRead(sensorPin);
if (sensorState == HIGH) {
digitalWrite(thisPin, HIGH); delay(timer); // turn the pin off: digitalWrite(thisPin, LOW); } else { digitalWrite(thisPin, LOW); }
} }
Step 3: Step 3: Connect
Now it's time to put all of our components together! First lets layout the breadboard. Just follow image provided*, and the wires are color co-ordinated except for the red LED wires and the 5v red wire. Once it is fully set up, upload the code onto your arduino and test it. If it doesn't work then check your wire connections and make sure the code is verified by the arduino sketch program. What should happen is the LED's will turn on/off in timed procession of each other on a loop, and touching the touch points at the same time should turn the lights off entirely.
*In the breadboard layout, the grey and brown wires are connected to a "touch sensor" but for this project we'll instead attach a conductive touch-point to each wire end.
Step 4: Step 4: Construct
This is an extra step that entirely up for reinterpretation, as is the rest of this Instructable. I made the Drum part of this out of a cardboard hatbox with a 13in diameter (In hindsight this could be scaled down exponentially). I cut 3 holes from the lid, and molded the "domes" out of translucent vellum with modge podge adhesive. Cut additional holes for the switch, A/B power cord, and two holes for the touch-points.
Step 5: Step 5: Jam Out
Turn off the lights, turn up the noise, and drum along to rhythm!