Project tutorial

An Owl with Light up Eyes

To get my entry pass to our #Seeed10 Annual Party, I weaved out an owl that has two huge light up eyes as my light-up project.

  • 308 views
  • 0 comments
  • 3 respects

Components and supplies

Necessary tools and machines

Cotton Strings
Scissors
Wooden beads

Apps and online services

About this project

Project Inspiration

It has been a tradition for us at Seeed to make a light up project to get our entry pass to our annual party. It sounds not so good, but I do personally love this "rule" as it always pushes me to think and make something.

For this year's annual party, we have an extract daytime internal workshops to celebrate our 10th anniversary (Yeah, Seeed is 10 now!). I've signed up to lead one of the workshop to teach other Seeeders knotting macrame owls.

Then I can't stop thinking to combine this lovely owl with some tech, and making it lighting up. Kill two birds with one stone, why not?However, the creative process cost me much time, and then someday came quite suddenly an idea when I was checking a new product: Grove - RGB LED Ring. To make two ring lighting up eyes for the owl could be very interesting. And then my journey of making took off again!

Final Demonstration

Demo video

Steps to Build the Project

Step 1: Define the fancy lighting up

Most owls are nocturnal, meaning they are most active at night and they could see well in the dark. To emphasize this, I wanted to have different shining patterns for the lighting up eyes, and it would be nice if I could change the patterns through a button press.

Step 2: Proof of concept

The only product that I would definitely use is the Grove Led Ring. And it became the entry point for me to think about how it might work. So I went to the Wiki page, and I found something exctractly that I was looking for: using Seeeduino and Button to control the LED Ring.

2.1 So I got the first product list based on the Wiki Documentation as follow:

1. 1x Seeedunio, that I couldn't find so I replaced it with an Arduino Uno

2. 1x Base Shiled, it enables me with many grove connectors

3. 2x Grove Led Ring, which will the shining eyes

4. 1x Grove Button, which allows me to have different possibilities of lighting patterns

2.2 I wired these parts together as follow:

2.3 As there were two led rings, so I changed a bit in the original code in Arduino IDE as follow (mainly definite one more pin for the extra led ring):

Code in the attachment

2.4 I was super excited when downloading the code to the Arduino Uno. So far so good. However when I pressed the Button, only one of the ring could sync to the switch while the other one was lighted up with two of the pixels. I had no idea at all why it was not working. Frustrated:(

2.5 Debugging by checking the code, I think I did it over 5 times ( I even got my colleagues Anson and Kay at x.factory involved to help, thank you!). But w just couldn't find the right way. So I turned to the tech support team for help. They offered an entry-level solution for me, to add one more component called Grove I2C Hub to connect the two rings and the base shield.

2.6 Re-wiring with the I2C Hub, and it worked!

Step 3: The eyes should look good as well

The Led rings look quite good actually, but I wanted them to be more cohesive with the whole macrame owl. So I made a full set of Reverse Larks Head Knots to the rings to make them look better.

Finishing the eyes knotting, I attached the two rings to the macrame owl body.

Step 4: How to make the electronics invisible

Apart from the led rings, I had to deal with other 4 components to make them as invisible as I could. Again for the whole harmonious look.

4.1 Optimize the electronics

I realized that there was still possibility to optimize some of the electronics: A single Seeeduino Lotus could work fun for the combination of the Arduino Uno & Base Shield. The size of whole parts would be smaller, which would do me a huge favor in make the electronics invisible.

4.2 Knotting the owl from 2D to 3D

Although the components turned smaller, I still need to figure out to how to make "hide" the components with macrame knots. As the owl was in 2D, it could be cool if I could turn it into a 3D bag, and I could put all the components and power bank into the bag. And this was how it turned out:

Step 5: Wear it, light it up and party up

Video by Rain

Code

An Owl with Light up Eyes.inoArduino
Contribution from Seeed Wiki Page: http://wiki.seeedstudio.com/Grove-LED_ring/
// This is a demonstration on how to use an input device to trigger changes on your neo pixels.
// You should wire a momentary push button to connect from ground to a digital IO pin.  When you
// press the button it will change to a new pixel animation.  Note that you need to press the
// button once to start the first animation!

#include "Adafruit_NeoPixel.h"

#define BUTTON_PIN   2    // Digital IO pin connected to the button.  This will be
                          // driven with a pull-up resistor so the switch should
                          // pull the pin to ground momentarily.  On a high -> low
                          // transition the button press logic will execute.

#define PIXEL_PIN    6    // Digital IO pin connected to the NeoPixels.

#define PIXEL_COUNT 20

// Parameter 1 = number of pixels in strip,  neopixel stick has 8
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_RGB     Pixels are wired for RGB bitstream
//   NEO_GRB     Pixels are wired for GRB bitstream, correct for neopixel stick
//   NEO_KHZ400  400 KHz bitstream (e.g. FLORA pixels)
//   NEO_KHZ800  800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);

bool oldState = HIGH;
int showType = 0;

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  strip.setBrightness(255);
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  // Get current button state.
  bool newState = digitalRead(BUTTON_PIN);

  // Check if state changed from high to low (button press).
  if (newState == LOW && oldState == HIGH) {
    // Short delay to debounce button.
    delay(20);
    // Check if button is still low after debounce.
    newState = digitalRead(BUTTON_PIN);
    if (newState == LOW) {
      showType++;
      if (showType > 9)
        showType=0;
      startShow(showType);
    }
  }

  // Set the last button state to the old state.
  oldState = newState;
}

void startShow(int i) {
  switch(i){
    case 0: colorWipe(strip.Color(0, 0, 0), 50);    // Black/off
            break;
    case 1: colorWipe(strip.Color(255, 0, 0), 50);  // Red
            break;
    case 2: colorWipe(strip.Color(0, 255, 0), 50);  // Green
            break;
    case 3: colorWipe(strip.Color(0, 0, 255), 50);  // Blue
            break;
    case 4: theaterChase(strip.Color(127, 127, 127), 50); // White
            break;
    case 5: theaterChase(strip.Color(127,   0,   0), 50); // Red
            break;
    case 6: theaterChase(strip.Color(  0,   0, 127), 50); // Blue
            break;
    case 7: rainbow(20);
            break;
    case 8: rainbowCycle(20);
            break;
    case 9: theaterChaseRainbow(50);
            break;
  }
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
    strip.show();
    delay(wait);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
  for (int j=0; j<10; j++) {  //do 10 cycles of chasing
    for (int q=0; q < 3; q++) {
      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, c);    //turn every third pixel on
      }
      strip.show();

      delay(wait);

      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}

//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
  for (int j=0; j < 256; j++) {     // cycle all 256 colors in the wheel
    for (int q=0; q < 3; q++) {
      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, Wheel( (i+j) % 255));    //turn every third pixel on
      }
      strip.show();

      delay(wait);

      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

Comments

Similar projects you might like

Controlling LED light intensity using smartphone light senso

Project tutorial by Nikola Travis

  • 2,031 views
  • 0 comments
  • 3 respects

Arduino Traffic Light Simulator

Project tutorial by Zachary Haslam

  • 8,842 views
  • 1 comment
  • 25 respects

Traffic Light Information System

Project tutorial by Joppe Smeets and Pieter Luyten

  • 19,041 views
  • 26 comments
  • 41 respects

The Traffic Light

Project tutorial by Tech with Matthew

  • 4,361 views
  • 5 comments
  • 19 respects

Motion Activated Night Light

Project tutorial by Haziq Afandi

  • 3,538 views
  • 0 comments
  • 4 respects

Magic Eyes

Project tutorial by Ayush Aggarwal

  • 815 views
  • 0 comments
  • 3 respects
Add projectSign up / Login