IR Safety Box

SRJT07204

Deshanki, a friend of Jugaadu, is a product developer. To develop one of the products she needs to control the room condition, but she finds it difficult as every time she tries, she does not get the desired result. She has a doubt that someone is changing the temperature of the room. She wants to know the reason behind it. She has asked Jugaadu to resolve the issue. Can you help Jugaadu to resolve the problem?

Bag Items:

  1. Arduino UNO UNO
  2. Arduino UNO Cable (A to B)
  3. IR Sensors
  4. 12V Battery
  5. Battery Connector
  6. LED
  7. Jumper Wires
  8. Core foam sheets
  9. Cutter
  10. Hot Glue Gun
  11. PC/ Laptop

"

We need to confirm that remote should be on its place during the whole session. IR sensor can be used to identify the presence of remote. We can make a system whenever the remote moves the colour of the LED should be changed.

    int r=3;
int g=5;
int b=6;
int ir=7;
void setup() {
pinMode(r, OUTPUT);
pinMode(g,OUTPUT);
pinMode(b,OUTPUT);
pinMode(ir,INPUT);
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
}

void loop() {
if(!digitalRead(ir)){
digitalWrite(r,HIGH);
digitalWrite(g,LOW);
digitalWrite(b,HIGH);
}else{
for(int i=1; i>0;i++){
digitalWrite(r,LOW);
digitalWrite(g,HIGH);
digitalWrite(b,HIGH); }
}
}