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,bea…

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.

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 * http://arcfn.com */

#include

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 https://igg.me/at/sugdev/x .

Keep in touch with us on:

Facebook: https://www.facebook.com/SugarWorld.net/

Twitter: https://www.facebook.com/SugarWorld.net/

Instagram: https://www.instagram.com/sugardevice/

Youtube official accounts: https://www.youtube.com/channel/UCDthbcEGR-r0NB49...

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

http://www.sugarworld.net

http://www.sugarworld.net/story-behind-sugar

http://www.sugarworld.net/features

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
  pinMode(SugarPin,OUTPUT);
  pinMode(LEDpin,OUTPUT);  
}</p><p>void loop() {
  if (irrecv.decode(&results)) {
//   Serial.println(results.value, HEX);
switch(results.value)   
{
  case 0xFB38C7:
  // power on/OFF
  Power= !Power;
  if(Power)
  {
   analogWrite(SugarPin,64) ;
   digitalWrite(LEDpin,HIGH);
   }
  if(!Power)
  {
   analogWrite(SugarPin,12) ;
   digitalWrite(LEDpin,LOW);
  }
  delay(1500);
  break;
  }
  irrecv.resume(); // Receive the next value  
}
}</p>

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