6. PROJECT: REMOTE MONITORING ELECTRICAL DEVICES USING
BLUETOOTH
As IoT is the new trend in the market. The main blocks of IoT
are :
1. Any wireless communication
2. MCU/MPU for processing and
software tools and
3. Relays to control 220 volt AC signal electrical devices by
3.2 to 5 volt DC signal.
I have chosen Bluetooth wireless communication because if embedded devices are enabled with Wi-Fi and Bluetooth,
they can communicate directly with a smartphone and it is cost effective. I
have taken mbed LPC11U24 as it is cost effective and fast in comparison to 8051
and AVR microcontroller. It allow others feature such as analogin, analogout,
PWMout, USB device, I2C, SPI, Ethernet etc.
6.1 Block Diagram of IoT using
Bluetooth
Fig 4: Block diagram of IoT using Bluetooth
6.2 Working Principle of IoT
using Bluetooth
The
Bluetooth module is being interface with MCU via serial pins (p5 & p6 in
mbed LPC11U24 and 1 & 2 in Arduino) as shown in fig 4. When we give supply
to Bluetooth module then Smartphone will detect it and we can paired with it.
Now install Google Play app ‘BlueTerm’ on Android Smartphone and connect
Bluetooth module with it as shown in fig 5 given below. This figure shows the
display screen of Blueterm.
This android application is similar to
HyperTerminal in PC. When we send command to Bluetooth as it is serial
communcaion, then microcontroller do work according to commands received by
BlueTerm app. The LCP11U24 ARM works on 3.2 volt which is very low for relay so
we require amplifying it by using transistors. The working of relay is
described in next topic and fig 6.
Fig 5: Display Screen
of BlueTerm on Smartphone
6.6 Flowchart
Fig
7: Flowchart of source code
7.2 Source code on mbed LPC11U24
#include<mbed.h>
Serial blue(p9,p10); // HC05
AnalogIn ain20(p17);
DigitalOut myled(LED1);
DigitalOut led5(p5);
DigitalOut myled2(LED4);
DigitalOut led6(p6);
float ADCdata;
int main()
{
while (1)
{
if
(blue.avialable())
{
if(blue.getc()=1)
{
blue.printf(" Red Bulb is ON
please press '2' to OFF ");
myled = 1;
led5=1;
}
if(blue.getc()=2)
{
blue.printf(" Red Bulb is
OFF please press '1' to ON ");
myled=0;
led5=0;
}
if(blue.getc()=3){
blue.printf(" Green Bulb is
ON please press '4' to OFF ");
myled2=1;
led6=1;}
if(blue.getc()=4)
{
blue.printf(" Green Bulb is
OFF please press '3' to ON ");
myled2=0;
led6=0;
}
if(blue.getc()=5)
{
blue.printf(" CHECK THE
STATUS OF LEDS ");
if(led5==1)
blue.printf(" Red Bulb is
ON please press '2' to OFF ");
if(led5==0)
blue.printf(" Red Bulb is
OFF please press '1' to ON ");
if(led6==1)
blue.printf(" Green Bulb is
ON please press '4' to OFF ");
if(led6==0)
blue.printf(" Green Bulb is
OFF please press '3' to ON ");
}
}
}
}



No comments:
Post a Comment