Know How... (Audio)

KH 341: IR Basics Part 1


Listen Later

Basics of IR Control

IR control is a BINARY communications system

  • It uses a series of "0" and "1" (off or on) to convey a value from a transmitter to a receiver
  • The "Transmitter" is an IR LED and the "Receiver is a photosensitive element that responds to IR light"
  • However... just being able to "see" if the IR LED is lit doesn't allow us to communicate.
  • We need to have a "protocol" that defines how long a "control sequence" is and how to read it.- In other words, I need to know when the sequence starts, and when it ends.

We're going to use the "IRremote" library which understands most of the POPULAR protocols

Demo of Reading IR Codes

  1. Show Interface
  2. Show codes
  3. Show Hardware

Let's Assemble the hardware!

Parts

  1. IR Receiver (AX-1838HS) and LED
  2. Arduino Nano

Pinout of the IR Receiver

From left to right, looking at the front of the sensor

  1. Out
  2. GND
  3. VCC

Let's Program!

  • First, we need to include the "IRremote" Library
  • Sketch > Include Library > Manage Libraries

#include // This is the library we need to speak IR protocols

#define IR_PIN 2 // The digital pin to which the IR Reciever is connected

IRrecv irrecv(IR_PIN); // Turn on the reciever
decode_results ircode; // Create a structure called "IRcode"

void setup()
{
Serial.begin(9600); // Start the Serial Port (for debug)
irrecv.enableIRIn(); // Start the receiver
}

void loop()
{
if (irrecv.decode(&ircode)) // IF the IR reciever has received a code, THEN run the following:
{
Serial.println(ircode.value, HEX); // Print the received code to the Serial Port (for Debug)
irrecv.resume(); // Wait for the next IR code
}
}

** This code is a basic IR code reader. It will receive an IR code from a remote, then print it to the serial console

Now that we know we can receive IR codes w/our Nano, let's DO something with it!

Code for this Episode can be found at the link below:

https://www.dropbox.com/s/qf0htfgfo5de9zb/KH341_IR.zip?dl=0

Hosts: Fr. Robert Ballecer, SJ and Megan Morrone

Connect with us!

  • Don't forget to check out our large library of projects at https://twit.tv/shows/know-how.
  • Join our Google+ Community.
  • Tweet at us at @PadreSJ and @Anelf3.

Thanks to CacheFly for the bandwidth for this show.

...more
View all episodesView all episodes
Download on the App Store

Know How... (Audio)By TWiT

  • 4.5
  • 4.5
  • 4.5
  • 4.5
  • 4.5

4.5

35 ratings


More shows like Know How... (Audio)

View all
The Giz Wiz (Audio) by Dick DeBartolo & Chad Johnson

The Giz Wiz (Audio)

138 Listeners

This Week in Law (Audio) by TWiT

This Week in Law (Audio)

109 Listeners

Jumping Monkeys (Audio) by TWiT

Jumping Monkeys (Audio)

72 Listeners

Dr. Kiki's Science Hour (Audio) by TWiT

Dr. Kiki's Science Hour (Audio)

96 Listeners

Maxwell's House (Audio) by TWiT

Maxwell's House (Audio)

35 Listeners

net@night (Video) by TWiT

net@night (Video)

24 Listeners

Futures in Biotech (Video) by TWiT

Futures in Biotech (Video)

10 Listeners

Ham Nation by Josh Nass

Ham Nation

116 Listeners

Trey's Variety Hour (Video) by TWiT

Trey's Variety Hour (Video)

35 Listeners

This Week in Enterprise Tech (Audio) by TWiT

This Week in Enterprise Tech (Audio)

95 Listeners

The Giz Wiz (HD Video) by Dick DeBartolo & Chad Johnson

The Giz Wiz (HD Video)

28 Listeners

This Week in Law (Video) by TWiT

This Week in Law (Video)

6 Listeners

This Week in YouTube (Audio) by TWiT

This Week in YouTube (Audio)

9 Listeners

FourCast (Audio) by TWiT

FourCast (Audio)

0 Listeners

Coding 101 (Audio) by TWiT

Coding 101 (Audio)

15 Listeners

Padre's Corner (Video) by TWiT

Padre's Corner (Video)

9 Listeners

The New Screen Savers (Audio) by TWiT

The New Screen Savers (Audio)

50 Listeners

Ask The Tech Guy (Vintage) (Audio) by TWiT

Ask The Tech Guy (Vintage) (Audio)

29 Listeners

Hands-On Photography (Audio) by TWiT

Hands-On Photography (Audio)

31 Listeners

Ask The Tech Guy (Video) by TWiT

Ask The Tech Guy (Video)

0 Listeners