HomePage/assetList/Butterfly Light
Butterfly Light
930 0
Production process

Outline

  • Project: Butterfly light
  • Purpose: Butterfly light is a touch control color-changing music light.
  • Difficulty: Middle-level
  • Time-consuming: 6-Hour
  • Maker: Guysgogo&&Microduino

Team Introduction

Guysgogo is team composed of four senior students in the maker class of LKK Intelligent Hardware Industrial Design. Three of the students—Run Jiang, Huiyu Hao, Tingyu Li and Chaohui Xie, are college students from Hebei.

Bill of Material

  • Microduino Equipment
  • Other Equipment

Document

Program download: Butterfly_light
3D model download: File:3D-Butterfly light.zip

Build 3D Model

The model adopts buttery shape.



3dm light1.jpg


Build Hardware Circuit

  • The colorful LED light adopts built-in IC control chip. With one-wire bus control, you only need one I/O port to control. Just connect the OUT interface of one Lantern to the IN interface of the other Lantern, and then join up the IN interface to Microduino core board via Sensor hub.



Light steup.jpg


  • Each touch sensor needs a Microduino I/O port to drive. We can tell if it is pressed by reading sensor values via digital port and analog port.



Touch steup.jpg


  • You can debug software after building the hardware circuit.

Prepare Audio

  • Download audio file:File:Music-Butterfly light.zip
  • Connect Microduino-Audio module with your computer via USB cable. It will show a disk named “microduino” after successful connection. Just open the disk and select audio file, then write to flash.

Software Debugging

Program Description

  • “audio.h”file is used for music play control and “key.h” file is for touch detection.
  • Audio module is connected to Serial 1 to control by default.
  • As for touch sensor pin definition, users can change according to personal needs:


int sensor_pin[7]={4,8,10,12,A0,A2,A6 };

  • The colored LED light defines seven lights, whose light control pin is D6:


#define PIN 6 Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, PIN, NEO_GRB + NEO_KHZ800);
  • How to judge the touch of seven lights & how to control music and LED lights:
  • When pressing some a button, it will play music and the white led light will blink.
  • When pressing twice one time, the white led will go on.
  • When pressing three times once, you can change the light color.
  • Anytime, one press means turning off the light.


for(int a=0;a3) sensor_vol_cache[a]=3;{ colorWipe(color[8], a);   num=a;   audio_choose(a+1); audio_play();   colorWipe(color[0], a);}   time1[a]=millis();}if(millis()-time1[a]>500&& sensor_vol_cache[a]!=0)//Just start it and delay for one second or more, and the scan is ended. {if(sensor_vol_cache[a]==1){ colorWipe(color[0], a); Serial.println("LED_OFF");}elseif(sensor_vol_cache[a]==2){ colorWipe(color[8], a);}else{ randomSeed(millis()%1000); sensor_vol[a]=random(1,7); Serial.println(""); Serial.print("num:"); Serial.print(a); Serial.print(":"); Serial.print(sensor_vol[a]);   colorWipe(color[sensor_vol[a]], a);} sensor_vol_cache[a]=0;//Return to zero and wait for the next scan.}}}

Program Download

  • Make sure you build Microduino IDE, or you can refer to:Microduino Getting start.
  • Make there is _99_LCD_NeoPixel library in IDE.
  • Open the downloaded program and select the right board to download after compiling.
  • After the download, you can test whether the function mentioned above is right or not by the Touch sensor. Meantime, you need to notice which LED light the Touch sensor corresponds to.

Overall Assembling

  • Fixate the light and the touch sensor on the outside of the 3D butterfly.



Setup 3d light01.png





Setup 3d light02.png


  • Wrap the butterfly with a beautiful exterior.



Setup 3d pagef.png


  • Fixate the loudspeaker on the base and then get it fixated with the butterfly.



Setup 3d buzzer.jpg


  • Plug in USB cable for power supply at last and have fun!



Setup 3d ok1.jpg





Setup 3d ok2.jpg


Notice

  • Since Audio adopts Serial 1 by default, please initialize Serial 1: “AUDIO_PORT.begin(9600);”
  • Please make sure the touch sensor corresponding with the lights.
Required hardware
No data
Code show
No data
Attachment download
No data
0
Chris
Asset info

Creation time:11/08/2018

Author:chris
Course recommendation
No data
Master, don't look at it silently. Please login to help me comment.

Register now