Unit-3.1 - New
Unit-3.1 - New
Unit-3.1 - New
CO1 Students in this class will develop fluency with the Understand
physics of small robots, an understanding of
physical inputs and outputs, and programming
tools that enable autonomous behavior.
CO2 Specific topics will include digital I/O, serial I/O Analyzing
protocols, and analog-to-digital conversion and
interrupt mechanisms. course will be employed to
provide hands-on experience and active learning
techniques.
CO3 Students will be able to develop applications like Analyzing
having sensing and decision making capabilities 2
Bluetooth
Interfacing
Arduino with
Bluetooth to Control
an LED
3
Ever thought of controlling any electronic devices
with your smart phone? Today I will show how to
do it.
4
LET’S START
BUILDING
Components and supplies
5
LET’S START
BUILDING
The circuit is so simple and small,
there are only a few connections to
be made
Arduino Pins Bluetooth Pins
RX (Pin 0) ———-> TX
TX (Pin 1) ———-> RX
5V ———-> VCC
GND ———-> GND
Connect a LED negative to GND of
Arduino and positive to pin 13 with a
resistance valued between 220Ω –
1KΩ. And you're done with the circuit
6
Android APP
https://appinventor.mit.edu/
7
Arduino Code
/*
* This program lets you to control a LED on pin 13 of arduino using a bluetooth module
*/
8
Arduino Code
char Incoming_value = 0; //Variable for storing Incoming_value
void setup()
{
Serial.begin(9600); //Sets the data rate in bits per second (baud) for serial
data transmission
}
11
Arduino Code
void loop()
{
if(Serial.available() > 0)
{
Incoming_value = Serial.read(); //Read the incoming data and store it into variable
Incoming_value
12
Arduino Code
if(Incoming_value == '1') //Checks whether value of Incoming_value is equal to 1
}
}
13
How Does it Work
14
How to use the App
Download the Application
Pair your device with HC 05/06 Bluetooth module
Turn ON HC 05/06 Bluetooth module
Scan for available device
Pair to HC 05/06 by entering default password 1234 OR
0000
Install LED application on your android device
Open the Application
Press paired devices
Select your Bluetooth module from the List (HC 05)
15
Arduino Code
• Rather than just turning LEDs on and off rapidly using digitalWrite(), we can define the level
of brightness of an LED by adjusting the amount of time between each LED’s on and off
states using pulse width modulation (PWM).
• The greater the duty cycle (the longer the pin is on compared to off in each cycle), the
greater the perceived brightness of the LED connected to the digital output pin.
16
REFERENCES
https://projecthub.arduino.cc/mukeshkp2005/arduino-with-bluetooth-to-control-an-led-a7ad0a
17
THANK YOU