Inspiration: It can be quite difficult to use blinds (particularly old ones) and sometimes we are too tired to turn off the lights and turn off the speakers and close the blinds, etc. This is a problem for college students (an others) all over. This is why Team 14 decided to solve that problem with a convenient panel designed to save time and be fun and creative.

What it does: The mood room is a control panel that has multiple buttons, each assigned to a particular "mood" setting. For example, one button can be the "Study" button, which will turn on the lights, open the blinds, and play soft music, all with a single button press. Another can be the "Party" mode, where the lights will flash on and off, the blinds will close, and DJ music will play.

How we built it: We began with a few buttons at first in order to ensure that we could use the Bluetooth transmitters effectively. At this point, only one function was assigned to each button instead of having multiple events occur with one button push. We gradually added more buttons (a total of 6) and added multiple functions to each.

Challenges we ran into: We unfortunately could not fully implement the motor in a way we wanted too. There were complications with the code, so in our final design the motor is connected, but does not move. We could get it to work, but it would turn too far or too rapidly. We only needed a small turn (to represent motors turning the blinds open or close).

Accomplishments that we're proud of: We were able to put multiple functions to each button (even if the motor did not work) and have the Bluetooth transmitters work effectively. This was a complicated process, as there were many buttons and each one had to print the correct statement to the other transmitter.

What we learned: We learned a lot about how exactly the transmitters communicate with each other. In the beginning, we had code that made sense to humans, but the transmitters read the code differently than we did. We also learned more about how to use motors and that they can be controlled using the angle through which a blade will rotate.

What's next for Mood Room: With the control panel's design and flexibility, nearly any room can be changed to suit the person's mood. Whether it be a serious meeting room or a relaxing children's play room, any room can benefit from our Mood Room project.

ABSTRACT

Team 14’s prototype will feature a control panel to produce a “mood-based” room. The panel will control different aspects of the room (blinds, lights, speakers, etc.) to reflect the user’s mood at the moment. For example, a study mode will turn the lights on and play calm, quiet music. In another example, the romantic mode may dim the lights and close the blinds. LEDs, buttons, motors, and Bluetooth will be implemented in order to complete the system.

https://www.youtube.com/watch?v=02WP1VqEOLs

https://www.youtube.com/watch?v=YKu_aPwMVFc&t=2s

RECEIVER CODE (LED, Buzzer, and Motor)

include

include

//#include "String.h" SoftwareSerial BTSerial(2, 3); //TX TX

Servo servo1; const int LED = 11; const int buzz = 6; int incoming = 0; int turn = 0;

void setup() { pinMode(LED, OUTPUT); pinMode(buzz, OUTPUT); BTSerial.begin(9600); Serial.begin(9600); servo1.attach(5); }

void loop() {

//servo1.write(180);

if (BTSerial.available()) { incoming = BTSerial.read(); Serial.println((String)(char)incoming);

if (((String)(char)incoming) == "0") {
  digitalWrite(LED, LOW);
  servo1.write(0);
}

if (((String)(char)incoming) == "1") {
  digitalWrite(LED, HIGH);
  servo1.write(90);
}

if (((String)(char)incoming) == "2") {
  analogWrite(LED, 40);
}

if (((String)(char)incoming) == "3") {
  digitalWrite(LED, HIGH);
}

if (((String)(char)incoming) == "4") {
  digitalWrite(LED, HIGH);
  delay(50);
  analogWrite(LED, LOW);
  delay(50);
}

if (((String)(char)incoming) == "5") {
  digitalWrite(LED , LOW);
  delay(3000);
  digitalWrite(buzz, HIGH);
  delay(2000);
  digitalWrite(buzz, LOW);
}

} }

TRANSMITTER CODE (Panel with Buttons)

include

SoftwareSerial BTSerial(2, 3); //TX TX

const int trig = 9; const int echo = 8; int duration = 0; int distance = 0; int ping_read = 0;

const int LED = 11; int state = 0; const int buzz = 10;

const int white = 6; int val = 0; int oldval = 0;

const int green = 8; int val1 = 0; int oldval1 = 0;

const int red = 4; int val2 = 0; int oldval2 = 0;

const int blanche = 5; int val3 = 0; int oldval3 = 0;

const int purple = 9; int val4 = 0; int oldval4 = 0;

const int golden = 7; int val5 = 0; int oldval5 = 0;

void setup() {

BTSerial.begin(9600); Serial.begin(9600); pinMode(LED, OUTPUT); pinMode(buzz , OUTPUT); pinMode(white , INPUT); pinMode(green , INPUT); pinMode(red, INPUT); pinMode(blanche , INPUT); pinMode(purple , INPUT); pinMode(golden, INPUT); pinMode(trig , OUTPUT); pinMode(echo, INPUT);

}

void loop() {

/* digitalWrite(trig , LOW); delayMicroseconds(2); digitalWrite(trig , HIGH); delayMicroseconds(10); digitalWrite(trig, LOW); duration = pulseIn(echo , HIGH); distance = (duration/2)/29.1; */

val = digitalRead(green); val1 = digitalRead(white); val2 = digitalRead(red); val3 = digitalRead(blanche); val4 = digitalRead(purple); val5 = digitalRead(golden);

if ((val1 == HIGH) && (oldval1 == LOW) ){ state = 1; } oldval1 = val1;

if ((val == HIGH) && (oldval == LOW) ){ state = 0; } oldval = val;

if ((val2 == HIGH) && (oldval2 == LOW) 

){ state = 2; } oldval2 = val2;

if ((val3 == HIGH) && (oldval3 == LOW) ){ state = 3; } oldval3 = val3;

if ((val4 == HIGH) && (oldval4 == LOW) ){ state = 4; } oldval4 = val4;

if ((val5 == HIGH) && (oldval5 == LOW) ){ state = 5; } oldval5 = val5;

if (state == 0){ BTSerial.print("0"); Serial.println("Sleep"); digitalWrite(LED , LOW); }

if (state == 1){ BTSerial.print("1"); Serial.println("Study"); digitalWrite(LED , HIGH); }

if (state == 2){
  BTSerial.print("2");
  Serial.println("Romantic");
  analogWrite(LED , 40);

}

if (state == 3){ BTSerial.print("3"); Serial.println("Chill"); analogWrite(LED , 255); }

if (state == 4){ BTSerial.print("4"); Serial.println("Party"); digitalWrite(LED , HIGH); delay(50); digitalWrite(LED , LOW); delay(50); }

if (state == 5){ BTSerial.print("5"); Serial.println("Power Nap"); digitalWrite(LED , LOW); delay(3000); analogWrite(buzz, 1); delay(2000); digitalWrite(buzz, LOW); }

/* if (distance < 10){ ping_read = false; } else{ ping_read = true; }

if(ping_read = true) { BTSerial.print("3"); Serial.println(3); } */ }

Share this project:

Updates