Wen & Baoqi & Karen Final Project Idea

Idea 1:

The driver’s driving state is sensed by the wearable muscle electric induction module sensor, and the atomizing device that activates the steering wheel releases the corresponding gas when abnormal data is detected, prompting the driver to fatigue driving state.

Sketch of idea 1

idea 2:

Bionic plant which is able to sense a certain animal’s/plant’s population, and information collected is shared with biological research/environmental protection organizations to help scientists to better control/protect different biological species.

Sketch for Idea2

idea 3:

Kindergarten safety wall: when the motion sensor in the kindergarten’s classroom detects the intense movement in a classroom, the room’s wall will be inflated to make it soft so that kids will not get injured when they bump into the wall. (this idea can also be applied to any other sharp furniture)

Sketch for idea3

“Lumos” Magical Wand – Wen’s Halloween Costume

Final Photos and Video

How does the wand work?

Process Photo and Video

  1. Bread Board Prototype
Try Different Vibration Sensors on Bread Board
Solder the successful wiring to the Gemma Board

2. Attached Components to the Wand

Sketches and Inspiration Photo

Sketches
Inspiration Photo

List of Materials and Tools Used

Solder set, Gemma Board, Bread Board, LED, Wires, Wire Cutters, Wood Sticks, Tapes, Hot Guns, Hot Glue, Fabrics.

Circuit Diagram

Code

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT_PULLUP);
Serial.begin(9600);
}

void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == LOW) {
// turn LED on:
digitalWrite(ledPin, HIGH);
Serial.println(“switch has been triggered”);
delay(5000);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
//Serial.println(“switch has been off”);
}
}

My Thinking

It was a very interesting experience making a wand that can simulate the special effect in the Harry Potter Movies, I just need to wave the wand, the LED will light up, which is very similar to the “Lumos” spell in the movies. If i can make it the next time, i will make a 3D printing LED diffusor so that the light will diffuse wider so the effect will be more beautiful.

And if it is possible, i will try to use 3d printed mold to cast a resin wand, which is able to hide everything perfectly.

Wen’s Halloween Costume Working Progress

I tried to build a circuit and write the code, but it just wont work even if i tried two different vibration sensors. So i decided to continue to work on this tomorrow with the teacher.

Code:

const int buttonPin = 2;
const int ledPin = 0;


int ledState = HIGH;
int buttonState;
int lastButtonState = LOW;


unsigned long lastDebounceTime = 0;
unsigned long debounceDelay = 50;

void setup() {
pinMode(buttonPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);


digitalWrite(ledPin, ledState);
}

void loop() {

int reading = digitalRead(buttonPin);


if (reading != lastButtonState) {
lastDebounceTime = millis();
}

if ((millis() – lastDebounceTime) > debounceDelay) {

if (reading != buttonState) {
  buttonState = reading;


  if (buttonState == HIGH) {
    ledState = !ledState;
  }
}

}
digitalWrite(ledPin, ledState);
lastButtonState = reading;
}

Video

Without the circuit, it is hard to make the wand, since the wires should be attached to the body of the wand.

Magical Wand (“Lumos”!)

Inspiration

“Lumos” is a spell in Harry Potter movies which is able to light up wizards’ wands.

My wand designs

How does is work?

I’m planning to use a vibration sensor or an accelerometer as my input, and have light patterns as the output. The electronics portion will be hid in the sleeves. With the vibration sensor, the wand will light up when i wave the wand, which is similar to the spell “lumos” in the movies.

I will try to use chopstick as the core, and use blue foam, hot glue to add patterns and more details on the wand.

Wen’s Arduino Exercise Week5

Motor Circuit

NeoPixel circuit

My Code of NeoPixel Circuit

include

define PIN 6

define NUM_LEDS 4

define BRIGHTNESS 5


Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRBW + NEO_KHZ800);

void setup() {

strip.setBrightness(BRIGHTNESS);
strip.begin();
strip.show();
}

void loop() {
colorWipe(strip.Color(0, 0, 255), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(0, 0, 0, 255), 50); // White

pulseWhite(10);

}
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 pulseWhite(uint8_t wait) {
for(int j = 0; j < 256 ; j++){
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, strip.Color(0,0,0, j ) );
}
delay(wait);
strip.show();
}

for(int j = 255; j >= 0 ; j–){
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, strip.Color(0,0,255, j ) );
}
delay(wait);
strip.show();
}
}
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 – WheelPos;
if(WheelPos < 85) {
return strip.Color(255 – WheelPos * 3, 0, WheelPos * 3,0);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 – WheelPos * 3,0);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 – WheelPos * 3, 0,0);
}

uint8_t red(uint32_t c) {
return (c >> 8);
}
uint8_t green(uint32_t c) {
return (c >> 16);
}
uint8_t blue(uint32_t c) {
return (c);
}

“Mid-Autumn” Plush Nightlight

Night Light’s Story and Target Users

In China, the Mid-Autumn festival symbolizes the family reunion and family reunion, and on this day, all families will appreciate the moon in the evening, because it is the 15th day of the eighth month of the lunar calendar, when the moon is at its fullest. In Chinese culture, the full moon represents family reunion. Besides, there is a beautiful myth about the Mid-Autumn festival, that is Chang ‘e flying to the moon.

This year’s Mid-Autumn Festival is the first time I have not been with my family. So this is a crippled moon and represents my missing for my hometown and my family. I hope that this design will allow all the wanderers who are unable to reunite with their families in a foreign country to feel this miss. At the same time, they can also let them drive away the loneliness in the dark nights.

“Mid-Autumn”

Process

Circuit Diagram

Wen’s Arduino Homework 2

#1 Digital Input

#2 The Serial Monitor

#3 Analog Input

#4 Two buttons control one LED (on and off)

Code:

// constants won’t change. They’re used here to set pin numbers:
const int onbutton = 2; // the number of the pushbutton pin
const int offbutton = 3;
const int LED = 13; // the number of the LED pin

// variables will change:
int whatisit = 0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(LED, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(onbutton, INPUT);
pinMode(offbutton, INPUT);
}

void loop() {
// read the state of the pushbutton value:
whatisit = digitalRead(onbutton);
if (whatisit == 0) {
// turn LED on:
digitalWrite(LED, HIGH);
}

whatisit = digitalRead(offbutton);
if (whatisit == 0) {
digitalWrite(LED, LOW);}
}