Day, Night, Dance! – Lingwen Zhu(Amber) – Margret Minsky
CONTEXT AND SIGNIFICANCE:
The goal of our project is to visualize the normal emotions of human beings in different periods of a day, especially in day and night, while the dance part is to diversify the interaction part. I first wanted to play with shadow in this midterm project so I searched online and found a project named “Gesture Controlled Interactive Table Light“, which uses the shadow of hands to control the LED lights with the assistance of light sensor. Then I then decided with my partner together to use light as a variable in my project to control other types of interaction like light, music and movements. In my project, it is different from this project that it used opening and closing the door as a way of playing with light and I actually build this project as an entire process within a small house. In my previous research, I worked with my teammates to create a memopal which can change the messages the host left to visitors according their identities. In this project, the interaction part is mainly about the project reacts to different identities by demonstrating different messages. From reviewing this project and receiving advices from professors, I learnt that forms of interaction can be more diverse including five feelings of human beings. Therefore, I chose to add the music and dancing part into the midterm project, which diversify the interactions in this project. The target audience of my project is anyone who is interested in music and wants to find something funny.
CONCEPTION AND DESIGN:
We chose to use opening and closing the door as the very first step of interactions in our project instead of lifting the roof or putting hands on the roof because we considered that in this way it provides a more direct and natural form for interaction. We also decided to put LEDs close to the button instead of up in the window of house which can make users see them more clearly. For the materials used in the project, we choose to use cardboard to make the house and the door, which makes it easy for us to decorate it by painting colors onto it. We also choose the material of doorknob between small bottle cap and thick strings, but then we choose to use thick strings because they fit the house better than bottle cap with dark color and users can easily get the idea of opening the door while small bottle cap may make them confused. We also hesitated between using music player or buzzer to play music but finally we insisted using buzzer because it can create a retro vibe which is more relevant to the atmosphere of our entire project. Below is our original sketch.
FABRICATION AND PRODUCTION:
After I with my partner chose what to produce, we separated our parts as that she focused on building the circuit and I focused on the coding part while we would corporate making the cardboard part and connecting all parts of our project together. However, we did not separately work on our part we actually always find a schedule which suits both we two on Wechat and then we will meet at the IMA lab 826 to work together. To check whether we are able to create our project in the technical dimension, we asked professor Margret to check whether it is possible to add several servos in one circuit. We also tried using buzzers to choose different music with different feelings and emotions separately from the entire circuit in the beginning because we were not sure about whether the music played by the buzzer can feel the same way as normal music players. The sketch of our entire circuit looks like this.
After examining every part of our project can work well, we began working on building the project. I found several codes of different music played by buzzer from online sources and combine them in my code. All these codes used for loop to play music, which inspired me to explore more about for loop in arduino and I found it similar to what I learnt in another course. During coding, I also used the analogRead() to read the value of light sensor and then put different values of light sensors in if statement to trigger different movements and music. I was once confused about how to make two commands in arduino work at the same time and then I tried millis() to record the time and used exact division under the guidance of professor Rudi but it is hard for me to complete that for three commands and time schedule is tight for me. Here is the entire code of our project.
#include
#include "pitches.h"
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
int led1 = 13;
int led2 = 7;
int pushButton = 2;
int buttonState = 0;
int ldrPin = A0;
//nightmelody
#define NTC0 -1
#define NTC1 262
#define NTC2 294
#define NTC3 330
#define NTC4 350
#define NTC5 393
#define NTC6 441
#define NTC7 495
#define NTCL5 196
#define NTCL6 221
#define NTCL7 248
#define NTCH1 525
//tunes
int tune[] = {
NTC3, NTC2, NTC3, NTC6, NTC3, NTC2, NTC3, NTC7,
NTC3, NTC2, NTC3, NTCH1, NTC7, NTC5,
};
int durt[] = {
250, 250, 250, 250, 250, 250, 250, 250,
250, 250, 250, 250, 500, 500,
};
int length;
int tonepin = 8;
//daymelody
//this is adapted from the tutorial material here
//https://docs.arduino.cc/built-in-examples/digital/toneMelody
int melody1[] = {
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
};
int noteDurations1[] = {
4, 8, 8, 4, 4, 4, 4, 4
};
//dance melody
//this is adapted from the tutorial material here
//https://zhuanlan.zhihu.com/p/363576662
int itoneLen;
short melody[] = {
NOTE_G4, NOTE_G4, NOTE_A4, NOTE_G4, NOTE_E4, NOTE_G4, NOTE_C4, NOTE_C4, NOTE_D4, NOTE_C4, NOTE_A3, NOTE_G3, NOTE_A3, NOTE_A3, NOTE_G3, NOTE_A3, NOTE_C4, NOTE_D4, NOTE_C4, NOTE_D4, NOTE_E4, NOTE_G4, NOTE_A4, NOTE_G4, NOTE_E4, NOTE_D4, NOTE_G4, NOTE_G4, NOTE_A4, NOTE_G4, NOTE_E4
};
byte noteDurations[] = {
8, 16, 16, 8, 8, 2, 8, 16, 16, 8, 8, 2, 8, 16, 16, 8, 8, 8, 8, 8, 8, 16 / 3, 16, 8, 8, 2, 8, 16
};
long startTime = -1;
void setup() {
Serial.begin(9600);
servo1.attach(9);
servo2.attach(10);
servo3.attach(11);
servo4.attach(5);
pinMode(pushButton, INPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(tonepin, OUTPUT);
pinMode(ldrPin, INPUT);
}
void loop() {
//read sensor
int analogValue = analogRead(ldrPin);
Serial.print("Analog reading: ");
Serial.println(analogValue);
//read button
buttonState = digitalRead(pushButton);
//different states under different conditions
if (analogValue < 5 && buttonState == LOW) { //night
digitalWrite(13, LOW);
digitalWrite(7, LOW);
servo4.write(120);
//move arms
servo1.write(40);
servo2.write(140);
//move bg
servo3.write(180);
//nightbuzzer
length = sizeof(tune) / sizeof(tune[0]);
for (int x = 0; x < length; x++) { tone(tonepin, tune[x]); delay(durt[x]); noTone(tonepin); } } else if (analogValue > 5 && buttonState == LOW) { //day
digitalWrite(13, LOW);
digitalWrite(7, LOW);
//day move
servo4.write(40);
servo1.write(140);
servo2.write(40);
//move bg
servo3.write(0);
//daybuzzer
for (int thisNote1 = 0; thisNote1 < 8; thisNote1++) {
int noteDuration1 = 1000 / noteDurations1[thisNote1];
tone(8, melody1[thisNote1], noteDuration1);
int pauseBetweenNotes1 = noteDuration1 * 1.30;
delay(pauseBetweenNotes1);
noTone(8);
}
}
if (buttonState == HIGH) { //dance time
startTime = millis();
light();
//move
servo1.write(0);
servo2.write(0);
delay(800);
servo1.write(random(150, 300));
servo2.write(random(150, 300));
delay(800);
servo1.write(random(0, 50));
servo2.write(random(130, 180));
delay(800);
servo1.write(0);
servo2.write(0);
//dance music
music();
}
}
delay(100);
}
void light(){
digitalWrite(13, HIGH);
delay(200);
digitalWrite(13, LOW);
delay(200);
digitalWrite(7, HIGH);
delay(200);
digitalWrite(7, LOW);
delay(200);
digitalWrite(13, HIGH);
delay(200);
digitalWrite(13, LOW);
delay(200);
digitalWrite(7, HIGH);
delay(200);
digitalWrite(7, LOW);
delay(200);
}
void music(){
itoneLen = sizeof(melody) / sizeof(melody[0]);
for (int thisNote = 0; thisNote < itoneLen; thisNote++) {
int noteDuration = 1.5 * 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(8);
}
}
After hearing the suggestions from professor Rudi, I decided to make more fun with my project by adding a different face of the person. I then choose to add one more pumpkin head which can appear in day time and disappear at night by using the servo to control the moving angle of the string which connect the pumpkin head and arm of the servo together. I also tried the Neopixel to make the light become more interesting but I found that it is hard to connect them in the circuit even if I soldered it with wires. After I communicated with other students who also used Neopixel in their project, I found that the one I borrowed from ER is different from what they bought online and that can be connected into the circuit easily. But the time is limited so I gave up using Neopixel. During the User Testing Session, we found that it is difficult for users to lifting the roof of the house up because they may be afraid that it can damage the house, then we choose to use opening and closing the door as a way of controlling the amounts of light which comes in. We also found that it is hard to fix the background which shows the different periods of a day so we decided to put it in the front of the house which looks like a small clock and make the entire project more likely to a Cuckoo clock. Then it will be hard to compose the wires and breadboard and arduino in the house so I drew another sketch below to rearrange the entire project.
After changing the outlook of the house, it is easier for users to interact with the project in the presentation. The final outlook is as below shows.
CONCLUSIONS:
The goal of our project is to visualize the normal emotions of human beings in different periods of a day, especially in day and night, while the dance part is to diversify the interaction part. This project actually reflects how human’s emotions are influenced by the time which is based on an interesting online buzz word “emo” in China which is frequently used by people online to express that they are feeling sad and the time they posted this word is normally at midnights. My project successfully created an atmosphere that how a person react to different time periods by making use of the music and movements like below.
However, if I could have more time, I will make the movements and the music play together by using millis() and change the led lights to Neopixel which will be surrounded by the roof of the house. I have also learnt that when I need to manage large numbers of wires together and extend them for a long distance, I can twist the wires for one object like for a LED which has two wires connected to can be twisted together to make it easy for building the circuit.