Cyber Plant – Tina Xu & Shuyan Lin – Gottfied Haider
https://drive.google.com/drive/folders/1QmscNNoQjeMJaJot4vYBzL7vK_4v7KH8?usp=share_link
For this midterm, my teammate and I decided to connect technology with nature. The project raises awareness regarding environmental protection as it is a prevalent issue. We used a real plant to give users the true experience of how humans are disrupting nature. We utilize techniques that were taught in lectures and research of our own to bring to the class a demonstration of the consequences and pressure that human activities have on the environment.
Context & Significance
My partner was the one who originally brought up the idea of using plants with Arduino as she was inspired by some creations through social media. I thought this was a great idea as I have seen plants in the IMA studio. One of the classes worked with plants which was surprising to see since IXL has such technology-based courses. Connecting the two elements: technology and nature: creates a great duality. Then again, environmental protection and global warming have been issues I’ve heard about in every form of media. We wanted to highlight its significance through this project to bring further awareness. We wanted to create our way of interpreting the effects of human activities on the environment. Interaction results in a cause and effect. It should also trigger a feeling/emotion and resonate with its users. The design requires your hand to not only touch the plant but also squeeze. We could have built a fake plant for the project, but on the real plant, it is possible to see the marks you make on the plant from squeezing too hard. The plant starts playing a nice melody with a bright green glow. With the pressure sensor triggered, the plant turns red and screeches. Depending on the amount of pressure, the light will deviate from green to values of red. We hope to motivate people to take steps to protect nature as we live in its beauty. It’s a message to everyone living on earth. We exaggerate the color and noises on the plant to dramatize the effects.
I think the uniqueness of my project when compared to other classmates is the use of a living plant. We are introducing a new element we have not experimented with in class yet. This might be a basic concept. However, we made sure to include a color-changing LED, a pressure sensor, and a speaker to elevate the experience.
Conception & Design
To make the user experience easier, I made sure to only have the circuits on one side of the board. I also hid some wires in the cotton as well to make the presentation look cleaner. We also placed the pressure sensor directly in front of the plant. The sensor’s round tip helps users to know how to press on that spot. We even added a background board that indicates which side to interact with the plant. Initially, the plant we chose, a succulent, was too small and fragile to touch repeatedly. We needed the plant to be able to be tested multiple times, so we switched to a larger leaf plant. Applying pressure to the leaf will not completely damage itself, but the succulent would have been completely squished and unusable. Additionally, at first, we wanted to insert the wires into the plant, but that was also not sustainable throughout multiple days because we would risk killing the plant before our presentation.
To enhance the presentation, we painted the boards, and added leaf carving details, and cotton to diffuse the bright LED strips. The prototype is very obviously connected to electronics, so we decided to enhance that aspect by not hiding the wires. Many groups created games, so they hid those wires well. We hope the exposure of our Arduino board and wires embellishes the intricacies of the relationship between technology and nature.
Cardboard is an easy material to manipulate, so we stuck to using it as the base of the whole project. We tested a few different sensors. We had the distance, pressure, and vibration sensor. If we had used the distance sensor, the user would not be able to touch the plant. It does not help with our concept. The vibration sensor would have been a great addition to the pressure sensor, however, after connecting and coding the sensor into Arduino, it was not sensitive enough to our liking. It was also very unreliable for performance. Adding this sensor would have risked us an unresponsive project. As a result, we unfortunately had to remove the vibration sensor altogether. The plant would have been able to detect the touch by a tap/ small movements and change the color of the LED to represent that even small disruptions to the plant can be felt. Lastly, we used an advanced speaker instead of the usual buzzers that are in our Arduino kit. We found that the original buzzers only make static sounds. The new speaker had a much clearer tone and was able to play prettier melodies. The original buzzer is better used for single tones.
List of Materials:
- Cardboard
- Cotton
- Paint
- LED strip
- Pressure sensor
- Advanced speaker
- Plant
- Wires
- Resistors
- Arduino
- Tape
MAIN CODE:
#include <FastLED.h>
#define NUM_LEDS 60
#define DATA_PIN 3
CRGB leds[NUM_LEDS];
int fsrPin = 0;
int fsrReading;
int red;
int green;
int BUZZER_PIN = 9;
int vib_pin=7;
int led_pin=13;
#include “pitch.h”
int melody[] = {
NOTE_E5, NOTE_E5, NOTE_E5,
NOTE_E5, NOTE_E5, NOTE_E5,
NOTE_E5, NOTE_G5, NOTE_C5, NOTE_D5,
NOTE_E5,
NOTE_F5, NOTE_F5, NOTE_F5, NOTE_F5,
NOTE_F5, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_E5,
NOTE_E5, NOTE_D5, NOTE_D5, NOTE_E5,
NOTE_D5, NOTE_G5
};
int durations[] = {
8, 8, 4,
8, 8, 4,
8, 8, 8, 8,
2,
8, 8, 8, 8,
8, 8, 8, 16, 16,
8, 8, 8, 8,
4, 4
};
int melody2[] = {
NOTE_E4, NOTE_F4, NOTE_G4, NOTE_E5, NOTE_C5, REST
};
int durations2[] = {
8, 8, 4, 4, 4
};
void setup() {
Serial.begin(9600);
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(150);
pinMode(BUZZER_PIN, OUTPUT);
tone(BUZZER_PIN, 100, 1000);
{
pinMode(BUZZER_PIN, OUTPUT);
pinMode(vib_pin,INPUT);
pinMode(led_pin,OUTPUT);
}
}
void loop() {
fsrReading = analogRead(fsrPin);
red = constrain(map(fsrReading, 0, 600, 0, 255), 0, 255);
green = constrain(map(fsrReading, 0, 600, 255, 0), 0, 255);
for (int i = 0; i < NUM_LEDS; i = i + 1) {
leds[i] = CRGB(red, green, 0);
FastLED.show();
delay(5);
}
if (fsrReading > 300) {
tone(BUZZER_PIN,100,1000);
} else if (fsrReading < 100) {
int size2 = sizeof(durations2) / sizeof(int);
for (int note2 = 0; note2 < size2; note2++) {
int duration2 = 1000 / durations2[note2];
tone(BUZZER_PIN, melody2[note2], duration2);
int pauseBetweenNotes2 = duration2 * 1.30;
delay(pauseBetweenNotes2);
noTone(BUZZER_PIN);
}
} else {
noTone(BUZZER_PIN);
}
int val;
val = digitalRead(vib_pin);
Serial.print(“vibration sensor: “);
Serial.println(val);
if (val == 1){
digitalWrite(led_pin,HIGH);
delay(1000);
digitalWrite(led_pin,LOW);
delay(1000);
}
else{
digitalWrite(led_pin,LOW);
}
}
PITCH CODE:
/*************************************************
* Public Constants
*************************************************/
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978
#define REST 0
Fabrication & Production
To be frank, there were many failures during the production process. The very first significant step was to set up the LED strip colors and design how we wanted the lights to move. The first challenge was connecting it to the pressure sensor. We had to write conditional statements to react to a specific pressure to change color. The second challenge was adding the speakers to change sounds according to the pressure and light. Combining the three elements into conditionals was difficult and took a long time to figure out. With the help of our lovely professors, instructors, and LA, we were able to get it right. However, in that process, we ran into another problem. Because we wanted to incorporate melodies that were perhaps 20 seconds long in total, it would not register properly into our code. The song had to completely end for the plant to react to the pressure. The nonresponsive result led us to only take the main chord which had 5 notes. Shortening the tune made sure the plant was responding and at a proper speed. Eventually, we went through a few trials and errors of reorganizing the code to control the three variables to see which was best to be made into a conditional. This process took so long that my partner and I had to switch “shifts” for who was going to stay in the studio.
Organization of code when compiling all sorts of different functions was crucial. I found that adding notes at the end of codes with // helps me to remember the functionalities of each line. For integers, it’s important to keep all the variables constant so as not to mix them up with other codes.
After the basic wiring and coding were finished, I began to decorate the mechanism. I first wrapped the pot with LED and taped it along the sides. Then, I cut out a box shape and added carvings to the sides to allow light to show through the carvings later. After gluing the box and placing the plant inside, I stuffed the remaining area with cotton. The cotton is used to diffuse the bright lights of the LED while hiding the strip. The carved-out leaf shapes were supposed to look like digital leaves because the color was being controlled by the LED. I had to make sure the pressure sensor was sitting right at the plant, as the sensor was quite short, so I had to build a platform next to the box. It allowed me to tape the Arduino and breadboard for it to look organized. Because we wanted to embrace the digital aspect of this project, the wires were not hidden. On the other hand, if we wanted the plant interaction to be between humans and plants only, we would move the background cardboard in front of all the wiring. After all the decorations, I also went ahead to improve the code. At the time, that meant trying different sensors and researching how to add different songs into code.
I think we hit most of the concerns that were mentioned during user testing. People suggested the prototype be more decorated, with more plants, more sensors, and added sounds. From the suggestions, we painted the background and carved details, brought in a bigger plant, and used a better speaker to implement sounds into the mechanism. It was very unfortunate that we could not add the vibration sensor as adding two different sensors to the plants would have been the best-case scenario. By the time we finished, we did not have time to add additional pressure sensors to the board.
Projects like these should have begun a few days in advance of the time we started. Time management is key to success. Coding and creating the aesthetics for a project like this takes a long time. We did not realize the amount of time that would be allocated to this midterm project with other midterms occurring at the same time.
Conclusion
The goal of this project was to create an interactive mechanism that connects plants, humans, and technology to light the connection between them and think about how they affect each other. Our project result aligns with the definition because it requires a human touch to activate the pressure sensor that’s attached to the plant. The sounds and lights from the plant amplify how much effect we have on the world. In the real world, the use of technology has had an immense negative impact on the environment that is caused by humans.
Our project was easy to interpret once we said it was related to environmental protection. When the code starts running, the plant is green and playing a melody. Once you touch the plant and pinch its leaf, it will change to a different sound and the color will more red in accordance with how much pressure was applied to the plant.
To improve on what we have so far, I would love to add more pressure sensors on different leaves. Additionally, I would also like to find more sensitive vibration sensors to attach to each side of the box to make it responsive to small taps and movements. Some people had trouble finding the sensor, so I would also like to make it more apparent where the user needs to touch the plant.
Throughout this whole process, I learned to be patient with coding. It truly does take time and effort to find the code, embed it, run it, and see what’s wrong or what can be improved. The main thing to remember for next time is to start the project early. Even though I know that there are many different types of add-ons for the Arduino, I didn’t know I could be using a better buzzer or sensor until I asked an LA or professor for help. They’re always there to help and want to see you succeed. In the end and after all the work, it was very satisfying because it all came together. The effort and stress finally paid off.
Appendix: (All photos and video are in this link)
https://drive.google.com/drive/folders/1QmscNNoQjeMJaJot4vYBzL7vK_4v7KH8?usp=share_link
Citation:
https://www.hibit.dev/posts/62/playing-popular-songs-with-arduino-and-a-buzzer
https://forum.arduino.cc/t/piezo-and-tone-make-screeching-noise/487365
https://forum.arduino.cc/t/controlling-led-strip-lights-with-arduino-uno/1065657/7