You are on page 1of 10

technology workshop craft home food play outside costumes

Control AC dimmer Lamp using Arduino


by Sugar Device on December 10, 2016

Table of Contents

Control AC dimmer Lamp using Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Control AC dimmer Lamp using Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: What is Sugar ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: How to connect Sugar device ? Is it complicated ?! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 4: Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Step 5: You Love sugar Device ? we need your help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 6: Code and demo Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
Author:Sugar Device Sugar World
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,beaglebone,teensy ,IOT platforms and More. Sugar can control AC voltage as ON -OFF
Switch or control AC Output voltage for an application like AC Dimmer , AC Motor speed control

Intro: Control AC dimmer Lamp using Arduino


For Many projects, you want to control some application works on AC Voltage ,Like AC Lamps , but working with High voltage is very dangerous if you connect any thing
wrong or touch any AC component / naked wire which cause electrical shock

but today in this tutorial we will see how to control AC dimmer lamp using arduino in simple way and simple connection and simple programming code.

also you can integrate this code and hardware connection easily in your project , like Home automation , IOT, develop smart phone application and more.

Let's start with Component we need

Step 1: Components
The components we need to do this experiment are:

1. Sugar device (Sugar300 or Sugar1000).


2. C14 Power cable
3. RJ12 Cable
4. Sugar RJ breakout
5. Dimmable AC Light Bulb.
6. Light bulb socket
7. Arduino Board"I will use Uno here"
8. Potentiometer 10K
9. Braedboard
10. Solderless Jumper

Now you ask your self:But what is Sugar device ? how it works and how to connect and program it ?

Now we will answer these questions

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
Image Notes
1. Sugar Device "Sugar1000"
2. light bulb socket
3. Dimmable AC bulb
4. Arduino Uno
5. Sugar RJ12 Breakout
6. solderless jumper
7. RJ12 Jumper
8. C14 Power cable
9. Breadboard
10. Potentiometer

Step 2: What is Sugar ?


Sugar is revolutionary device designed to control AC Loads working on 110V/220V ,Designed especially For Students , teachers , Engineers and Makers How are looking
for a tool to Control AC Voltage and to be easy to connect and easy to program.

With Protect cover case sugar offers a high level of safety,No electrical shock could happen and allow to anyone want to learn , design and innovate any AC power
project.

Sugar can be controlled through RJ12 Connector , and control The AC Output voltage using PWM , so just send PWM signal to sugar , and you will be able to control the
device connected to Sugar in this way.

Sugar can control AC voltage in 2 different Way:

1. Control AC voltage as a Switch ON - OFF


2. Control Output voltage which is suitable or many Application like AC Lamp dimmer , AC Motor speed control , AC heater temperature control.

Sugar with this features and be controlled from any Electronics platforms , Like MCU (AVR , PIC, STM ,Ti ) or Development Board (Arduino , Raspberry Pi , Beagle bone
, teensy , ARM ) all you need is PWM Signal to control Sugar device.

You can Read more About the features of sugar in our official website

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
Step 3: How to connect Sugar device ? Is it complicated ?!
the answer is simple , No ,All you need is

connect C14 power cable to power supply ,


connect RJ12 Cable to sugar and then you will be ready to use Sugar device

With Sugar RJ breakout you can connect the Male header to any type of controller you have.

Attention: Sugar device offers a high protection from High voltages for the users, but also it's worth to remind you the AC voltage is very dangerous so be safe.

Now we can move to schematic

Image Notes
1. Sugar RJ breakout

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
Image Notes
1. Sugar RJ breakout
2. RJ12 Cable

Step 4: Schematic
schematic for controlling circuit is very simple

all you need now is send PWM Signal from Arduino D9 to sugar to control the brightness of the lamp

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
Step 5: 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 by back us in Indiegogo Campaign in 28th December 2016, we will update the artical when the campaign launch

Keep in touch with us on Facebook ,Twitter , Google+ , Instagram , Youtube official accounts

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

Step 6: Code and demo Video


Well we will write a code to control The brightness of the lamp

Let's take a look to the code :

//.......................................................................

/*
Simple code to demonstrate how to control Sugar Board using Arduino Uno to CONTROL DIMMABLE LAMP using push Potentiometer attached to pin A0 pin A0 >>>
POT to control the the brightness this code is valid for D3,D9,D10,D11 pin only written by Mohannad Rawashdeh (Raw) */

const int SugarPin =9;

const int Sugar_Tog =A0; /* the brightness value between 12 to 64 12 means 0% 64 means 100% */

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
int brightness=12;

const int delayTime=2000;

void setup()

{ // define arduino PWM as an output

pinMode(SugarPin,OUTPUT);

//define Pot as an input

pinMode(Sugar_Tog ,INPUT);

analogWrite(SugarPin,brightness);

delay(50);

void loop() {

// read Pot

int PotTog =analogRead(Sugar_Tog);

//delay between each reading

delay(50);

int PWM_value=map(PotTog,0,1023,12,64);

brightness=constrain(PWM_value,12,64);

analogWrite(SugarPin,brightness);

delay(delayTime);

//.......................................................................

as an instruction for the code , to turn on light we wrote :


analogWrite(SugarPin,64);

To turn off light we wrote :

analogWrite(SugarPin,12);

To turn light on with 50% brightness we wrote :

analogWrite(SugarPin,38);

To turn light on with 75% brightness we wrote :

analogWrite(SugarPin,50);

for more information about the code , you can refer to our artical about how to control Sugar device using Arduino uno to see how to get these values.

And you can see the video for the same code

Thank you so much , hope you share the project for your friends and tell us your opinion about it

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
Related Instructables

PWM Lamp
Arduino Dimmer using Adjustable
controlled light NE555 Timer by Power Outlet by
Very simple
AC PWM safe and simple dimmer by Electronics Hub PWM with DIY Hacks and
dimmer for AC PWM diy_bloke 555...Modulate How Tos
Arduino by Dimmer for
arduino / every thing by
diy_bloke shams
Raspberry pi by
Jestin_Cubetech

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/
Advertisements

Comments
2 comments Add Comment

DIY Hacks and How Tos says: Dec 10, 2016. 6:51 PM REPLY
This is really cool. This kind of dimming system would be the perfect thing to make a sunrise/sunset light alarm clock.

Sugar Device says: Dec 11, 2016. 1:39 AM REPLY


Thank you

http://www.instructables.com/id/Control-AC-Dimmer-Lamp-Using-Arduino/

You might also like