Introduction: Smart-home Remote Edition (Arduino)

This project represents the simple smart home solution you can make with the Arduino. This version has two units remotely connected via bluetooth. Master unit use Arduino Mega 2560 and for a slave unit you can use Uno, or some other clone with one TTL(Serial) interface.

The idea of the project:

You connect your phone or some other bluetooth capable device with one of 2 bluetooth modules which are connected to serials of the Mega 2560. Via bluetooth terminal or an application you control the Arduino.

Step 1: Connecting Hardware

Following the code below

Master

Two bluetooth modules are connected to the serial ports of the Mega, I used 2nd and 3rd TX, RX pins.

Loads are connected to the 4 relay modules to digital pins 26 and 27, I attached lights, you can attach whatever you want to the relay.

Slave

4 relay module connected to pins from 4 to 7.

HC-05 connected to the serial port.

Schematic is very simple. :D For power I used an Android phone charger (output 5.0 V, current-1A).

***As Arduino Mega has 4 serial ports you don' t have to use an external power source, you can power it through the USB port.

For UNO you must use an external power source as it has only one serial port.

Step 2: Configuring Bluetooth Modules (HC-05)

Before using, modules have to be configured. We are using 3 HC-05 modules because of their capabilities of being Master or slave module. You want one of the modules to be available for the external connection (smart phone) and the other to automatically connect with the slave module connected to the slave unit (receiver).

Modules are programmed by AT commands. You can find all of them in the module's manual.

Connect the HC-05 to the USB to TTL adapter or to your arduino in order to program it

When the module is connected, type:

AT+NAME (See the name);

AT+PSWD (see the password);

AT+ADDR //for the mac address, you will need it, write it down

AT+ROLE=0; (sets module to the slave mode, receives connection);


Now, you have to configure the module in the slave unit:

AT+NAME (See the name);

AT+PSWD (see the password);

AT+ROLE=0;

AT+ADDR (you will need it, write it down)

At the end you have to configure internal master unit:

AT+NAME (See the name);

AT+PSWD (see the password);

AT+ROLE=1; (sets module to the master mode, making connection)

AT+BING=mac address of the previous slave module. (connect automatically)

Step 3: Programming the Arduinos

Using the code attached, program the Master (Mega 2560) and the Slave (UNO).

You can always change the code if you want and add some new features. :D

Be free to ask for help! Enjoy!