Introduction: How to Make a Computer Controlled Ac Outlet

Picture of How to Make a Computer Controlled Ac Outlet


In this tutorial I will teach you hiw to controll a AC device with your computer

Step 1: Utilities

you will need

-arduino UNO microcontroller
-windows so or better
-no sodder breadboard
-jumpers
-alagator clips
-serial cord
-some sort of power supply
-exction cord
-cutter
-seeed relay sheild
-9v battery and hookup
-flathead screwdriver
-time
-the ability to code in C language
-motor or LED

Step 2: Lets Get a Nice Housing

Picture of Lets Get a Nice Housing

I used a cutter to cut the boc and put a hole in for a screw to hold in the arduino.

Step 3: Lets Get a Nice Housing

Picture of Lets Get a Nice Housing

I used a cutter to cut the boc and put a hole in for a screw to hold in the arduino.then I screwed the arduino in.

Step 4: Add the Seeed Relay Sheild

Picture of Add the Seeed Relay Sheild

I just had to cut the box so I could have room for the shild but it is a tight fit.

Step 5: Lets Wire It Up for a Test

Picture of Lets Wire It Up for a Test

The yellow jumper is the common wire and the green one is the noramly closed one. I like to keep normally closed positive,and the common negative it makes it much easier for me the one to the right of the yellow one is the normally open which without a current going through the relay is open so on the normally closed one without a current going to the relay is normally closed which means its off. The red and black wires are positive and negative the red one is positive the black one is negative. The red and black wires are used to switch the relays.

Step 6: Still Wiring for the Test

Picture of Still Wiring for the Test

The red and white wires are positive and negative the top green in the top blue are the ones that go to the motor the bottom green in the bottom yellow are the ones that go to the relays on the arduino.

Step 7: Lets Code It

Picture of Lets Code It

I went to my Windows XP computer for this because my Windows 7 computer currently crapped it's pants.

here is the code

void setup() {
 Serial.begin(9600);
pinMode(7, OUTPUT);
}

void loop() {
  while (Serial.available() == 0);
  
  int val = Serial.read() - '0';
  
  
  
  if (val == 2) 
  {
 delay(1000);
  }
    if (val == 1) 
  {
 Serial.println("Light on");
 digitalWrite(7 , HIGH);
  }
    if (val == 0) 
  {
    Serial.println("Light off");
    digitalWrite(7 , LOW);
  }
 
  else
  {
    
  }
Serial.flush ();
}

Step 8: Upload and Test

Picture of Upload and Test

Once you upload the code to the
arduino you can try it out by clicking the magnifying glass on the right top hand of the Aduino coding page it will bring you to serial they were you can input the number one, zero and or two to see if it activate or deactivate's the relay. Make sure you have the nine volt power supply on.

Step 9: Time for an Upgrade

Picture of Time for an Upgrade

Take a cord and cut it like this


Disclaimer
-I am not responsible for what mistakes you make if you are confused do not attempt if you are new working with AC power which can hurt/kill you.

Also the seeed relay sheild does have limitations read up on what your plugging in before you do it it may fry your stuff, I personaly limit my self to one plug.

Step 10: Wireing

Picture of Wireing

I cut a special hole in the top just to be safe.

Step 11: Lets Test It

Picture of Lets Test It

Just plug it in like you would normally and then type the code to turn it on or off into your computer.

if you have any questions regarding this subject here is my email
kylemoran06@gmail.com

Comments

globrite (author)2013-07-11

A nice alternative is to use a Wattstopper power unit which is UL approved, has zero voltage switching and as a bonus has DC output at about 150 mA to power your controller. One such unit (B-120 EP) is available from Amazon for about $15. - Enjoy.

About This Instructable

3,332views

23favorites

License:

Bio: Hi I'm kyle I'm 15 and I love technology and science. I stink at english the only reason I can spell english is ... More »
More by Thengineer:How To Make A Computer Controlled Ac Outlet
Add instructable to: