Adding an IR socket to non-IR enabled devices

Think, what if you want to control a device that hasn't any built-in infrared receiving functionality. Fortunately, you can do this by using an infrared socket. An infrared socket is a pluggable device that can be plugged into a electrical wall socket. Then, you can plug your electrical device into it. In addition, the IR Socket has a simple IR receiving unit, and you can attach it to a place where the IR signal can be received properly.

The following image shows the frontal view of the IR socket:

Adding an IR socket to non-IR enabled devices

The infrared socket—front view

The following image shows the side view of the IR socket:

Adding an IR socket to non-IR enabled devices

The IR socket side view

A generic type of IR socket comes with a basic remote control with a single key for power on and off:

Adding an IR socket to non-IR enabled devices

The IR remote control for The IR socket

  1. Before you proceed with this project, trace the IR raw code for the power button of your remote control.
  2. Copy the Arduino sketch, B04844_08_05.ino, from the sample code folder of Chapter 8, and paste it to a new Arduino IDE. Then, modify the following line with the IR raw code for the power button:
    unsigned int  rawData[69] = {47536, 4700,4250, 750,1500, 700,1500, 700,1550, 700,400, 700,400, 700,400, 700,450, 650,450, 650,1600, 600,1600, 650,1600, 600,500, 600,500, 600,550, 600,500, 600,500, 600,1650, 550,1650, 600,1650, 550,550, 550,600, 500,600, 500,600, 550,550, 550,600, 500,600, 500,600, 500,1750, 500,1700, 500,1750, 500,1700, 500,1750, 500,0};  // POWER BUTTON
  3. Also, modify the following line with the correct parameters:
    irsend.sendRaw(rawData,69,32)
  4. Verify and upload the sketch on the Arduino board.
  5. Plug the IR socket into a wall power outlet and turn on the switch.
  6. Point the IR LED attached with the Arduino to the IR socket.
  7. Plug any electrical device (for this project, we used an electric fan for testing) into the IR socket and make sure that the power is available. Then, turn the power switch of the fan to the ON position.
  8. Open a new web browser (or new tab), type the IP address of the Arduino Ethernet shield, http://192.168.1.177/ and then press Enter.
  9. You will see the following web page with a simple button named Power:
    Adding an IR socket to non-IR enabled devices
  10. Now, click on the Power button. The electric fan will turn on. Click on the Power button again to turn off the fan. Also, note that the address bar of the browser is changed to http://192.168.1.177/?key=power.
    Adding an IR socket to non-IR enabled devices
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.35.122