Arduino Mad Scientist Laboratory EP #5 Bluetooth Controlled 110V AC Power Outlet

Today we will be trying to take over the world by building this Smartphone Bluetooth controlled Outlet.

 

Check us out on Facebook!

Parts List:

affiliate links

ARDUINO Board

Relay

HC-06 Bluetooth Module

Logic LVL Converter

Cell Phone Charger

Point to Point Solder Bread Board

110V electrical Output Socket

Cover Plate

6″ of 3″ PVC Pipe

3″ PVC end Cap

3″ pvc Knock out end Cap

3″ Toilet Bracket thingy

Power Cord

Screws

Wire

Solder

 

ARDUINO Code:

#define relay 2
int state = 0;
void setup() {
Serial.begin(9600);
pinMode(relay, OUTPUT);

}

void loop() {
if (Serial.available() >= 2 )
{
unsigned int a = Serial.read();
unsigned int b = Serial.read();
unsigned int val = (b * 256) + a;

if (val == 1234 && state == 0) // relay on
{
digitalWrite(relay, HIGH);
state = 1;
}

else if (val == 1234 && state == 1) // relay off
{
digitalWrite(relay, LOW);
state = 0;
}}}

The APP:

 

Click here to download the APP

 

 

Click on a picture below to enlarge it: