If your television, projector or any other device with an infrared receiver does not respond to its respective remote, try the following solutions:
- Check that the remote control batteries are installed correctly and have power. If necessary, replace the batteries.
- Make sure you are operating the remote control within the reception angle and range of the device.
- Check to see if a button on the remote control is stuck down, causing it to enter sleep mode. Release the button to wake the remote control up.
- Strong fluorescent lighting, direct sunlight, or other infrared device signals may interfere so, dim the lights or move the device away from the sun or any interfering equipment.
- If you lose the remote control, you can order a new one.
You need to follow the same process for every such device to get through it.
Now, what if you have just one device through which you can control any infrared reception device without worrying about the above problems?
In order to implement this solution, we used WIZnet’s S2E along with Arduino UNO controlled by a mobile app. And finally we could register and control any infrared reception device.
- Arduino UNO: It is the decision maker. It decides which button is pressed in the app or what command is given to the device from the app.
- Cloud Broker: Our broker in this project is online to control the transfer of messages via MQTT.
- WIZ750SR/S2E: It is a protocol converter that transmits data sent by serial equipment (e.g. Arduino) as TCP/IP data and converts the TCP/IP data received through the network(e.g. Mobile App) back into serial data to the serial equipment. Hence, it receives data from the Android app installed on a mobile and transmits this data serially to the Arduino.
- WIZ750SR-EVB: This is the evaluation board for the WIZ750SR. The S2E can be fixed on top of this board.
- IR transmitter
- IR receiver
1. First, we power on both the board (S2E, Arduino Uno).
2. Then, we connect the Ethernet cable to the S2E.
3. From here, we connect the RS232 to the S2E, and connect the other end to the Arduino using the jumper wires by connecting the Rx, Tx of the RS232 to the Pin 10, 11 and the GND pin to the GND of the Arduino.
4. Now, we connect the IR receiver to the Arduino board, using the jumper wires, the ouput pin of the IR receiver is connected to the pin 12 of the arduino board, and the GND and 3.3v is connected respectively.
5. Finally, we connect the IR transmitter to the arduino board, the ouput pin of the transmitter is connected to the pin 3 of the arduino and the GND is connected to the GND of the Arduino.
Take a female to female RS232 cable and plug it into the RS232 port of the S2E. The other end of the RS232 cable needs to be connected to the Arduino. In the RS232 female head, pin 2 acts as the transmitter and pin 3 acts as the receiver. These pins are connected to the Arduino digital pins 11 and 10 respectively. The ground of the RS232 (pin 5) is connected to the ground of the Arduino.
Setting Up Android Studio
To go through the installation process of Android Studio, go through the below link: https://developer.android.com/studio/install
After setting up the Android Studio for the code, go through the link below:
https://github.com/piyushsingh27/Infrared-Remote
We used the cloudMQTT online broker. Just make an account on cloudMQTT and you are good to go. Make a note of the host name, port number, username and password. These credentials would be used in android application as well as WIZ7500P(S2E).
Upload the Code to S2ES2E board fixed on top of evaluation board
1. First and foremost, set the pin on the evaluation board of the S2E to BOOT mode and press reset. i.e. move the center switch (highlighted using a black box in the bottom left hand corner of the above image) to the right before starting the next step.
2. Then, download the W7500P ISP tool from the following link : http://wizwiki.net/wiki/doku.php?id=products:wiz750sr:download:start.The ISP tool will look as shown below:
W7500P ISP tool
3. Connect the S2E to a laptop via its microUSB port to figure which COM number is assigned to it using "Device Manager". The USB to UART driver can be downloaded from https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers If it’s not installed on your device. In the image below it can be seen that COM6 has been assigned to the S2E.
Then hit "Refresh" button in the ISP tool and select the appropriate port number from the drop down list. The baud rate should be fixed at 9600.
4. Then hit "Open" button in the ISP tool. If successful, one can see the result - "Serial Open Complete" in the left bottom corner.
5. The S2E uses ARM Cortex-M0 architecture. In order to program the S2E we'll have to use the ARM compiler that can be accessed using: http://os.mbed.com/compiler. When you login into the compiler select the board as "WIZwiki- W7500P".
Uploading the Code to ArduinoThe Arduino is the mastermind of the project. It receives the signal from the IR transmitter and recognizes the command given to the device and so the execution can be made accordingly. IR receiver is connected to the arduino which receives the signal and further through the broker it is sent to the MQTT terminal that gives the output (for reference) and the device would work according to the command given.
In order to use the Arduino we must first install its IDE. The Arduino IDE is easy to use as well as open source and can be easily downloaded from the official Arduino website. Once the IDE is installed, the next step would be to select the board. The board can be selected by going through the “Tools” option as depicted in the image below:
Select Board
Once the board is selected. The port at which the Arduino will be available for serial communication needs to be selected as depicted below:
Select COM Port
The next step would be to upload the “Arduino_code”(available in the code section of this project’s description) into the IDE. Once that is done the code can be compiled and uploaded onto the board by clicking the tick mark and arrow button respectively.
Compile and Upload sketch to board
Final ResultWe can use CoolTerm to test out the serial port, which can be downloaded from https://coolterm.en.lo4d.com/. CoolTerm will enable us to read all the messages sent to the COM port.
When the message is sent via the app the response output from the Arduino can be seen on the CoolTerm terminal.
CoolTerm Terminal
The MQTT model, publishes the message from the Android app to the broker i.e. the Raspberry Pi, where the broker forwards the data to any devices subscribing to that data. In the case of our project, the S2E is the device subscribing to the data available with the broker. The data read by the S2E is interpreted by the Arduino which then decides the command for the device sent from the app.
Comments