Introduction: HC-05 (OR) 06 ENABLED SWITCH BY USING ATMEGA8 ARDUINO

About: i am mohanraj kpm from india i am styding in mechatronics engineering am lot of interest in making some interesting activities like arduino , coding
Ever thought of controlling any of your electronic devices with your
smart phone? Your robot or any other device? Won’t it be cool to control them with your smartphone? Here is a simple and basic tutorial for interfacing an Android Smartphone with Arduino via Bluetooth

Step 1: HC-06 Overview

  • Bluetooth V2.0
  • Working voltage: 3.3V
  • Current: pairing 20~30ma

The HC-06 Bluetooth module is also very simple to set up with an Arduino board. The module is suitable where wireless data transmission is needed in slave mode. The board can be accessorized with a USB to TTL serial cable to connect to your PC. And because we talk here about robots and how they can be controlled via Bluetooth connectivity, the board is useful for staying connected to a notebook as a master and control the robot with a slave module. The HC-06 module can reach a range of up to 9 meters (30 ft).

Step 2: REALY

A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a switch, but other operating principles are also used, such as solid-state relays.
Relays are used where it is necessary to control a circuit by a separate low-power signal, or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-transmitted it on another circuit. Relays were used extensively in telephone exchanges and early computers to perform logical operations.

A relay with several normally open (NO) contacts may stick when
energized, with some contacts closed and others still slightly open, due to mechanical tolerances. Similarly, a relay with several normally closed (NC) contacts may stick to the unenergized position, so that when energized, the circuit through one set of contacts is broken, with a marginal gap, while the other remains closed. By introducing both NO and NC contacts, or more commonly, changeover contacts, on the same relay, it then becomes possible to guarantee that if any NC contact is closed, all NO contacts are open, and conversely, if any NO contact is closed, all NC contacts are open. It is not possible to reliably ensure that any particular contact is closed, except by potentially intrusive and safety-degrading sensing of its circuit conditions, however in safety systems it is usually the NO state that is most important, and as explained above, this is reliably verifiable by detecting the closure of a contact of opposite sense.Force-guided contact relays are made with different main contact sets, either NO, NC or changeover, and one or more auxiliary contact sets, often of reduced current or voltage rating, used for the monitoring system. Contacts may be all NO, all NC, changeover, or a mixture of these, for the monitoring contacts, so that the safety system designer can select the correct configuration for the particular application. Safety relays are used as part of an engineered safety system

Step 3: CONECTING THE RELAY AND HC06 TO ARDUINO

Bluetooth to Arduino:

RELAY--ARDUINO

  • vcc--+5v
  • ground--ground
  • supply(mid-pin)--240v
  • NC(NORMALLY CLOSED)--BULB

HC06---ARDUINO

  1. tx-- rx
  2. rx--tx
  3. vcc--+5v
  4. ground--ground

There are three main parts to this project. An Android smartphone, a bluetooth transceiver and an Arduino.

HC 05/06 works on serial communication. Here the android app is designed to send serial data to the arduino bluetooth module when a button is pressed on the app. The arduino bluetooth module at other end receives the data and sends it to the Ardunio through the TX pin of bluetooth module(connected to RX pin of Arduino). The code uploaded to Arduino checks the received data and compares. If received data is 1 the LED turns ON. And it turns OFF when received data is 0. You can open the serial monitor and watch the received data while connected

NOTE:

instant of the LED change the relay for high application such as bulb , tv , etc..

Step 4: FINALY CODE

char data = 0;
void setup()

{

Serial.begin(9600);

pinMode(13, OUTPUT);

}

void loop()

{

if(Serial.available() > 0)

{

data = Serial.read();

Serial.print(data);

Serial.print("\n");

if(data == '1')

digitalWrite(13, HIGH);

else if(data == '0')

digitalWrite(13, LOW);

Step 5: Download Apk

for download the android app click here

Download the Application from the link

1. Turn ON HC 05/06 bluetooth module by powering the Arduino.

2. Scan smartphone for available devices.

3. Pair to HC 05/06 by entering default password 1234 OR 0000.

IoT Builders Contest

Participated in the
IoT Builders Contest

Arduino Contest 2016

Participated in the
Arduino Contest 2016