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

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.

Arduino : Controlling PL9823-F8 RGB LED

I have great passion about electronics since I was in middle school then high school. With some of my school friend that has same passion in electronics, we built radio transmitter so we can communicate each other at anytime. It was so cool back then. Thats why I took study on electrical Engineering. Instead of working on Electrical engineering field, I end up become web programmer. Something I found interesting when i was in college. That's old story. But lately I get bored and try to get another hobby. I have many hobbies and creating electronics stuff is one of it. So I bought my self Arduino Uno and few electronic components to get started learning Arduino programming. So my first project is controlling RGB Led. Here what you need: Arduino Uno with usb data cable and Arduino IDE Install Adafruit Neopixel library 3 PL9823 RGB led Breadboard Jumper cables (mostly male to male) First you need to install Arduino IDE. You can download it here .  That would depend

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 ?