Introduction: High Power Switching Control

Picture of High Power Switching Control

Controlling the triggering of a TRIAC using LABVIEW, ZIGBEE and ARDUINO Interface as an application to Home Automation System.

Step 1: Components Required

Main:-

3 Resistors - R1 = 360E, R2 = 470E and R3 = 39E

 Capacitor – C1=0.05uf, C2=0.01uf

 Opto-coupler – MOC3021

 TRIAC – 13BT26E

 Arduino Uno

 Lamp 40W

Extra:-

 ZIGBEE – X-BEE Series 0 2 (Mesh)

 XBEE shield for Arduino.

 LABView

 Visual Studio

Step 2: Triggering of TRIAC

  1. A simple circuit involving a TRIAC as the main component can be made for triggering of a Lamp connected to the mains (230V 50Hz supply)
  2. Switching the TRIAC connected to mains supply with microcontroller (TTL) requires isolation which is provided by opto-coupler.
  3. A Snubber circuit is applied at the end of the output of the opto-coupler. This prevents the unwanted triggering of the TRIAC due to noise.
  4. The control is provided by Arduino Micro-controller which communicates with the XBEE Coordinator node serially.
  5. Graphic User Interface is provided by LABVIEW. Which communicates with the XBEE Router Serially.

Step 3: Making the Hardware Circuit

Picture of Making the Hardware Circuit
  1. You can build this simple circuit using a bread board but please make sure its well isolated as we are playing with mains. All you need is some wires and the components.
  2. For final deployment or project submission you can consider soldering it.
  3. The most important thing to note here is the optocoupler's GND has to be connected with Arduino's ground.
  4. The IC used here is MOC3021.
  5. Make sure the light bulb is properly connected.
  6. Finally Check all the connections.

Step 4: Arduino

  • Arduino Uno's Pin 10 is connected with the optocoupler. (To MOC3021 Pin 1)
  • The ground should be common for Arduino and optocoupler. (MOC3021 Pin 2)
  • Following is the code in Arduino.
  • This code turns on light bulb when 'O' is passed serially (enter 'O' in serial monitor)
  • And likewise turns off the bulb when 'F'.
  • (12 is status LED.
  • 13 is opp of 12.)
  • (Mode 1,2,3 are in comments use them if you want to mess with the intensity of bulb)

void setup()
{
  Serial.begin(9600);
  Serial.print("jk");
  Serial.println("ie");
  Serial.println("Start");
  pinMode(10,OUTPUT);
  pinMode(12,OUTPUT);
  pinMode(13,OUTPUT);
}
void loop()
{ 
  if(Serial.available()>0)
  {
    char a=Serial.read();
    
    else if( a=='F')
    {
    Serial.println("OFF");
    digitalWrite(10,0);
    digitalWrite(12,0);
    digitalWrite(13,1);
    }
    else if( a=='O')
    {
    Serial.println("ON");
    digitalWrite(10,1);
    digitalWrite(12,1);
    digitalWrite(13,0);
    }
    if( a=='1')

*/ { Serial.println("ONE"); analogWrite(10,50); digitalWrite(12,1); digitalWrite(13,0); } else if( a=='2') { Serial.println("TWO"); analogWrite(10,100); digitalWrite(12,0); digitalWrite(13,1); } else if( a=='3') { Serial.println("THREE"); analogWrite(10,200); digitalWrite(12,0); digitalWrite(13,1); }

*/ } }

Step 5: XBee

As we are passing the command serially it can be easily made wireless using Xbees.

You will additionally require a Xbee sheild for Arduino.

Follow the following Tutoial to learn how to setup/configure Xbee.
XBee Tut

Step 6: Visual Basic

As we are passing the command serially it can be done without using Arduino IDE.

We can make a simple Visual Studio Windows Application that can create an interactive GUI.

For this you will have to use serial port.

Make sure the COM port is right and the baud rate as well.

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Using com8 As IO.Ports.SerialPort =
            My.Computer.Ports.OpenSerialPort("COM4")
            com8.WriteLine("O")
            BackgroundImage = System.Drawing.Image.FromFile("C:\Users\JWALANT\Desktop\bulbon.jpg")
        End Using
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Using com8 As IO.Ports.SerialPort =
            My.Computer.Ports.OpenSerialPort("COM4")
            com8.WriteLine("F")
            BackgroundImage = System.Drawing.Image.FromFile("C:\Users\JWALANT\Desktop\bulboff.jpg")
        End Using
    End Sub
End Class

Step 7: LABView

Finally if you want to make it seem more professional use LABView for serial communication.

The already available template for serial communication is used.

Step 8: Best of Luck !!!

Hope this tutorial was helpful for your project. This project can even be tried out with an android application.This tutorial concentrated mainly on the Hardware Part but I have tried to Include as many as ways possible to control. You can use your own micro-controller and some other GUI (maybe with voice command like JARVIS). But the hardware circuit will remain this same.

Comments

miftah (author)2016-01-11

nice bro, i want to make it for my final project

pfred2 (author)2015-09-05

Perhaps you could clarify this statement, "The most important thing to note here is the optocoupler's GND has to be connected with Arduino's ground." Are you suggesting that an Arduino can only sink current, and not source it? If that is true then it is a serious limitation indeed. Or did you just say it because of how your code is written?

jackspu (author)pfred22015-09-06

grounds between different devices often have to be "commoned" to enable the circuit to work.

pfred2 (author)jackspu2015-09-06

Oh OK you are sourcing current from your micro controller. It is funny that in absolutely every example circuit in their data sheet Texas Instruments is controlling the device from the cathode side. I guess they're old school just like I am. So they do not connect the cathode to the common ground, but rather to the output of a logic gate. What you're seeing there is the more often way that experienced electronics engineers do it. Which I do understand is not how most people tend to think about these things. But it is electrically the better way to go nevertheless.

JwalantB (author)pfred22015-09-08

jackspu's answer is absolutely right as floating led wont work

DIY Hacks and How Tos (author)2015-09-05

Nice control circuit

Thanks !

VictorD3 (author)2015-09-07

hi!!! very nice instructable indeed! i have a doubt though: whats the power rating for your resistors??? Thanks again!

JwalantB (author)VictorD32015-09-08

Thanks ! the rating is 1 W which is the common standard rating I guess

rafununu (author)2015-09-07

If you put 5V on the MOC LED without any resistor to limit the current you'll burn it in seconds.

To answer pfred2, Arduino is better when sourcing (as almost components). There's no need to connect "grounds", you can consider the MOC LED as a floating device, simply provide it some current !

About This Instructable

4,703views

86favorites

License:

More by JwalantB:High Power Switching Control
Add instructable to: