Light Display With Stroke Sensor and Arduino

by DuyenL4 in Circuits > Art

5374 Views, 67 Favorites, 0 Comments

Light Display With Stroke Sensor and Arduino

IMG_5099.JPG

This is a light display controlled by an Arduino and a stroke sensor. When the stroke sensor is activated, the brightness of the displays can change accordingly.

Prepare the Materials

IMG_5091.JPG

For this project, you will need:

Two Neopixel LED Strips

One Arduino UNO

Two 18x24 Acrylic Sheets

One 18x24 1/8" Craft Ply Wood

Conductive Threads

Non-Conductive Threads

Felt

Jumper wires

Solder iron and soldering wire

Wood glue

Laser Cut the Wood & Acrylic Sheets

IMG_5089.JPG
Laser__Artboard01.jpg
Laser_-02.jpg
Laser_-03.jpg

Use the template to laser cut (template 1) the wood and acrylic sheets (template 2 and 3). You can change the patterns on the sheet to match your style.

Install the LED Strips

FullSizeRender 5.jpg
IMG_5203.JPG

Cut the LED Strips into 11 strips of 5 LEDs.

Line them up on the board. The position of these LEDs should match the position of the slits on the top panel. You can use a marker to draw out where you should put the LED.

Solder the ends of the strips together. Color code the wires to make it easier to debug later.

Construct Stroke Sensor

IMG_5207.JPG
IMG_5208.JPG

Cut the felt (either by hand or a laser cutter) to fit the top wooden panel.

Sew the conductive thread and non-conductive threads together to make a stroke sensor. Follow an in-depth tutorial on how to make a stroke sensor here.

Connect All the Pieces Together

IMG_5209.JPG
IMG_5096.JPG

Link the stroke sensors and the LEDs strips to the Arduino.

Open Arduino and install the FastLED library:

1. Click here to download the FastLED library.

2. You should have a .zip folder in your Downloads folderUnzip the .zip folder and you should get FastLED-master folder

3. Rename your folder from FastLED-master to FastLED

4. Move the FastLED folder to your Arduino IDE installation libraries folderFinally, re-open your Arduino IDE

Install the below code to the Arduino:

#include "FastLED.h"

// How many leds in your strip? #define NUM_LEDS 55

// For led chips like Neopixels, which have a data line, ground, and power, you just // need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock, // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN #define DATA_PIN 5 #define CLOCK_PIN 13 int x=100; int y=200; boolean control=true;

int sensorPin=A0; int sensorValue=0;

// Define the array of leds CRGB leds[NUM_LEDS];

void setup() { // Uncomment/edit one of the following lines for your LEDs arrangement. FastLED.addLeds(leds, NUM_LEDS); pinMode(sensorPin,INPUT); pinMode(DATA_PIN, OUTPUT); }

void loop() { sensorValue = analogRead(sensorPin); for (int i=0; i<56;i++) { leds[i]=CRGB::Blue; FastLED.setBrightness(sensorValue); FastLED.show(); } }

Enjoy!

Computational Crafts Midterm