IR Control - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

IR Control

Description:

IR Control Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay * The Plan: Use a TV Remote to Communicate with the Arduino ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 18
Provided by: Bru799
Learn more at: http://www.cs.unca.edu
Category:
Tags: control | works

less

Transcript and Presenter's Notes

Title: IR Control


1
IR Control
  • Materials taken from a variety of sources
    including IR Remote for the Boe-Bot
  • by Andy Lindsay

2
The Plan Use a TV Remote to Communicate with the
Arduino
IR signal
Sony TV remote control
PWM
3
What is IR Visible Light Waves
4
What is Infrared
5
The IR Signal
  • The IR detector is only looking for infrared
    thats flashing on and off 38,500 times per
    second.
  • It has built-in optical filters that allow very
    little light except the 980 nm infrared.
  • It also has an electronic filter that only allows
    signals around 38.5 kHz to pass through.
  • This is the type of signal produced by the remote
    control.
  • This prevents IR interference from common sources
    such as sunlight and indoor lighting.

6
Important Concepts
  • Pulse width modulation (PWM) Pulse durations are
    used in many applications, a few of which are
    motor control, and communication. Since the IR
    detector sends low pulses that can be measured to
    determine what information the IR remote is
    sending, it's an example of using PWM for
    communication.
  • Carrier signal The IR remote uses a 38.5 kHz
    "carrier signal" to transmit the pulse durations
    from the remote to the IR detector.
  • Communication protocol A communication protocol
    is a set of rules for devices that have to
    exchange electronic messages. Protocols tend to
    have rules for voltages, the amount of time
    signals last, carrier signal frequencies and/or
    wavelengths, and much more. When two or more
    devices follow the rules of a given protocol,
    they should be able to communicate and exchange
    information.

7
The TV Remote Control (4 Function Universal
Remote)
  • You must configure your universal remote so that
    it sends PWM messages to a television set using
    the SONY protocol.
  • TV remote setup
  • Press and release the TV key.
  • Press and hold the SET key until the indicator
    LED on the remote turns on and stays on.
  • Use the digit keys to enter 0001. The LED may
    turn off briefly as you press each digit.
  • VCR remote setup
  • Press and release the VCR key.
  • Press and hold the SET key until the indicator
    LED on the remote turns on and stays on.
  • Use the digit keys to enter 1028. The LED may
    turn off briefly as you press each digit.

8
The TV Remote Control (SYSTEMLINK 3 RCA)
  • You must configure your universal remote so that
    it sends PWM messages using the SONY protocol.
  • TV remote setup
  • Press and hold the CODE SEARCH button until the
    indicator LED lights, then release the CODE
    SEARCH button.
  • Press and release the TV button (the indicator
    LED will blink and then remain lit).
  • Use the digit keys to enter the code 002. After
    your code is entered, the indicator LED will turn
    off.
  • VCR remote setup
  • Press and hold the CODE SEARCH button until the
    indicator LED lights, then release the CODE
    SEARCH button.
  • Press and release the VCR button (the indicator
    LED will blink and then remain lit).
  • Use the digit keys to enter the code 004. After
    your code is entered, the indicator LED will turn
    off.

9
The Sony Protocol
10
Protocol Details
  • This message consists of thirteen negative pulses
    that the Arduino can easily measure.
  • 1 the start pulse, which lasts for 2.4 ms.
  • 2-13 will either last for 1.2 ms (binary-1) or
    0.6 ms (binary-0).
  • 2-8 indicates which key is pressed.
  • 9-13 indicate if the message is being sent to a
    TV, VCR, CD, DVD player, etc.
  • Pulses are transmitted in least significant bit
    first fashion.
  • the first data pulse is bit-0.
  • the next data pulse is bit-1
  • Etc.
  • If you press and hold a key on the remote, the
    same message will be sent over and over again
    with a 20 to 30 ms rest between messages.

11
How the IR Detector Works
  • Our IR receiver is the same detector found in
    many TVs and VCRs.
  • This detector sends a low signal whenever it
    detects IR flashing on/off at 38.5 kHz and a high
    signal the rest of the time.
  • When the IR detector sends low signals, the
    processor inside a TV or VCR measures how long
    each of the low signals lasts. Then, it uses
    these measurements to figure out which key was
    pressed on the remote.
  • Like the processor inside a TV, the Arduino can
    be programmed to detect, measure, store, and
    interpret the sequence of low pulses it receives
    from the IR detector.

12
Schematic for IR Detector
13
pulseIn Command
  • The syntax for the pulseIn command is
  • pulseIn (Pin, State)
  • Pin the I/O pin for measuring the pulse.
  • State is used to determine whether the pulse is a
    HIGH or LOW
  • Option third input max duration in millisecs
  • The output of the IR detector is inverted (i.e.,
    LOW).
  • pulseIn(pin, LOW)
  • pin is the pin connected to the IR detector

14
Using pulseIn()
  • while(pulseIn(9, LOW) lt 2200) //Wait for
    start bit

15
Interpreting the IR Message
  • The Idea represent the pulse sequence as a bit
    sequence.
  • The IR message consists of thirteen pulses with
    the following format
  • 1 the start pulse lasts for 2.4 ms.
  • 2-13 will either last for 1.2 ms (binary-1) or
    0.6 ms (binary-0).
  • Map the duration of pulses 2-8 to their
    corresponding binary value
  • Use pulseIn() to measure pulse length
  • Use the bitSet() to create the corresponding
    binary representation

16
Program for Reading IR Signals
  • ReadIR
  • Programming Features
  • pulseIn() and bitSet()
  • Arrays
  • A debug flag to turn on printout
  • Throws away devise designation
  • Adjusts bit pattern to match numeric keys

17
Program for Controlling Bot
  • IRcontrol
  • Programming Features
  • Switch statement
  • Servo library
Write a Comment
User Comments (0)
About PowerShow.com