Bluetooth activates switch

Does anyone know a way I can get Arduino to activate a switch when it sees the Bluetooth signal from my phone?

1. Connect BT with your UNO as per Fig-1.

hc05-UNO
Figure-1:

2. Complete the following sketch and then upload it.

#include<SoftwareSerial.h>
SoftwareSerial SUART (10, 11);  

void setup()
{
    //write codes here as needed
}

void loop()
{
    1. Place code to check that a character has arrived from Phone/BT.
    2. When 7 characters are available, then save them in a null-character 
       terminated array.
   3. Check that the received string matches with "closeK1". 
   4.  If  Step-3 is satisficed, turn on relay-K1/L connected with DPin-13.
}

3. Pair your Android Phone with BT.
4. Send "CloseK1" message from Phone.
5. Check that relay-K1 connected with DPin-13 is activated (L connected at DPin-13 is ON).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.