• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Arduino Bluetooth Remote Control Tutorial : Part I

By Abhishek Ghosh December 2, 2018 11:12 pm Updated on December 2, 2018

Arduino Bluetooth Remote Control Tutorial : Part I

Advertisement

Previously, we discussed how to use Wi-Fi module with Arduino and Arduino 4 channel relay. Making them working togather with smartphone not that easy. Bluetooth is Easier Than Wi-Fi From Programming Aspect To Build Wireless Electrical Switch. Here is Part I of The Arduino Bluetooth Remote Control Tutorial.

There are various bluetooth modules for Arduino including modules supporting BLE. A bluetooth module operates at 2.4GHz short-range radio frequency band. Bluetooth has a range around 30 meters. A commonly used module is HC 05 bluetooth module. HM-10 Bluetooth module supports BLE. The required Android App for the M-10 Bluetooth module is available on Google Play :



https://play.google.com/store/apps/details?id=appinventor.ai_Esdrastlc.BLE_ControPanell&hl=en_US


There is another application named BLE Scanner. Both of them are useful in testing and development.

Advertisement

---

Android 8.0 will not find some HM-10 clone BLE modules when scanning for them out of a a bug in the firmware of those modules. The HM-10 is a tiny 3.3-V BLE Bluetooth 4.0 module based on the TI CC2540/CC2541 Bluetooth SoC. It can be controlled via AT commands, which are sent over the serial UART connection. Most of the latest HM-10 modules, though, are based on the CC2541 chip, with lower power and a shorter range than the former CC2540 version. Cheap clones are cleverly pointed as CC2541, may be CC2540. Their hardware-firmware ombination has some issues (that is a long topic). Original HM-10 manufactured by Jinan Huamao technology Co.) is back version of the chip. Detecting clone is not closest to easy. You will see, original HM-10 itself has many versions :

http://www.jnhuamao.cn/bluetooth.asp

You should try to buy genuine HM-10.

 

Arduino Bluetooth Remote Control : First Wirelessly Control a LED

 

For this purpose, we need :

  1. One HM-10 Bluetooth module
  2. Arduino Uno
  3. Breadboard
  4. Jumpers
  5. One LED
  6. One 220 Ohm resistor

Connect HM-10 bluetooth module with Arduino Uno in this way :

Module’s VCC –> Arduino Uno’s 3.3V or 5V
Module’s GND –> Arduino Uno’s GND
Module’s TX –> Arduino Uno’s digital pin 10
Module’s RX –> Arduino Uno’s digital pin 11

Arduino Bluetooth Remote Control Tutorial

Test serial output with the above setup (without LED) with this sketch :

#include 
SoftwareSerial mySerial(10,11);
void setup()
{
mySerial.begin(9600);   
Serial.begin(9600);   
delay(100);
}
void loop()
{
if (Serial.available()>0)
mySerial.write(Serial.read());
if (mySerial.available()>0)
Serial.write(mySerial.read());
}

Install BLE Scanner App on Android mobile phone and scan. You will get the module. Default passcode to pair usually something like 123456789 or 0000000000 (9 zeros) or 111111111 (9 ones). After getting paired, you will get a list of services of the module. The last on the list will be “custom service”. On the custom service menu, there will three icons bearing the letters R (Read), W (Write) and N (Notify). Tap the W icon, type the text and send. The sent text will appear on the serial monitor. In this way, you can print data on LCD display too.

Many of the new readers, users noticed that AT commands used for these devices. AT commands in short is just sending command from the serial terminal.

Next, we will control LED from the Android Smartphone. Arduino already has a led at pin 13, so it is optional to connect the LED on breadboard with pin 13.

int ledPin = 13;
char read_bt;

void setup() {
  pinMode(ledPin, OUTPUT); 
  Serial.begin(9600);     // debug on serial port
}

void loop() { 
  if (Serial.available() > 0) {

  read_bt = Serial.read();
  if(read_bt=='A')
   digitalWrite(ledPin, HIGH);  

   if(read_bt=='B')
   digitalWrite(ledPin, LOW);  
  }
}

Notice the lines :

...
  if(read_bt=='A')
... 
   if(read_bt=='B')
...

A and B are custom labels of button on Android mobile. Any Android App for this purpose which supports editing of button name will work with it. We can control it from PC/Mac serial terminal too, this is example code :

#include 
int led = 13;

SoftwareSerial Bluetooth(10, 11);

void setup() {  
  Serial.begin(9600);
  Bluetooth.begin(9600);
  pinMode(led, OUTPUT);
}

void loop() {  
  int command;
  
  if (Bluetooth.available()) {
    command = Bluetooth.read();  
    Serial.println("Input received:");
    if (command != 0)
    {
      Serial.println("0 / ON");
      digitalWrite(led, HIGH);
    }
    else
    {
      Serial.println("1 / OFF");
      digitalWrite(led, LOW);
    }  
  }
}

This is the first part of the guide to get used around controlling DC operated device, like LED. Next guide will be on integrating the relay to control a test AC bulb.

Tagged With 8 channel relay arduino bluetooth control , bluetooth remote for arduino , arduino bluetooth remote control , arduino wireless remote control , bluetooth remote to control Arduino uno , arduino bluetooth part , arduino bluetooth remote , windows 10 remote arduino tutorials , arduino bluetooth controlled laptop , arduino as bluetooth transmitter

This Article Has Been Shared 783 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Arduino Bluetooth Remote Control Tutorial : Part I

  • Convert Computer Power Supply To Breadboard Power Supply

    Convert Computer Power Supply To Breadboard Power Supply. We Started From How To Start An ATX Or SFX PSU And Ended At Lab Bench Power Supply.

  • Arduino Compatible STM32 Boards (ARM Cortex Boards)

    Arduino Compatible STM32 Boards Has Dual Advantage of Being Arduino Compatible and Also Support For ARM Cortex Way of Programming. Of course they are cheap & Powerful.

  • Arduino : Make LED ON One at a Time Using a Potentiometer

    We Can Use the On-Board ADC to Convert Number Between 0 and 1023 Rotating Shaft. Here is How to Make LED ON One at a Time Using a Potentiometer With Arduino.

  • Arduino : Blink Two LEDs Alternatively

    Common Example of Arduino is To One LED. We Can Make Arduino To Blink Two LEDs Alternatively in Various Ways of Coding.

  • Arduino : Blink LED and Beep Every X Seconds Upon Push Button Press

    Previously we have shown beep with key press and LED lightening up and projects like Arduino Traffic Light, Arduino TM1637 with RTC. Here is How To Blink LED and Beep Every 1 Second With Arduino Upon Push Button Press. We Will Discuss Many Ways To Achieve The Goal Including Using RTC. Arduino has many ways […]

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (22.1K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Application Modernization : Cloud Can Take Your Applications to the Next Level July 5, 2022
  • Ways To Make Sure Your Online Course Outshine Others July 3, 2022
  • Will Smart Factories Become the New Assembly Line? July 2, 2022
  • The Cost of Doing Business as a Handyman July 1, 2022
  • Samsung Galaxy S22 Ultra: Long Term Review June 30, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Arduino Bluetooth Remote Control Tutorial : Part I," in The Customize Windows, December 2, 2018, July 5, 2022, https://thecustomizewindows.com/2018/12/arduino-bluetooth-remote-control-tutorial-part-i/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2022 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy