The following are needed
- Arduino Any Arduino UNO compatible board should work.
- Arduino Bluetooth 4.0 BLE Shield
For Arduino UNO, please use the following jumper configuration:
For Arduino Mega 2560, please use the following jumper configuration:
- Set power switch to 5V when using Arduino UNO.
- Set HM-10 TX and RX to D2 and D3 respectively as shown.
- Save HM_10_Test.ino to your local computer.
- If you are using Arduino Mega 2560, change the code
SoftwareSerial ble(2,3); // For Uno, HM10 TX pin to Arduino Uno pin D2, HM10 RX pin to Arduino Uno pin D3
//SoftwareSerial ble(10,11); // For Mega 2560, HM10 TX pin to Arduino Mega 2650 pin D10, HM10 RX pin to Arduino Mega 2560 pin D11
to
//SoftwareSerial ble(2,3); // For Uno, HM10 TX pin to Arduino Uno pin D2, HM10 RX pin to Arduino Uno pin D3
SoftwareSerial ble(10,11); // For Mega 2560, HM10 TX pin to Arduino Mega 2650 pin D10, HM10 RX pin to Arduino Mega 2560 pin D11
Execute Arduino IDE, upload HM_10_Test.ino sketch.
After the sketch has been successfully uploaded, open Serial Monitor in Arduino IDE using 9600 baud rate. The Serial Monitor will display results similar to the image below:
Using a BLE enabled phone, pair and connect to the BLE Shield. The name and password for this example as seen from the result is BLE Shield and 000000 respectively. When the phone is connected to the BLE Shield, on the Serial Monitor, OK+CONN will be displayed.
- Windows Phone 8.1 with Bluetooth LE Explorer sample code.
- Asus Zenphone 2 Android 5.0 with Nordic nRF Master Control Panel
Step 1, execute nRF Master Control Panel, click connect on "BLE Shield", Shield's default name
Step 2, once connected, click on "Unknown Service" UUID 0000ffe0-0000-1000-8000-00805f9b34fb
Step 3, click WRITE, shown as UP ARROW BUTTON beside Unknown Characteristic
Step 4, select BYTE
Step 5, type 31, (hex code 0x31 is ASCII 1), and click SEND
Check for LED on D13 of Arduino turned on. Send 0x30 to turn off the LED.
Written by JP Liew
Product home: Arduino Bluetooth 4.0 BLE Shield
This software is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.