IR Remote and Arduino Control AC Voltage Device




Introduction: IR Remote and Arduino Control AC Voltage Device

About: revolutionary device designed to control AC Loads working on 110V/220V allowing to control High voltage AC loads using Microcontrollers Like AVR,PIC,STM32 or Electronics platforms like arduino,Raspberry pi,b...

One of the most interesting way to control many applications using IR remote control , you can find this way of control in TV , DVR,AIR conditioner, and more.

You can use any remote control you have on your home, or build one by your self, or even use your smartphone as IR remote"some android phones comes with IR Tx"

in this tutorial i would like to show you how to control any AC device and control it using IR remote control and Arduino
we will divide this experiment to:

  • Control AC device as a Switch ON - OFF.
  • Control AC output voltage "dimmer application.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Components

but first let's see what we want:

the components we need for this experiment are:

  1. Arduino Board"I used UNO"
  2. IR Rx TSOP3848
  3. Sugar device"to control AC device"
  4. RJ12 Cable & RJ Breakout.
  5. AC lamp and Lamp socket
  6. AC power cable C14
  7. LED 510R resistor.
  8. Breadboard
  9. solderless jumper

Step 2: Schematic and First Test

Let's test the IR RX and see what is the code that your remote send to arduino

The IR receiver sensor have 3 pin , VCC , GND , OUT , be careful when you connect the IR rx.

  • First we need to build the circuit.
  • then upload this library
  • then upload this code and open the serial

* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv * An IR detector/demodulator must be connected to the input RECV_PIN. * Version 0.1 July, 2009 * Copyright 2009 Ken Shirriff * */


int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver }

void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value }

  • then once you press the IR remote control you can detect the code for each button as you see in the pictures

in my case

Power on : 0xFB38C7

increase : 0xFBE01F

decrease : 0xFBE21D

why 0x in the beginning ? because the code in hex format

Step 3: You Love Sugar Device ? We Need Your Help

Sugar is a startup project , designed and Manufactured the Prototypes in Taipei - Taiwan and Now sugar need your help to become a real product in the market and bring a simple tools to control AC voltage.

Sugar comes in 2 different type:

  • Sugar300 : can Handle Up to 300 W
  • Sugar1000 : can Handle Up to 1000 W

and both type support AC output voltage control "For Dimmer applications" Hope you support us and become our backer Now on Indiegogo Campaign you can visit our campaign page .

Keep in touch with us on:




Youtube official accounts:

Visit Our website to see all features and tutorial and see the story behind sugar

Step 4: First Application for ON - OFF AC Switch

First application is to control the AC lamp ON OFF by pressing on POWER button , we can toggle the lamp status.

<p>/*<br> * Copyright 2009 Ken Shirriff
   Modifiy by M. Rawashdeh
   Sugar device Switch ON OFF application
 */</p><p>#include </p><p>int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
const int SugarPin=9;
const int LEDpin=8;
boolean Power=false;
void setup()
//  Serial.begin(115200);
  irrecv.enableIRIn(); // Start the receiver
}</p><p>void loop() {
  if (irrecv.decode(&results)) {
//   Serial.println(results.value, HEX);
  case 0xFB38C7:
  // power on/OFF
  Power= !Power;
   analogWrite(SugarPin,64) ;
   analogWrite(SugarPin,12) ;
  irrecv.resume(); // Receive the next value  

Step 5: Dimmer Application

for dimmer application we will use the Volume up and Volume down button to increase and decrease the brightness.

If you like the sugar device idea and application , why you don't support us onindiegogoand become our backer today, we will offer the dimmer code and many more application exclusively for our backers.

and this is the video for dimmer application

Be the First to Share


    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    3 Discussions


    3 years ago

    Thanks for the I'ble, I'll be doing something using Arduino and IR in a project soon, this will come in handy for reference.

    Sugar Device
    Sugar Device

    Reply 3 years ago

    you are welcome, happy to see your project soon and you can share the link here as well in the comments