Instructables
Picture of How To Make A Computer Controlled Ac Outlet
IMG_20130417_183404.jpg
IMG_20130417_183409.jpg

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
IMG_20130417_174851.jpg
IMG_20130417_174907.jpg
IMG_20130417_174917.jpg
IMG_20130417_174940.jpg
IMG_20130417_174954.jpg
IMG_20130417_175008.jpg
IMG_20130417_175044.jpg
IMG_20130417_175055.jpg
IMG_20130417_175105.jpg
IMG_20130417_175109.jpg
IMG_20130417_175117.jpg
IMG_20130417_175125.jpg
IMG_20130417_175134.jpg
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
IMG_20130417_175311.jpg
IMG_20130417_175338.jpg
IMG_20130417_175355.jpg
IMG_20130417_175515.jpg
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
IMG_20130417_175638.jpg
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
IMG_20130417_175904.jpg
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
IMG_20130417_180711.jpg
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
IMG_20130417_180955.jpg
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 ();
}
 
Remove these adsRemove these ads by Signing Up
globrite1 year ago
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.