Saturday, 10 May 2014

REMOTE CONTROL


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
     PLEASE NOTE
  • 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

THE ULTRA SONIC SENSOR

 
THIS IS ONE COOL WAY TO TRY OUT SOMETHING WE'VE ALL BEEN DOING SINCE GRADE ONE...
SO THE BIG QUESTION IS "WHAT IS AN ULTRA-SONIC SENSOR...WHAT DOES IT DO?" 

WELL AMONGST OTHER THINGS, IT CAN BE USED TO MEASURE DISTANCE BETWEEN OBJECTS.IT WORKS BY SENDING A SIGNAL FROM ONE OF THE OUTPUTS, THE TRANSMITTER (SEEN HERE ON THE LEFT, MARKED 'T'), THIS SIGNAL, DEPENDING ON ITS STRENGTH, HITS A SOLID OBJECT AND IS REFLECTED BACK, RECEIVED BY THE OTHER OUTPUT (RECEIVER-'R'), AND THE DISTANCE IS CALCULATED
  
 MATERIALS NEEDED
  • ARDUINO BOARD AND CABLE
  • BREAD BOARD
  • 220 OHM RESISTOR FOR THE LED
  • ULTRA-SONIC SENSOR
  • JUMPER WIRE 
  • LED
 THIS IS THE ULTRA SONIC SENSOR (the pins from left to right are VCC, TRIG, ECHO and GND)


 
NOTE: CONNECT YOUR CIRCUIT AS FOLLOWS
  • VCC TO ARDUINO 5V
  • GND TO ARDUINO GND
  • ECHO TO ARDUINO PIN 7
  • TRIG TO ARDUINO PIN 8
  • LED TO ARDUINO PIN 9


 AND THE CODE (QUITE LENGTHY, OOOPS):



int echopin =7;
int trigpin =8;
int led = 9;
int maxdistance = 200;
int mindistance = 0;
long duration, distance;
void setup(){
  Serial.begin(9600);
  pinMode(trigpin,OUTPUT);
  pinMode(echopin,INPUT);
  pinMode(led,OUTPUT);
}
void loop(){
  digitalWrite(trigpin,LOW);
  delayMicroseconds(2);
  digitalWrite(trigpin,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigpin,LOW);
  duration = pulseIn(echopin,HIGH);
  distance = duration/58.2;
if (distance >= maxdistance||distance <= mindistance){
    Serial.println("OUT OF RANGE");
    digitalWrite(led,HIGH);
  }
  else{
    Serial.println(distance);
    digitalWrite(led,LOW);
  }
  delay(50);
}



 SO WHAT DO YOU THINK?

THINK+CREATE+REPEAT

Tuesday, 6 May 2014

TACT SWITCH

 the tact switch functions like a normal switch that can be used to control a circuit

WHAT WE'LL NEED

  • ARDUINO BOARD & CABLE
  • BREADBOARD
  • TACT SWITCH
  • LED
  • 10K RESISTOR
  • JUMPER WIRE


 THE CODE SHOULD LOOK LIKE THIS

/* using tact switch to switch an led ON/OFF connected to pin 3
of the arduino...
AUTHOR: ANIEROBI PETER
DATE: 4/23/2014
www.hub360.blogspot.com, www.facebook.com@hub360
*/
int switch =4; // tact switch connected to analog pin 4
int led = 3;// led connected to pin 3
int x;
void setup(){
  pinMode(switch,INPUT); //set tact as input
  pinMode(led,OUTPUT);  //set led as output
}
void loop(){
  x= digitalRead(switch); //read to know if switch is detected or not
  digitalWrite(led,x);  //ON or OFF an LED according to detection
}

 







 
TACT SWITCH by hub360





 we sincerely hope you find this amazing


think...create...repeat

Thursday, 1 May 2014


SO WHAT EXACTLY IS A TILT SENSOR...WHAT DOES IT DO?
simply put, it is an electronic device, quite small (about the size of an LED); it acts like an ordinary switch, the switch closes when the sensor is tilted and opens when brought to its original position.

and amongst other things, a tilt sensor can be used to determine angular deviation (from the normal).


SO WHAT COMPONENTS DO WE NEED FOR THIS CONNECTION?
  •  ARDUINO BOARD AND CABLE
  • BREADBOARD
  • TILT SENSOR
  • LED
  • 220 OHM RESISTOR (FOR THE LED)
  • 10K RESISTOR
  • JUMPER WIRE

SEE WHAT THE SKETCH LOOKS LIKE


/* using tilt sensor to switch an led ON/OFF connected to pin 3
of the arduino...
AUTHOR: ANIEROBI PETER
DATE: 4/23/2014
www.hub360.blogspot.com, www.facebook.com/hub360circuits
*/
int tilt =4; // tilt sensor connected to digital pin 4
int led = 3;// led connected to pin 3
int x;
void setup(){
  pinMode(tilt,INPUT); //set tilt as input
  pinMode(led,OUTPUT);  //set led as output
}
void loop(){
  x= digitalRead(tilt); //read to know if tilt is closed
  digitalWrite(led,x);  //ON or OFF an LED according to detection
}



 AND FOR THE CONNECTION






 THINK...CREATE...REPEAT