IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.

Slides:



Advertisements
Similar presentations
Telecommunications & Networking
Advertisements

EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
Lab7: Introduction to Arduino
IR Control Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
IR Control Materials taken from IR Remote for the Boe-Bot by Andy Lindsay.
1 Lecture 1: Your Boe-Bot's Servo Motors Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation developed by: Martin.
Hardware Meets Software CPSC 120 Principles of Computer Science February 15, 2012.
OutLine Overview about Project Wii Robot Escaper Robot Problems and Solutions Demo.
Digital Tachometer ENGR 4803 Electromechanical Systems & Mechatronics.
Basic Stamp II is kinda cool Bytes of EEPROM(non-volatile) - Clock speed of 20 MHz. - Holds 600 lines of code in EEPROM - executes an average of.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
ENGR 101: Robotics Lecture 5 – Subprograms Outline  Subprograms  The Infrared Sensor System References 
IR SWITCH & REMOTE CONTROL
Remote Controls the incredible saga of invisible light by Samuel Bradshaw and Ryan Roose (of 7 th )
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Sensors Material taken from Robotics with the Boe-Bot.
P1f(i) Data Transmission You will learn about: How Infrared is used Analogue and Digital Signals
RM2F Input / Output (I/O) Pin grouping code!. I/O Pin Group Operations: The Spin language has provisions for assigning values to groups of bits in the.
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Microcontrollers Module 4: Motion Control. Module Objectives Upon successful completion of this module, students will be able to: Give examples of microcontroller.
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
Chapter Introduction to Computers and Programming 1.
Sensors Material taken from Robotics with the Boe-Bot.
Data Transmission The basics of media, signals, bits, carries, and modems (Part II)
Programming Concepts Part B Ping Hsu. Functions A function is a way to organize the program so that: – frequently used sets of instructions or – a set.
The Basic Stamp Instruction Set Architecture. The Microprocessor A microprocessor is a computer that typically has an architecture that is well suited.
Controlling the Outside World
Introduction to the Arduino
GCS 300 System Operation Application – Level 1.
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Problem 1 Choose title 1 st XML 2 nd electronic spider 3 rd infrared remote home control Waste time.
Sensors Material taken from Robotics with the Boe-Bot.
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
1 Lecture 1: Your Boe-Bot's Servo Motors Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation developed by: Martin.
IR Communication October 27, Sources  Lindsay, Andy. IR Remote for the Boe- Bot. v
Using IR Chapters 7 & 8 of Robotics with the Boe-Bot.
Microcontrollers Module 3: Digital Display. 7 – Segment Display A seven-segment display (SSD), or seven- segment indicator, is a form of electronic display.
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
ENGR 101: Robotics Lecture 3 – Robot Motion Outline  Robot Motion  FOR Loops  Making Music References 
ENGR 101: Robotics Lecture 4 – Making Decisions Outline  The Stall Sensor  Making Decisions  Random Number Generation References 
©UNT in partnership with TEA1 Telecommunications & Networking Unit Subtitle: Modems.
July 7, 2003 Slide 1 of 6 Automation, Robotics and Mechatronics Lab, SUNY at Buffalo Introduction To Programming Chetan Jadhav Talib Bhabharawala Seung-Kook.
Slide Menlo Drive Suite 100 Rocklin, CA
Slide 1 Chapter #7: Measuring Light Light Sensor Circuit Parts (1) (1)Resistor – 220 Ω (red-red-brown) (1) Capacitor – 0.1  F (1) Capacitor – 0.01  F.
PHY 235 Robotics Workshop Day 5 Distance Sensing Using The Ultrasonic Ping Sensor.
Using IR Chapters 7 & 8 of Robotics with the Boe-Bot.
PS/2 Mouse/Keyboard Port
1 BOE-BOT Lecture #2 DE - Digital Electronics Servos and the BOE-BOT.
Serial Communication RS-232. In order to make two devices communicate, whether they are desktop computers, microcontrollers, or any other form of integrated.
INTERNET OF EVERYTHING SDU 2016 Week 12. Remotely Controlling Devices  interact with almost any device that uses some form of remote control  TVs, audio.
BBC MICRO:BIT Lesson 6 Networking. Digital devices can be networked together to exchange data. You are going to create a very simple network using two.
Application Case Study Christmas Lights Controller
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
Materials taken from IR Remote for the Boe-Bot by Andy Lindsay
Arduino Part 1 Topics: Microcontrollers Programming Basics
IR Control Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
Communication Protocol
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Programming Boe-Bots (Part 1)
Material taken from Robotics with the Boe-Bot
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Materials taken from IR Remote for the Boe-Bot by Andy Lindsay
Materials taken from IR Remote for the Boe-Bot by Andy Lindsay
UNIT 7: INFRARED SENSORS
UNIT 5 Analog signals.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
UNIT 7: INFRARED SENSORS
Presentation transcript:

IR Communication 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 Boe-Bot Sony TV remote control IR signal PWM

What is IR: Visible Light Waves

What is Infrared

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.

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.

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 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 The LED may turn off briefly as you press each digit.

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.

The Protocol

Protocol Details This message consists of thirteen negative pulses that the BASIC Stamp 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.

How the IR Detector Works The Boe-Bot 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 Basic Stamp can be programmed to detect, measure, store, and interpret the sequence of low pulses it receives from the IR detector.

Schematic

PULSIN Command Complementary command to PULSOUT The syntax for the PULSIN command is PULSIN Pin, State, Variable Pin: the I/O pin for measuring the pulse. State is used to determine whether the pulse is a high pulse (1) or a low pulse (0). Variable stores the pulse duration measured in units of 2 micro-seconds. The IR pulses are inverted (i.e., low). To measure them with the IR detector circuit, you will have to use the command: PULSIN pin#, 0, variableName pin# is the pin connected to the IR detector; pin 9 in the previous slide.

Using PULSIN time VAR Word counter VAR Word DO PULSIN 9, 1, time IF (time > 1000) THEN counter = counter + 1

Storing Pulse Width: Arrays This array declaration creates twelve different word variables, each of which can store its own value: time(0), time(1), time(2), and so on, up through time(11). Each of the elements in the time array can store a different value between 0 and

Reading IR Messages time VAR Word(12) ' SONY TV remote variables. index VAR Nib DEBUG "time ARRAY PWM MEASUREMENTS", CR, "Element Duration, 2-us", CR, " " DO ' Beginning of main loop. DO ' Wait for rest between messages. PULSIN 9, 1, time(0) LOOP UNTIL time(0) > 1000 PULSIN 9, 0, time(0) ' Measure/store data pulses. PULSIN 9, 0, time(1) PULSIN 9, 0, time(2) PULSIN 9, 0, time(3) PULSIN 9, 0, time(4) PULSIN 9, 0, time(5) PULSIN 9, 0, time(6) PULSIN 9, 0, time(7) PULSIN 9, 0, time(8) PULSIN 9, 0, time(9) PULSIN 9, 0, time(10) PULSIN 9, 0, time(11) FOR index = 0 TO 11 ' Display 12 pulse measurements in units of 2 micro-secs. DEBUG CRSRXY, 0, 4 + index, "time(", DEC index, ")", CRSRXY, 9, 4 + index, DEC time(index) NEXT LOOP ' Repeat main loop.

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 PULSIN and RCTIME to measure the pulse duration Use the.BIT modifier to create the corresponding binary representation

How It Works RCTIME is used because the IF…THEN statement does not finish until after the next data pulse has already begun. Since the start of the pulse (its negative edge) is missed while the IF…THEN statement is executing, PULSIN cannot properly detect the beginning of the pulse. remoteCode VAR Byte remoteCode = 0

Code Sample time VAR Word remoteCode VAR Byte remoteCode = 0 DO RCTIME 9, 1, time LOOP UNTIL time > 1000 PULSIN 9, 0, time IF time > 500 THEN remoteCode.BIT0 = 1 RCTIME 9, 0, time IF time > 300 THEN remoteCode.BIT1 = 1 RCTIME 9, 0, time IF time > 300 THEN remoteCode.BIT2 = 1 … RCTIME 9, 0, time IF time > 300 THEN remoteCode.BIT5 = 1 RCTIME 9, 0, time IF time > 300 THEN remoteCode.BIT6 = 1 DEBUG CRSRXY, 4, 3, BIN8 remoteCode, CRSRXY, 14, 3, DEC2 remoteCode