Skip to main content

Arduino : Connecting Arduino to HM-10 Bluetooth 4.0 LE module

We will learn more interesting stuff with Arduino and bluetooth. Basic stuff is connecting Arduino to HM-10 Bluetooth 4.0 LE module which also known as Bluetooth Smart and doing some serial communication. This module has has some interesting feature. Beside of it's reduced energy consumption, another feature that quite interesting is that we can use it as iBeacon.


You can learn more about this module by reading the datasheet here. You can tell the difference with the real one is that it has small crystal on it's board.


Mine looks like the one on the left, but it has no crystal component on it. But I can tell you it working just fine.

Here the breadboard wiring created using Fritzing.


Please note that we use digital pin 7 and 8 as serial RX and TX using SerialSoftware library, we can't use TX (pin 1) and RX (pin 0) because it used by computer through USB. 

And here what is looks like on real breadboard.


The power led will blinking when it's connected correctly. Note that the module has it's own breakout when I bought it. So it will safe to connect it directly to the Arduino 5V pin. On the market it may sold as just the module. You need to use 3.3V Arduino pin or you can create voltage divider circuit to drop voltage to 3.3V.

Test using your phone by enabling bluetooth. You should see the BT05 on your bluetooth device list like below. Note that this default bluetooth settings. I'll cover how to configure bluetooth on my next post.





To test serial communication between Arduino and phone follow below step.
  1. Download Arduino sketch here compile and upload.
  2. Open Serial monitor on Arduino IDE (Tools > Serial Monitor) use 9600 baud rate.
  3. Download MSMBle from Google Play Store, this app easy to use and just works, not like other app I have installed
  4. Start the app and scan for existing BLE device.
  5. Select service for bidirectional communication, so phone and Arduino can talk each other (Service UUID: 0000ffe0-0000-1000-8000-00805f9b34fb)
  6. Try to send text from MSMBle and it should displayed on Arduino Serial  monitor instantly
  7. Then try to send text from Serial Monitor and it also should displayed instantly on MSMBle app
If above test working, you have basic understanding on serial communication. You can create any device application controlled by phone. From home automation to robotics. The limit is just your imagination.

Here is the video demo.




Next post, I'll post how to control RGB led from Smartphone using bluetooth. Happy hacking!

Comments

Popular posts from this blog

Read temperature and barometric pressure from GY BMP 280 using Arduino

This sensor based on BMP 280 digital pressure sensor made by Bosch. You can find the complete datasheet here . This small sensor is quite impressive with it's accuracy. It claimed to be ±1 hPa in measuring barometric pressure, ±1.0°C in temperature measurement and ±1 meter in altitude accuracy. Pretty impressive right ?

Using LCD 2004a I2C on project with Arduino

On previous post measurement sensor results displayed on serial monitor. This is good when we are on development stage. When we want something more independent we need external display. I have purchased a few type of display. For now we will use LCD 2004 for external display.

RDA5807M FM radio module for Arduino

I was surprised with it's ability to receive FM radio broadcast without any problem in such a small module. The size is not bigger than a coin, really small. It may a bit difficult for wiring but it can be done. You can also add small power audio amplifier and use small speaker directly. Here is the module chip, small power amplifier in prototyping pcb.