Difference between revisions of "Microduino BLE IOS-202KIT"

From Microduino Wiki
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
|
 
|
 
==Outline==
 
==Outline==
Project:Microduino BT communicates with IOS device
+
Project: Communication between Microduino-BT and IOS devices.
  
Objective:Passthough the Microduino Core and Microduino BT module's run time to IOS devices
+
Objective: To get the running time of Microduino-Core and Microduino-BT passed through to IOS devices via the serial port.
  
Difficulty:Elementary
+
Difficulty: Primary.
  
Time-consuming:Half an hour
+
Tim-consuming: 30mins
  
Maker:Microduino Studio-YLB
+
Maker: Microduino Studio-YLB
 
|-
 
|-
 
|
 
|
  
==Bill of Materials==
+
==Bill of Material ==
*Microduino equipment
+
*Microduino Equipment
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
|Module||Number||Function
+
|Module||Number||Function  
 
|-
 
|-
  
|Microduino-Core||1||Core board
+
|[[Microduino-Core]]||1||Core board  
 
|-
 
|-
|Microduino-FT232R ||1||Download program
+
|[[Microduino-USBTTL]] ||1||Program download
 
|-
 
|-
|Microduino-BT||1||Bluetooth communication
+
|[[Microduino-BT]]||1||Bluetooth communication
 
|}
 
|}
 
|-
 
|-
 
|
 
|
[[File:202KIT-module.jpg|600px|center|thumb|202KIT]]
+
[[File:Android-202KIT2-module.png|600px|center|thumb|202KIT图片]]
 
|-
 
|-
 
|
 
|
*Software package
+
*Software Equipment
Arduino IDE(1.0 release and upper), download LightBlue from App Store.
+
Arduino IDE(version 1.0 and higher), LightBlue downloaded from App Store
  
 
[[File:LightBlue.jpg|600px|center|thumb|LightBlue]]
 
[[File:LightBlue.jpg|600px|center|thumb|LightBlue]]
  
*Other equipment
+
*Other Equipment
**IOS device supports bluetooth 4.0 (iPhone4s upper, iPod touch 5 upper, iPad 3 upper, iPad mini upper)
+
**Support Bluetooth 4.0 IOS devices(iPhone 4s and higher, iPod touch 5 and higher, iPad 3 and higher as well as iPad mini and higher)
**micro usb data cable
+
**Micro USB cable
  
 
==Document==
 
==Document==
|-
+
Test program download:[[File:BT.zip]]
|
+
 
 
==Debugging==
 
==Debugging==
 
|-
 
|-
 
|
 
|
Step 1:Start Arduino IED, open the Microduino example program, board type choose "Microduino Core (Atmega328P@16M,5V)"
+
    Step 1: Stack Microduino-Core and Microduino-USBTTL together, connect them to a computer with a USB cable, start Arduino IDE, open test program M_ble_Serial.ino, select Microduino Core (Atmega328P@16M,5V) from (tools)-> (Board) and choose the corresponding serial port from(tools)-> (Serial) . After that, please click the button "√" on the top left of IDE, compile the program, and then click "√" to burn the program into the board;
 
|-
 
|-
 
|
 
|
[[File:ble-Download.jpg|600px|center|thumb|Download]]
+
[[File:ble-Download2.png|600px|center|thumb|Download]]
Step 2:After download the program, install the Microduino FT232R, Microduino-Core and Microduino BT, please power off firstly then install them.
+
 
 +
    Step 2: Stack all modules after the download, connect them to the computer with a USB cable and install after power-off.  
 
|-
 
|-
 
|
 
|
[[File:202KIT-system.jpg|600px|center|thumb|202KIT-system]]
+
[[File:202KIT-android-system1.jpg|600px|center|thumb|202KIT-OK]]
Step 3:Start to set the IOS device,start the bluetooth function on IOS device.
 
  
Step 4:Open LightBlue
+
Step 3: Start to set IOS device, get the Bluetooth function activated, install and open LightBlue App, then open the serial monitor in the IDE on the Computer Client. 
In "Central" tab find the "HMSoft", then set "Service"-"Characteristics";
+
 
Then you can see the debugging window, click the "Start Notify".
+
Step 4: Open LightBlue, enter Bluetooth device searching interface, find Microduino Bluetooth device from " Peripherals Nearby" and click to connect.  
 
|-
 
|-
 
|
 
|
[[File:ble-Connection.jpg|600px|center|thumb|Connection]]
+
[[File:ble-Connection.jpg|600px|center|thumb|Connection1]]
Connect successed, LED light.
+
Enter the following interface after the connection: 
|-
+
[[File:ble-Connection1.jpg|600px|center|thumb|Connection2]]
|
+
 
[[File:BlE-LED.jpg|600px|center|thumb|LED]]
+
Step 5: Select and click " Characteristic 6", watch the encoding format on the top right. If you see character string, please click Hex button (The default is Hex16 band encoding.) and choose UT-8 encoding format, then click " Listen for notifications " to enter monitoring state.
 +
[[File:ble-Connection5.jpg|600px|center|thumb|修改编码方式]]
 +
 
 +
Step 6: Click "Write new value" and pop up text editing interface.
 +
[[File:ble-Connection2.jpg|600px|center|thumb|文本编辑页面]]
 +
Enter an character string composed of letters and numbers, and watch result on the phone and the serial port.
  
 
==Result==
 
==Result==
ASCII data can be seen displayed: "BLE, Time: xxx" after connection success, where xxx is the Core and Shield BT4.0's running time in seconds.
+
[[File:ble-Connection3.jpg|600px|center|thumb|串口显示结果]]
[[File:Bluetooth-Data.jpg|600px|center|thumb|Bluetooth-Data]]
+
[[File:ble-Connection4.jpg|600px|center|thumb|手机端显示结果]]
 +
From the pictures above, you can see the serial port receives phone data "12345" and the phone also gets the Bluetooth data "Bluetooth respond", which means Bluetooth communication is bidirectional.
  
==Note==
+
==Caution==
*If keep the jumper(RX0、TX1), need unplug the Microduino BT4.0 module when download program, then install it after download.
+
*If you keep the default jumper wire (RX0,TX1), please unplug the Microduion-BT module while downloading, then power off and install after the download.
*If change the jumper, need to change the serial connection between Microduino BT4.0 and Core. Change the connection "TX-RX0、RX-TX1" to following:
+
*If adopting jumper wire changing method, then you can change the serial connection of Microduino-BT and Microduino-Core from TX-RX-, RX-TX1 to:
**TX-D2、RX-D3 (Core+'s Serial1)
+
**TX-D2, RX-D3(Serial1 for Core+
**TX-D9、RX-D10 (Call the SoftwareSeria libray to resolve)
+
**TX-D4, RX-D5(You can use SoftwareSeria library to handle it.)
  
 
[[File:Bluetooth-Connection.jpg|600px|center|thumb|Bluetooth-Connection]]
 
[[File:Bluetooth-Connection.jpg|600px|center|thumb|Bluetooth-Connection]]
 
|}
 
|}

Latest revision as of 05:37, 30 September 2016

Language: English  • 中文

Outline

Project: Communication between Microduino-BT and IOS devices.

Objective: To get the running time of Microduino-Core and Microduino-BT passed through to IOS devices via the serial port.

Difficulty: Primary.

Tim-consuming: 30mins

Maker: Microduino Studio-YLB

Bill of Material

  • Microduino Equipment
Module Number Function
Microduino-Core 1 Core board
Microduino-USBTTL 1 Program download
Microduino-BT 1 Bluetooth communication
202KIT图片
  • Software Equipment

Arduino IDE(version 1.0 and higher), LightBlue downloaded from App Store;

LightBlue
  • Other Equipment
    • Support Bluetooth 4.0 IOS devices(iPhone 4s and higher, iPod touch 5 and higher, iPad 3 and higher as well as iPad mini and higher)
    • Micro USB cable

Document

Test program download:File:BT.zip

Debugging

   Step 1: Stack Microduino-Core and Microduino-USBTTL together, connect them to a computer with a USB cable, start Arduino IDE, open test program M_ble_Serial.ino, select Microduino Core (Atmega328P@16M,5V) from (tools)-> (Board) and choose the corresponding serial port from(tools)-> (Serial) . After that, please click the button "√" on the top left of IDE, compile the program, and then click "√" to burn the program into the board;
Download
   Step 2: Stack all modules after the download, connect them to the computer with a USB cable and install after power-off. 
202KIT-OK

Step 3: Start to set IOS device, get the Bluetooth function activated, install and open LightBlue App, then open the serial monitor in the IDE on the Computer Client.

Step 4: Open LightBlue, enter Bluetooth device searching interface, find Microduino Bluetooth device from " Peripherals Nearby" and click to connect.

Connection1

Enter the following interface after the connection:

Connection2

Step 5: Select and click " Characteristic 6", watch the encoding format on the top right. If you see character string, please click Hex button (The default is Hex16 band encoding.) and choose UT-8 encoding format, then click " Listen for notifications " to enter monitoring state.

修改编码方式

Step 6: Click "Write new value" and pop up text editing interface.

文本编辑页面

Enter an character string composed of letters and numbers, and watch result on the phone and the serial port.

Result

串口显示结果
手机端显示结果

From the pictures above, you can see the serial port receives phone data "12345" and the phone also gets the Bluetooth data "Bluetooth respond", which means Bluetooth communication is bidirectional.

Caution

  • If you keep the default jumper wire (RX0,TX1), please unplug the Microduion-BT module while downloading, then power off and install after the download.
  • If adopting jumper wire changing method, then you can change the serial connection of Microduino-BT and Microduino-Core from TX-RX-, RX-TX1 to:
    • TX-D2, RX-D3(Serial1 for Core+)
    • TX-D4, RX-D5(You can use SoftwareSeria library to handle it.)
File:Bluetooth-Connection.jpg
Bluetooth-Connection