WHAT'S NEW?
Loading...

Arduino Wireless LED Control with Smart Phone


Hello, 

If you have been wondering about controlling your Arduino project with your Android phone or a Smart phone and make your arduino project even cooler, here is a simple arduino tutorial to control a led with arduino uno and android app, and make it a wireless led control project.

This is the next level arduino project for arduino users worldwide. Once you learn how to control a LED with computer, you should move on to the wireless arduino led project.


Watch the Video for demonstration:
              




For Android controlled Arduino projects, you will need a few basic components listed below :


1. Arduino board (Uno R3 or any other)



2. BT HC-05 Module (dummy works fine)


3. Android smart phone (v2.3 or higher)


4. LED (red, green or blue)


5. Breadboard


6. Jumper cables
    Bluetooth Module

Arduino Uno Board R3
Components required for arduino project

The Medium of communication between Arduino and the Android application is Bluetooth so you will need an android application installed in your smart phone that will be used to send the data over Bluetooth to Arduino. You may download the app from play store (Arduino Bluetooth, Arduino RC etc) or the better option would be to go ahead and create your very own Android application to talk to your Arduino.

Step 1: Making the Circuit


  1. Connect the LED positive (longer end) to the pin 13 of the Arduino board. You  may change the output pin along with the code.

2.Connect the LED negative (shorter end) to the ground pin of the Arduino board.

3. Connect the Vcc of the BT HC-05 Bluetooth Module to the 3.3 V pin of the Arduino and  Ground of the Bluetooth Module to the ground pin of the Arduino.



Primary circuit of the arduino project

Note : Do not connect the Tx and Rx pins of the Bluetooth Module to the Arduino board. Wait till you upload the code.



Step 2: Uploading the code



Connect your Arduino board to your computer/laptop and open the Arduino Software or arduino development environment and paste the following arduino code:


int led = 13; // Pin 13
     
void setup()
{
    pinMode(led, OUTPUT); // Set pin 13 as digital out
     
    // Start up serial connection
    Serial.begin(9600); // baud rate
    Serial.flush();
}
     
void loop()
{
    String input = "";
     
    // Read any serial input
    while (Serial.available() > 0)
    {
        input += (char) Serial.read(); // Read in one char at a time
        delay(5); // Delay for 5 ms so the next char has time to be received
    }
     
    if (input == "on")
    {
        digitalWrite(led, HIGH); // on
    }
    else if (input == "off")
    {
        digitalWrite(led, LOW); // off
    }
}


Now, upload the arduino code to your arduino board and check it using serial monitor.

When you type "on" in the serial monitor, the LED should glow and when you type "off" in the serial monitor, the LED should be turned off.



Step 3: Controlling LED with your Smart Phone



Now, we come to the final step where you control the LED with your android Smart Phone and make this arduino project a wireless arduino LED project.



Final circuit of the arduino project

1. Connect the Tx pin of the Bluetooth Module to the Rx pin of the Arduino board.

2. Connect the Rx pin of the Bluetooth Module to the Tx pin of the Arduino board.

3. Open any arduino bluetooth application in your smart phone and search for nearby Bluetooth devices, pair up with HC-05 with the code '0000' or '1234'.

4. Give commands via pressing buttons, you may also add gestures or even use smart phone's accelerometer sensor to give commands.

Remember to close the serial monitor window when you switch to the wireless arduino project part in the above step of this arduino tutorial.

And, you are good to go, play with it all day or make it bigger by adding more LEDs or motors. It's all yours !

This wireless arduino project is also a good project for final year engineering projects in Electrical engineering projects or Electronics and Communications Engineering projects.

If you have any questions regarding arduino code, arduino programming, arduino projects, arduino pdf, arduino uno board or any other arduino tutorial kindly ask your doubts in the comments below.


Watch the Video for demonstration:

              

Stay hungry! Stay foolish!

0 comments:

Post a Comment