InfraredRemoteControl

Page Actions

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.

-- %USERSIG{UliRaich - 2021-05-06}%

Comments

 
I Attachment Action Size DateSorted descending Who Comment
ir_rec_back.pngpng ir_rec_back.png manage 326 K 07 May 2021 - 20:46 UnknownUser  
ir_results.pngpng ir_results.png manage 23 K 06 May 2021 - 15:12 UnknownUser  
ir_signal.pngpng ir_signal.png manage 23 K 06 May 2021 - 15:06 UnknownUser  
ir_table.pngpng ir_table.png manage 21 K 06 May 2021 - 15:06 UnknownUser  
ir_remote.pngpng ir_remote.png manage 86 K 06 May 2021 - 14:54 UnknownUser  
ir_controller.pngpng ir_controller.png manage 299 K 06 May 2021 - 14:44 UnknownUser  
Topic revision: r2 - 07 May 2021, UliRaich