Rhythm Hand

Introduction: Rhythm Hand

This cyberglove is about making the right move at the right moment.

The lights are going from your arm (elbow) to your hand and when the lights arrive at your hand your have to press your fingers on the mini photocell.

If you press your hand on the mini photocell at the right moment the leds turn green. If not, the leds turn red.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Collect Materials

  • A glove
  • Fabric to make the glove longer
  • WS2812B LED strip
  • Wires
  • Arduino
  • Mini photosell

Step 2: Making Circuits

First connect the led strip to the arduino. You can do that by connecting the +5v to the 5v on the arduino. The Din has to be connected to A0 on the arduino and the GND has to be connected to the GND on the arduino.

You also have to connect the mini photocell to the arduino through connecting to the 5v wire from the led strip and from the same source connecting with a wire to PIN 6 on the arduino. The other side from the mini photocell has to be connected to the GND wire from the led strip

Step 3: Designing the Glove

The glove has to have the right size to fit the led strips. The leds have to be aligned to make more enjoyable to look at.

For this game you have to use your arm and you want to be able to move freely. This can be realised by putting the arduino on the glove. I used velcro as a fastener to stick the arduino to the glove. Then for establishing more stability you can put a rope around the glove and around the arduino.

The mini photocell has been sewed inside the glove so it will stay in place.

Lastly you have to hide the wires to make it look better. That can be done with fabric that will be sewed on top of the wires.

Step 4: Soldering

Now you can make the connecting wires from the circuit secure by soldering.

Step 5: Coding

// A basic everyday NeoPixel strip test program.

// NEOPIXEL BEST PRACTICES for most reliable operation: // - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections. // - MINIMIZE WIRING LENGTH between microcontroller board and first pixel. // - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR. // - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS // connect GROUND (-) first, then +, then data. // - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip, // a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED. // (Skipping these may work OK on your workbench but can fail in the field)

#include #ifdef __AVR__ #include // Required for 16 MHz Adafruit Trinket #endif

// Which pin on the Arduino is connected to the NeoPixels? // On a Trinket or Gemma we suggest changing this to 1: #define LED_PIN 6

// How many NeoPixels are attached to the Arduino? #define LED_COUNT 60

// Declare our NeoPixel strip object: Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800); uint32_t color = strip.Color(127,127,127); // White color, for default bool clickedCorrectly = false; // Argument 1 = Number of pixels in NeoPixel strip // Argument 2 = Arduino pin number (most are valid) // Argument 3 = Pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) // NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)

// setup() function -- runs once at startup --------------------------------

void setup() { // These lines are specifically to support the Adafruit Trinket 5V 16 MHz. // Any other board, you can remove this part (but no harm leaving it): #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif // END of Trinket-specific code.

pinMode(A0, INPUT); strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) strip.show(); // Turn OFF all pixels ASAP strip.setBrightness(10); // Set BRIGHTNESS to about 1/5 (max = 255) }

// loop() function -- runs repeatedly as long as board is on ---------------

void loop() { clickedCorrectly = theaterChaseOne(color); if (clickedCorrectly) { color = strip.Color(0,255,0); } else { color = strip.Color(255, 0, 0); } }

// Some functions of our own for creating animated effects -----------------

// Theater-marquee-style chasing lights. Pass in a color (32-bit value, // a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms) // between frames. bool theaterChaseOne(uint32_t color) { bool correct = false; bool clickedWrong = false; for (int index = 0; index < 18; index++) { //loop int value = analogRead(A0); if (value > 800) { //value light sensor if (index < 16) { //2 leds before end then you can click color = strip.Color(255,0,0); //red color leds clickedWrong = true; //clicked wrong then leds turn red } else if (!clickedWrong) { //if not wrong color = strip.Color(0,255,0); //green color leds correct = true; //clicked correct then leds turn green } } strip.clear(); strip.setPixelColor(17 - index, color); //first row led lights strip.setPixelColor(18 + index, color); //second row led lights strip.setPixelColor(53 - index, color); //third row led lights strip.show(); delay(300); } return correct; }

Be the First to Share

    Recommendations

    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    Discussions