Introduction: Robo_Room (Room Automation)

I have always wanted to automate my room and have the ability to control lights and fans using my phone.


This project involves tampering with live AC Voltage (220VAC) which can kill you. I take no responsibility for any damage caused by this project and I suggest you only attempt this project if you have experience with electronics.

Lets start the project!

Step 1: The Parts Needed

Not many components are needed for this build and they are all listed below:

1. An Arduino board (I used the Arduino Uno)

2. A Relay module (I used an 12V 8 channel relay module for future expansion, a 5V module will be better)


If you have purchased a 12V relay module, you will also need:

1. A PNP transistor (I used a BC557) - 1 for each relay

2. A 1k resistor - 1 for each relay


3. A Bluetooth module (I used the HC-05)

4. 3 resistor of any value. These are for the HC-05. (I used 220ohm resistors)

5. A 12V power supply not exceeding the current of 2 9V batteries.

6. The appliances to be included

7. An AC plug

8. Screw terminals

9.Breadboard and connecting wires (the circuit can be soldered as well)

10. Electrical tape (for insulation)

Step 2: The Circuit

As shown above the circuit is quite simple. The transistor circuit and the 12V going to Arduino GND can be removed if you have a 5V relay module.

The Bluetooth module operated at a 3.3V logic level while the arduino operates at a logic level of 5V, thus the 3 resistors form a voltage divider in the circuit.

To Connect the Bluetooth Module.....

Connect the Rx pin to arduino Tx using the Voltage divider shown above

Connect the Tx pin to arduino Rx

Connect the Vcc to arduino 5V

Connect the GND to arduino GND

Step 3: The Arduino Code

In the code we must first define the variables for the connected relays and the data received via Bluetooth.

int relay = 13;

int relay2 = 12;

int state;

Then in the void setup, the pin mode must be defined and the serial communication must be initialized:

void setup()


pinMode(relay, OUTPUT);

pinMode(relay2, OUTPUT);



Next in the void loop, the data must be received and stored in the variable we made earlier:

void loop()

if (Serial.available() > 0)


state =;


Continuing with the void loop, the task to be executed for each data byte must be set, an example for one follows:

if (state == '1')


digitalWrite(relay, HIGH);


End the void loop with a closed curly bracket:


That is all for the code. You can add more functions for separate bytes of data.

Step 4: Results

Here are the results of the project. At the moment I am using an application called ArduinoRC on android to control the lights because I am still working on the personalized application.

If you can't view the video here, watch it using this link :

Step 5: Future Improvements

In the near future, I wish to connect more appliances to my project such as fans, etc. I would also like to control the room using my own application made using MIT app inventor.


YashP33 (author)2016-07-06

Sorry for the delay, I have posted the diagrams now..

ahmet_024102 (author)2016-07-04

can you show diagram good

YashP33 (author)ahmet_0241022016-07-04

Sure, I will split up the circuit and post the diagrams by tomorrow.