Tags:
create new tag
view all tags

Infrared remote control

Introduction

The WeMos D1 mini series of sensor board includes an IR receiver and transmitter.

ir_controller.png ir_rec_back.png
On its back you can define the GPIO pins on which the receiver and transmitter responds. I selected
  • D2: GPIO 21 for the receiver
  • D1: GPO 22 for the transmitter
The system was tested with this IR remote:

ir_remote.png

The software

You can find the programs on the github repository: https://github.com/uraich/IoT-Course/tree/master/exercises/solutions/exercise_14.

In order to get at the IR data the driver sets up a callback on any change of the IR data signal. It measures the time between these changes and saves them into a list (see timeList below)


We can reconstruct the signal using the times as values on the x-axis (adding them up) and plotting y-values that switch from high to low or from low to high for every value in the above table:

ir_signal.png

As can be seen from the plot, the signal is zero as long as no button is pressed on the remote. Then it switches to high and the data transfer starts. Every short pulse corresponds to a zero, while every long pulse corresponds to a 1. This gives us: 0000 0000 1111 0110 1000 1001 0111.

A simple analysis program confirms this:

ir_results.png

First the list of time differences between the state changes of the IR data signal is printed. From this the data bits are extracted and finally combined to the IR code. A Python dictionary is used to find the corresponding key on the IR keyboard. As we can see, the numeric key "2" was pressed.

-- Uli Raich - 2021-05-06

Comments

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng ir_controller.png r1 manage 299.5 K 2021-05-06 - 14:44 UliRaich  
PNGpng ir_rec_back.png r1 manage 326.3 K 2021-05-07 - 20:46 UliRaich  
PNGpng ir_remote.png r1 manage 86.4 K 2021-05-06 - 14:54 UliRaich  
PNGpng ir_results.png r1 manage 23.8 K 2021-05-06 - 15:12 UliRaich  
PNGpng ir_signal.png r1 manage 23.4 K 2021-05-06 - 15:06 UliRaich  
PNGpng ir_table.png r1 manage 22.0 K 2021-05-06 - 15:06 UliRaich  
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2021-05-07 - UliRaich
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback