Got my Arduino! Controlling Arduino via Mobile Bluetooth
What is Arduino?
Arduino (/ɑːˈdwiːnoʊ/) is an open-source hardware and software company, project and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices. Wikipedia
I will be doing my projects with my Arduino UNO R3. This is the most popular Arduino board. Reasons why I prefer Arduino:
- Easy to work with the hardware and coding.
- There are thousands of projects already which you can refer to.
- If one has any issues regarding hardware or software part, posting it on Arduino website or stack-exchange will have answers quickly.
- Lots of Robotics and IoT projects using Arduino can be found online.
About the project
I intend to communicate the Uno from my Smartphone via Bluetooth. A simple way is to toggle the on-board LED.
Materials required
- Arduino UNO + USB cable
- HC-05 Bluetooth module
- Male/Female Jumper wires
Softwares required
- Arduino IDE : To upload to sketch (Arduino code) on to the board
- Arduino Bluetooth Controller : Android app to communicate via Bluetooth
Steps
- First of all download the Arduino IDE from Arduino IDE. Download the software according to your OS, and follow the steps on how to install. My system has Ubuntu OS.
- Connect your Arduino board via USB cable to your computer.
- Open the Arduino IDE. Click on Tools > Port, Here you should see your board if connected. Select your device.
- Now copy the code from here, and replace the default code in the IDE. Also save your code for future use.
- Click on the tick mark button, which will verify your code.
- Then on the right arrow button which uploads the sketch to the Arduino.
- Now your Arduino has the code burnt into it. You have to connect the HC-05 module to test the working. Follow the schematics image for the connections.
- First time paring to the bluetooth module should be done by the bluetooth settings in your mobile. The name of the conncection is HC-05. Use 1234 when it prompts for pass key.
- Now install the android app on to your smartphone.
- Open the app, and connect to the bluetooth module. Click on the refresh button on top right and choose the right connection to connect to the bluetooth module.
- In the app you have multiple ways to send input. For our case, sending 1 will turn on the LED and 2 will turn off the LED. Go to terminal tab in the app and send these values and observer the LED turn on or off.
- You can open the serial monitor to see what character is being sent to the module. To open serial monitor, click on the magnifying glass button.
Schematics diagram
Note
1. Do not connect the TX and RX pins on the Arduino board while uploading the sketch. It messes with the uploading process.
Working video
What next ?
Well, one can only be limited by their imagination. What we achieved here is not a small thing. We controlled Arduino via Bluetooth, that is wireless! Since Arduino coding is so simple, you can extend this into a RC car/robot or also build a Home automation system or even a quadcopter.
P.S: Find my Arduino project hub page here : @csbenk
Comments
Post a Comment