The first concept for this letter was to be fully covered by plants and have two hidden speakers so the letter next to it, the E could react to it.
We realized that the speakers did not make much sense so we moved to a bluetooth speaker and place it in the other letter.
Trying to emulate the movement of the plants with the wind I used a FSR sensor that detects the pressure and servo motors to move the flowers attached to them. After some testing, Casper gave us the idea to add different speeds, so depending on how many force you apply to it the servo motors can go either fast or slow.
The FSRs are resistors that changes its resistive value (in ohms Ω) depending on how much it is pressed. These sensors ate low cost and easy to use but they're not accurate. They also vary some from sensor to sensor perhaps 10%. That is why later in the code I use ranges of response instead of fixed values.
Size: 12.5mm diameter active area by 0.5mm thick.
Resistance range: Infinite/open circuit (no pressure), 100KΩ (light pressure) to 200Ω (max. pressure).
Force range: 0 to 100 Newtons applied evenly over the surface area.
It is wired to the board in one pin directly to the 5v and the other pin splits to the ground with a 10kΩ resistor and another wire to the A0.
The servo motors are Reely S-0270 MG, all of them are wired to PWM (Pulse Width Modulation) pins for the arduino to be able to send an analog output from a digital signal.
Wiring
One of the biggest problems during this process was adding more than one servo to the arduino, I coded one of them but when adding more they did not work. Lately when all the wiring was done and we added an adapter every servo motor had enough power and work.
Arduino code
// Adding the Servo library
#include <Servo.h>
// The four servors beign used
Servo myservo;
Servo myservo2;
Servo myservo3;
Servo myservo4;
int fsrPin = 0; // the FSR and 10K pulldown are connected to a0
int fsrReading; // the analog reading from the FSR resistor divider
int pos = 0; // variable to store the servo position
void setup() {
Serial.begin(9600);
//Attaching the servos to the PWM pins
myservo.attach(3);
myservo2.attach(5);
myservo3.attach(6);
myservo4.attach(9);
//Moving all the servos to 0 degrees
myservo.write(0);
myservo2.write(0);
myservo3.write(0);
myservo4.write(0);
}
void loop() {
//The reading of the analog pin
fsrReading = analogRead(fsrPin);
if (fsrReading < 250) //First threshold for the slow turn
{
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
myservo2.write(pos);
myservo3.write(pos);
myservo4.write(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 degrees
myservo.write(pos);
myservo2.write(pos);
myservo3.write(pos);
myservo4.write(pos);
delay(15);
}
}
else if (fsrReading < 500) //Second threshold for the fast turn
{
for (pos = 0; pos <= 180; pos += 1) {
// in steps of 1 degree
myservo.write(pos);
myservo2.write(pos);
myservo3.write(pos);
myservo4.write(pos);
delay(5);
}
for (pos = 180; pos >= 0; pos -= 1) {
myservo.write(pos);
myservo2.write(pos);
myservo3.write(pos);
myservo4.write(pos);
delay(5);
}
}
delay(10); //Small delay to make sure all the servos are in place before moving again
}