Using Arduino with Parts and Sensors – Infrared Remote Control (Last Part)

Using Arduino with Parts and Sensors – Infrared Remote Control (Last Part)

Arduino Remote control


Last time, we learned how to use the infrared receiver module and an infrared LED. This time, let’s put what we’ve learned into practice by creating a “smart controller” that will be used as a remote control for our home appliances. I think that everybody has several remote controls in your home. When I did this project, I gathered all the remote controls in my home.

Today’s Electronic Recipe

Expected time to complete: 90 minutes
Parts needed:

Smart Controller Specifications

Let’s first determine the specifications.

  1. Use the numerical value from both the light sensor and the temperature sensor to create automatic process.
  2. Being able to operate the smart controller from computer or smartphone to use it with home appliances.

We’ll try to implement these two functions.

1. Sending a Remote Control Signal Depending on the Light Sensor Numerical Value

I can control the light with a remote control in the room I’m working in. I usually notices that at dusk, the room becomes darker and I have to use the remote control to turn on the light. And this happens every day. Let’s see how we could use a light sensor and send automatically a signal to switch on the light when the room is plunged into a certain darkness.

Let’s register the signal to turn on the light. Similarly to what we did last time, we’ll save in Arduino the code we analyze from the remote control infrared with the receiver module.


Picture 2 Light remote control and  Arduino

Next, we’ll write the sending program in the Arduino. Let’s make sure that we can turn on the light with Arduino. This time, we analyze the remote control “full light” signal to be sent.

When the remote control signal is ready, add the light sensor to the circuit. Then, create a program that will send the remote control signal when it’s becoming dark. We don’t want the light sensor to react when somebody just passes by it. To avoid that, let’s send the signal only when the state of darkness is continuous.  (Please refer to the following links for a detailed circuit description of the light sensor)

Figure 1 Light sensor and infrared LED transmitter circuit
Program: light will be turned on based on the light sensor value

Now, we’re done with our first specification: “sending a remote control signal depending on the light sensor condition” feature.

2. Sending a Remote Control Signal Through the Network

We can send a remote control signal depending on the light sensor. Now, let’s try to send  a remote control signal through smartphone or computer. Let’s turn Arduino into a server by using the Ethernet shield, that we used a few time already, and then let’s try to operate the remote control with the HTML displayed on the server.

Picture 3 Arduino Ethernet Shield

Let’s begin by operating Arduino as a WEB server, which will allow us to create a turn on/turn off an LED with some HTML displayed on the server. If we can do that, we can replace a part of the LED remote control signal to write a program.

※ In this program, we use the “TextFinder” in the library for text analysis. (Please refer to following link how to add a library)

Picture 4 Test circuit for turn on the LED from the web server

I was able to turn on and off the LED from the WEB server. Then, instead of the LED, I was able to update to send a remote control signal. Then, instead of the LED, by updating the program and circuit, I was able to send a remote control signal. When using the Ethernet shield, you should use the pin 4 and pin 10-13 and keep the other pins to create the circuit. Finally, below is the program that will combine the light sensor circuit input. Please try to change the signal and the HTML output depending on your remote control.

Program: Smart controller circuit

We’re able to operate from the WEB server!


We were able to successfully implement the second pattern in our smart controller and to use it. Now, our home appliances can be controlled automatically depending on the sensor value, and can also be controlled via smartphone or PC. This time, we have been using the light sensor. But we could have combined in with an ultrasonic wave sensor to turn on the light when somebody is there, or with a temperature sensor to turn on the electric fan when it’s becoming hot. These are some examples of features that can be implemented in the smart controller to make his usage more interesting.

Note: When operating smartphone or when doing automatic control, to prevent accident like fire, please experiment in the vicinity.