Take with plant-Azena-Inmi
INDIVIDUAL REFLECTION:
Even begin to write this blog really need a lot of courage, this project is so complex that take us three nights to finish it all. And I even one day sleep in the safe at eight floor for that. From design to make the circuit to code, every step we meet so much obstacle, so it is really encourage that we final success to build this over project device!
- CONTEXT AND SIGNIFICANCE
- My previous performance is about using the tech to directly express human’s emotion by painting color or sparkling light. So this time I also use sparkling light but with many different methods to show the situation of the plant.
- The Wave in the last doc remind me that not all the interactive device need human as the initiative role. And in my project the plant, which can not talk and move with the help of the this machine and become the initiative one while the human need to give the reaction. What’s more, the Recreational Machine with sparkling light, yelling cartoon characters and sound give me idea to mix the image, light, sound and movements together.
- The most special part of my device is list on the last question.
- Actually, at first we want to build a smart pot which can help you water( and water in a correct amount) which I know it is already exist, but under the suggestion of the professor we find out that it is quite impossible to build that as a interactive freshmen, so we give it up.
- of course this “wave flower reminder” is for those people who always forget to water the flowers. And also I think it will attract those people who want to make the process of watering the plant more active and interactive with their speechless friends.
- CONCEPTION AND DESIGN:
- At first I was quite worry about if my device is not interactive enough, but when I saw the classmates water the plant and surprise about the change, I felt that even our project is not connect to a social problem, it is interactive. It can’t change quickly because it is plant who take the initial part, slow it is our speechless friends lifestyle, you can’t regard the slow as not interactive enough.
- material: one normal blank board and two small one; three LED light in different color; countless color papers, cardboard; a pair of speaker; a SD card reader; a mp3 sensor; a Moisture Sensor; an Infrared Distance Sensor; an Arduino; countless wires; two servos.
- I choose them because I want to build a system including the vision , audio, and motion, and they will change according to the static from Moisture Sensor. And the Infrared Distance Sensor under the suggestion from the user test that we do not want it to disturb us all day, just remind us when we came close to them.
- About how to make the audio system, the professor and the fellow give us a lot of scheme, using many different material but at last we build this kind of device.
FABRICATION AND PRODUCTION:
- The significant part and of course the hardest part in our project is coding. I even have no idea how to start the first coding. The first code (about light) with the help of a kind boy’s help.
int sensorPin = A0;int sensorValue = 0;void setup() {Serial.begin(9600);}void loop() {// read the value from the sensor:sensorValue = analogRead(sensorPin);Serial.print(“Moisture = ” );Serial.println(sensorValue);delay(1000);}void setup() {pinMode(9, OUTPUT);}void loop() {sensorValue = analogRead(0);if(sensorValue>200){analogWrite(2, 200);} else if (sensorValue<200 && sensorValue>40) {analogWrite(4, 200);} else {analogWrite(6,200);}
Then I struggle myself to write the servos’ code into it.
nt sensorPin = A0;int sensorValue = 0;#include <Servo.h>Servo myservo1;Servo myservo2;int pos = 0;void setup() {myservo1.attach(9);myservo2.attach(11);Serial.begin(9600);pinMode(2,OUTPUT);pinMode(4,OUTPUT);pinMode(6,OUTPUT);}void loop() {sensorValue = analogRead(sensorPin);Serial.print(“Moisture = ” );Serial.println(sensorValue);sensorValue = analogRead(0);if(sensorValue>200){analogWrite(2, 200);for (pos = 0; pos <= 180; pos += 1) {myservo1.write(pos);delay(15);}for (pos = 180; pos >= 0; pos -= 1) {myservo1.write(pos);delay(15);}} else if (sensorValue<200 && sensorValue>100) {analogWrite(4, 200);} else {analogWrite(6,200);for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees// in steps of 1 degreemyservo2.write(pos); // tell servo to go to position in variable ‘pos’delay(15); // waits 15ms for the servo to reach the position}for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degreesmyservo2.write(pos); // tell servo to go to position in variable ‘pos’delay(15); // waits 15ms for the servo to reach the position}}delay(1000);}After that we add the distance sensor’s code and the audio code. Though hearing quite easy but it taken most of our time and the code is in an incredible length. #include <SoftwareSerial.h>
#define PIR_MOTION_SENSOR 8 //Use pin 2 to receive the signal from the module
#define pin A5#define LED 13// this LED will light up when the sensor detects movement
int sensorPin = A0;
int sensorValue = 0;
#include <Servo.h>
#include <SoftwareSerial.h>Servo myservo1;
Servo myservo2;int pos = 0;
//int num = random(1, 12);
int num = 1;SoftwareSerial mp3(2, 3); // modify this with the connector you are using.
boolean someoneThere = false;
boolean someoneWasThere = false;
void setup() {myservo1.attach(9);
myservo2.attach(11);
Serial.begin(9600);pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(6, OUTPUT);mp3.begin(9600);
Serial.begin(9600);
delay(100);
if (true == SetPlayMode(0x00))
Serial.println(“Set The Play Mode to 0x00, Single Loop Mode.”);
else
Serial.println(“Playmode Set Error”);
PauseOnOffCurrentMusic();
randomSeed(analogRead(0));
pinMode(PIR_MOTION_SENSOR, INPUT);
pinMode(LED, OUTPUT);
SetVolume(0x1F);}
void loop() {
sensorValue = analogRead(A0);
Serial.print(“Moisture = ” );
Serial.println(sensorValue);sensorValue = analogRead(0);
if (isPeopleDetected()) { //if it detects the moving people?
digitalWrite(LED, HIGH);
// someone there is now true
someoneThere = true;
Serial.println(num);
SetMusicPlay(00, (uint8_t) num);
delay(3000); // this delay is for the MP3 file
} else {
someoneThere = false;
someoneWasThere = false;
// Serial.println(“no one”);
digitalWrite(LED, LOW);
//PauseOnOffCurrentMusic();
}
if (someoneThere == true && someoneThere != someoneWasThere) {
Serial.println(“someone is there!”);
someoneWasThere = true;
}
}
//Set the music index to play, the index is decided by the input sequence
//of the music;
//hbyte: the high byte of the index;
//lbyte: the low byte of the index;
boolean SetMusicPlay(uint8_t hbyte, uint8_t lbyte)
{
mp3.write(0x7E);
mp3.write(0x04);
mp3.write(0xA0);
mp3.write(hbyte);
mp3.write(lbyte);
mp3.write(0x7E);
delay(10);
while (mp3.available())
{
if (0xA0 == mp3.read())
return true;
else
return false;
}
}
// Pause on/off the current music
boolean PauseOnOffCurrentMusic(void)
{
mp3.write(0x7E);
mp3.write(0x02);
mp3.write(0xA3);
mp3.write(0x7E);
delay(10);
while (mp3.available())
{
if (0xA3 == mp3.read())
return true;
else
return false;
}
}
//Set the volume, the range is 0x00 to 0x1F
boolean SetVolume(uint8_t volume)
{
mp3.write(0x7E);
mp3.write(0x03);
mp3.write(0xA7);
mp3.write(volume);
mp3.write(0x7E);
delay(10);
while (mp3.available())
{
if (0xA7 == mp3.read())
return true;
else
return false;
}
}
boolean SetPlayMode(uint8_t playmode)
{
if (((playmode == 0x00) | (playmode == 0x01) | (playmode == 0x02) | (playmode == 0x03)) == false)
{
Serial.println(“PlayMode Parameter Error! “);
return false;
}
mp3.write(0x7E);
mp3.write(0x03);
mp3.write(0xA9);
mp3.write(playmode);
mp3.write(0x7E);
delay(10);
while (mp3.available())
{
if (0xA9 == mp3.read())
return true;
else
return false;
}
}
//return distance (cm)
double get_IR (uint16_t value) {
if (value < 16) value = 16;
return 2076.0 / (value – 11.0);
}/***************************************************************
Function: Detect whether anyone moves in it’s detecting range
Return:-boolean, true is someone detected.*/
boolean isPeopleDetected() {
uint16_t value = analogRead (pin);
double distance = get_IR (value);
int moistureSensor = analogRead(A0); //moistureSerial.println(distance);
int sensorValue = digitalRead(PIR_MOTION_SENSOR);//put here the value of the moisture sensor
//if (sensorValue == HIGH) //if the sensor value is HIGH?
if (distance < 50 && moistureSensor > 620) {
analogWrite(5, 200);
analogWrite(4, 0);
analogWrite(6, 0);
for (pos = 0; pos <= 180; pos += 1) {
myservo1.write(pos);
delay(15);
}
for (pos = 90; pos >= 0; pos -= 1) {
myservo1.write(pos);
delay(15);
}
num = 2;
return true;//yes,return true} else if (distance < 50 && moistureSensor < 590) {
analogWrite(6, 200);
analogWrite(5, 0);
analogWrite(4, 0);
for (pos = 0; pos <= 180; pos += 1) {
myservo2.write(pos);
delay(15);
}
for (pos = 90; pos >= 0; pos -= 1) {
myservo2.write(pos);
delay(15);
}
num = 1;
return true;//yes,return true} else if (distance < 50 && moistureSensor < 620 && moistureSensor > 590) {
analogWrite(4, 200);
analogWrite(5, 0);
analogWrite(6, 0);} else {
}
return false;//no,return false} During coding many time I want to give it up, but thanks to my partner, she really did s good job in it. What’s more the 3D-printer was also drive me crazy, we fail four time to print the first piece, and we have grind the piece so long time to get them fit each other.
- We receive mane useful advice in the user test, like make a lighter hand, add an Infrared Distance Sensor. THat’s all really helpful.
- CONCLUSIONS:
- This project take the plants’ situation-the humidness as its input, the electricity waves in the circuit as the processing, the showing on the light , sound and motion as the output. This device approximately get my exception.
- To improve that, I hold I can make it more steady to support and size of the pot while itself can smaller and delicate.
- This experiment taught me that though it might looks impossible to realize you idea I the first step, but all the object in the world is a continuums, just try every effort on the next step and you will finally make it.
- from
to
-