Close

May 6, 2017

CircuitPython: PulseIO and cloning an IR remote control with Tony D!: A New video by Adafruit Industries

CircuitPython: PulseIO and cloning an IR remote control with Tony D!
Live stream to http://ift.tt/1RCEQ5c showing the pulseio module in CircuitPython and how to use it with an IR receiver and IR LED to clone a remote control. Learn a bit about how IR remotes work and how CircuitPython can capture and generate their signals.

Links and hardware mentioned in the video:
– Feather M0 Express guide (go here to learn about loading CircuitPython on this board): http://ift.tt/2nJ0qhg
– IR LED: http://ift.tt/2p325Qs (don’t forget you need a ~200-500 ohm resistor too)
– IR receiver: http://ift.tt/1v0PmrM
– Generic remote control: http://ift.tt/2fnR4kI
– NEC remote protocol: http://ift.tt/1isq0S0
– CircuitPython PulseIO documentation: http://ift.tt/2pPXSzF

Recap of wiring and code in video:
– IR receiver right most pin (with bump facing you) to board 5V power (USB on Feather boards plugged into computer).
– IR receiver middle pin to board ground.
– IR receiver left most pin to board D6.
– IR LED anode (longer leg) to board D11
– IR LED cathode (shorter leg) to one side of 220 ohm resistor
– Other side of 220 ohm resistor to board ground

Capture signal with code:
import board
import pulseio
ir_read = pulseio.PulseIn(board.D6, maxlen=100, idle_state=True)

Press remote control button with it facing the IR receiver. Now copy the value out to an array object in a specific 16-bit format:
import array
on_command = array.array(‘H’, [ir_read[x] for x in range(len(ir_read))])

Finally create a PWM output and PulseOut object to play back the on command above:
ir_led = pulseio.PWMOut(board.D11, frequency=38000, duty_cycle=2**15)
ir_send = pulseio.PulseOut(ir_led)
ir_send.send(on_command)

Acknowledgements:
– Music: bartlebeats
– Intro shuttle footage: NASA
– Intro fonts: Typodermic
– Intro inspiration: Mr. Wizards’s World
– Matrix background: cool-retro-term & cmatrix

—————————————–
Visit the Adafruit shop online – http://www.adafruit.com

Subscribe to Adafruit on YouTube: http://ift.tt/WjMaF9

Join our weekly Show & Tell on G+ Hangouts On Air: http://ift.tt/XXwygw

Watch our latest project videos: http://adafru.it/latest

New tutorials on the Adafruit Learning System: http://ift.tt/Pax0QO

Music by bartlebeats: http://ift.tt/18XCwSd
—————————————–

View on YouTube