How to control LEDs with TV remote – Arduino

1
August 23, 2016
Control LED with IR remote

Today I’m going to show you how to control any device with an Infrared remote(TV,DVD,AC etc.) and with the help of Arduino board. So lets get started.

Things you’ll need :-

  • Infrared receiver (I’m using one from the TSOP 17** series)
  • Arduino board.
  • Breadboard.
  • Couple of jumpers/single stranded wires.
  • A LED Any remote(AC, TV, DVD player).

Connections :-

Connections of Infrared receiver with Arduino
Connections of Infrared receiver with Arduino

Of Infrared reciever-
Pin 1 –                           GND (Ground pin of Arduino).
Pin 2/Middle pin –     VCC (5v supply of Arduino).
Pin 3 –                           Data pin (pin number 3 on Arduino).

Note :- The pin no. 3 is a bit separated from the other two ! Don’t misunderstand between pin1 & pin3 !

Procedure :-

  1. First things first, make the connections.
  2. Now to turn ON/OFF any LED with the help of any remote we must know the value/code of the button through which we are going to change the state !
  3. Download the IRemote library online from this link. Copy & paste the code I’ve provided. Upload it.
  4. After uploading, click on the Serial Moniter option in the top right corner of Arduino window.
    Press the buttons you wish to control your LED with. Note down the values which appear in the Serial monitor window.
  5. Making changes in your code by replacing YOUR values with “YOUR VALUE 1” & “YOUR VALUE 2” in the code.
    Again upload the code & test it out !

Code :-

#include <IRremote.h>
 
int RECV_PIN = 3;               //declared for receiving pulses
int c=0;                        // declared if you want to control with a single button
IRrecv irrecv(RECV_PIN);
decode_results results;


void setup()
{
   pinMode(9, OUTPUT);
   Serial.begin(9600);
  irrecv.enableIRIn();                      // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value);
    irrecv.resume();                        // Receive the next value
  if(results.value==YOUR VALUE1)                                       
  {
             digitalWrite(9,HIGH);
  }
  else if(results.value==YOUR VALUE2)
  {
             digitalWrite(9,LOW);
  }
                                }
}


/* if((results.value== YOUR VALUE3)&&(c%2==1))                    // enables you to turn on & off with the help of same button"                  
  {
                digitalWrite(9,HIGH);
  }
  else if((results.value==YOUR VALUE3)&&(c%2==0))
  {
                digitalWrite(9,LOW);
  }
  c++;
 }}*/

Here’s a video tutorial which will definitely make things easier for you 😉

Please comment below if you face any difficulties. I’d love to solve them 🙂 .

Why do some roads have Yellow markings while others have White ?

August 5, 2016



In India, nobody gives a damn about traffic rules ! I mean our knowledge is limited to road signboards(few 😛 ) & those traffic lights & this is the reason why there is a growth in number of road accidents. So lets just know more about traffic & road rules which might make our journey safe & sound !

White solid lines :-

Solid white lines indicate that you must not cross these lines to overtake or make a U-turn & stay in the lane you are already on.

source:- scoopwhoop.com
source:- scoopwhoop.com

Broken White line :-

Broken white lines indicate that you may change the lane to overtake a vehicle with proper caution & indicating through proper signals.

source- total911.com
source- total911.com

One solid yellow line :-

This line indicates that you cannot cross the line but can overtake.

source- www.allindiaroundup.com
source- www.allindiaroundup.com


 


Broken Yellow line :-

Passing is allowed but with caution.

souce- sabre-roads.org.uk

Double solid yellow lines :-

You can’t cross these lines unless you have to avoid obstructions(a fallen tree, a crashed vehicle etc.)

source:- www.architectureandcivilengineering.com
source:- www.architectureandcivilengineering.com


 



So next time if someone overtakes you by crossing a white continuous line you might wanna gun your engine & say him –

” You cannot overtake a vehicle by crossing a white solid line… *pause* B**ch ! 😛

source:-Scoopwhoop

Autopilots | How do they work ?

July 22, 2016

8 out of 10 people still think that Autopilots are a computer system which are capable of driving the vehicles on their own ! Well that is completely wrong ! Rather than just correcting them, let us all know what is actually are autopilot system & everything else related to it !

more “Autopilots | How do they work ?”

How helicopters work, fly & turn (Animation) ?

5
July 5, 2016

Very few are lucky enough to take a ride in a Chopper & I am happy to be one of them! Anyway, helicopters are indeed one of the most interesting machines from which I know so far. Subjects like flight mechanics & helicopter dynamics are not for weak hearted ones; they are seriously challenging to study! Well keeping those complex calculations, equations & relations aside, lets at least know how helicopters work, fly & are steered !

more “How helicopters work, fly & turn (Animation) ?”

What are Flight Recorders/Black boxes ?

July 5, 2016



One of the most frequently used tech-word we hear from the media after a  flight crash is “Black box”. Well, many of the people don’t even know that Black boxes aren’t“black”.  Do you really know about them enough ? If not, here’s everything you need to know about Black boxes/Flight recorders. more “What are Flight Recorders/Black boxes ?”

MotoArt – Company which makes furniture from retired airplanes !

May 20, 2016

Just leave everything aside & have a look at these sophisticated & elegant furniture made by a Calfornian company named – MotoArt, which takes furniture to a whole new level of innovation. MotoArt is a company which makes furniture by recycling old parts of military & commercial airplanes. All our home furniture are ordinarily made up of wood, glass or plastic & you can buy them by getting huge discounts through Pepperfry Coupons unlike these amazing stuff… because great things come at a great price ! more “MotoArt – Company which makes furniture from retired airplanes !”

How do missiles work? | Targeting, Guidance & Propulsion

May 1, 2016

Missiles – pretty cool uhh.. but what makes them so cool? Well, the best thing is you could launch a weapon thousands of miles away. This leaves no reason why the military of every nation won’t keenly research on it

more “How do missiles work? | Targeting, Guidance & Propulsion”