REMEMBER WHAT IT WAS LIKE WHEN ALL WE HAD WERE BLACK AND WHITE TELEVISION SETS? AND THEN CAME THE BIG BANG: COLOURED SCREENS!!! WITH BETTER VISUAL DISPLAYS, AND THE COMFORT OF CONTROLLING IT FROM YOUR SEAT WITH THE REMOTE CONTROL.
BUT HAVE YOU EVER WONDERED HOW THIS REMOTE CONTROL WORKS?
HAS IT EVER OCCURRED TO YOU THAT YOU CAN HAVE YOUR OWN HOME-MADE REMOTE CONTROLLED DEVICE?
THIS PROJECT TRIES TO ANSWER SOME OF THESE
SO HOW DOES IT WORK?
THE SIMPLE LOGIC IS COMMUNICATION BETWEEN TWO DEVICES, A TRANSMITTER AND A RECEIVER, AND IN THIS CASE, THE REMOTE AND SENSOR RESPECTIVELY VIA INFRA-RED.
WHAT DO WE NEED TO MAKE THIS DREAM A REALITY?
- ARDUINO BOARD
- BREADBOARD
- LEDs (RED, YELLOW AND GREEN)
- 220 OHM RESISTORS X3 (ONE FOR EACH LED)
- TSOP 1838 SENSOR
- REMOTE CONTROL
- JUMPER WIRES
- YOU HAVE TO MAKE THE FOLLOWING CONNECTIONS
VCC TO 5V OF THE ARDUINO
GND TO GND OF THE ARDUINO
OUT TO PIN 9 OF THE ARDUINO
- FOR THIS TOPIC, WE HAVE DECIDED TO USE A SIMPLE SYSTEM YOU SHOULD BE QUITE FAMILIAR WITH NOW
SEE WHAT THE TSOP 1838 LOOKS LIKE
AND THE REMOTE CONTROL
WHAT ABOUT THE CODES?
#include <IRremote.h>
int receiver = 9;
int led1 = 4;
int led2 = 5;
int led3 = 6;
IRrecv irrecv(receiver);
decode_results results;
void setup()
{
irrecv.enableIRIn();
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
}
void loop()
{
if (irrecv.decode(&results)) {
long decCode = results.value;
switch(decCode){
case 16724175:
digitalWrite(led1,HIGH);
digitalWrite(led3,LOW);
digitalWrite(led2,LOW);
break;
case 16718055:
digitalWrite(led2,HIGH);
digitalWrite(led1,LOW);
digitalWrite(led3,LOW);
break;
case 16743045:
digitalWrite(led3,HIGH);
digitalWrite(led2,LOW);
digitalWrite(led1,LOW);
break;
}
irrecv.resume();
}
}
LIKE WE SAID
THREE LEDs USED WITH A REMOTE CONTROL |
PLEASE DON'T FORGET WE WILL LIKE TO HEAR YOUR COMMENTS AND VIEWS, SO PLEASE LET US KNOW... THANKS A LOT
THINK+CREATE+REPEAT
No comments :
Post a Comment