Interfacing BLE with android based device
Post on 12-Apr-2017
517 Views
Preview:
Transcript
All India Seminar on
Internet Of Things (IoT) Trends that affects Life
22-23 January 2016At
Bhaikaka Bhawan, IE(I), GSC, INDIA
Day 2 – Session: 1(10:00 AM to 10:45 AM)
Interfacing BLE with an Android based Device
by
Prof. Hemal ShahProfessor, Ganpat University
05/03/2023 2
Outline• Introduction to Bluetooth Low Energy (BLE) – What is LE Device?– Why BLE? – Role of BLE in IoT
• Hardware Samples - Beacons – Estimotes
• Accessing BLE Devices • Interfacing with Android based device – Read from and Write
in to Device Module – Demo– Output
05/03/2023 3
IoT- Architecture
Figure:1 Architecture [1]
05/03/2023 4
1. Perception layer/Physical Layer : Information origin and the core. All Information perceived and collected in this layer.
Ex : BLE ,wireless sensors network (WSN),RFID, ZIGBEE, Bluetooth etc.
2. Network layer : Access network and core network, provides transparent data transmission capability.
Ex: IPV4 and IPV6 Networks
3. Service layer : Application layer, includes data management sub-layer and application service sub-layer.
Ex: Smart Health, Smart Transport, Smart Home, Smart Crowd sensing
IoT- Architecture (Continue…)
05/03/2023 5
Bluetooth Low Energy(BLE) Protocol StackBluetooth Low Energy device is Hardware and Software.
Figure:2 BLE Protocol Stack [2]
Assigned numbers are used in GAP for inquiry response, manufacturer-specific data, advertising data, low energy UUIDs and appearance characteristics, and class of device.
ATT is a much lower level mechanism that basically defines how to transfer a unit of data (an attribute).
GATT is built on top of ATT and defines how higher level services are composed and the framework for operating on those services.
05/03/2023 6
Bluetooth Low Energy(BLE) (Cont..)
Role of Perception layer:• Manage Device Role (Master/Slave)• Enabling Advertisement Channels• Discoverability and convertibility modes• Advertisement of Interval and Data• Connection Interval, timeout, Slave Latency• Output Power
05/03/2023 7
Why BLE? [3]
Bluetooth LE NFC
05/03/2023 8
Technology
NFC RFID BT BLE Wi-Fi Zigbee WPAN WiMax
2G-3G
Power Low Low Low Low High Low Low High High
Speed (Kbps)
400 400 700 1000 100000
250 250 100000
5000
Distance covered in Meters
0.01 3 0 30 50-70 15 300 800 50000 Cellular Network depends
Cost to Build IoT
Less Less Less Less Average
Less Less High High
IoT Target Application
Payment Application, Share Details in short Distance
Product Identification, Tracking Segments
Data Exchange in Medium distance, with medium scale of data
Fitness Tracking, Health Monitoring
Interface with Internet, IoT Server communication
Automotive product support, Sensor Interface, Home Automation
Automotive product support, Sensor Interface, Smart City Automation
Interface with Internet, IoT Server communication
Interface with Internet, IoT Server communication
Figure 3 : Comparison of Different Communication Technologies [3]
Comparative measures of BLE with other Communication Technologies
05/03/2023 9
Bluetooth SMART READY support was Apple with their iPhone 4s. Since then, all of their devices iPads, iPhones, MacBooks and Apple TV too support BLE.
Samsung Galaxy series, Sony Xperia series and Google Nexus also started providing BLE functionality with the release of Android 4.3 API that came with BLE support.
BLE wearable Devices are:• Heart rate monitors • Smart watches • Fitness trackers
These devices send their tracking details to smartphone app of the wearer or other necessary party such as a personal physician.
Link1 Link2
BLE Applications
05/03/2023 10
What are Beacon?
• Beacons are Hardware Devices that can Emit and Receive BLE Signals [3].
• Beacons are BLE devices that can be placed throughout any ‘target’ area that emit a signal that can be detected by other BLE enabled devices.
• Depending on the beacon device and how
frequently it sends out a signal, the battery life can last for a year or longer.
• Certain mobile devices themselves can also act as a beacon that can both emit and receive signals.
05/03/2023 11
BLE Samples & Proximity
Estimotes Beacon
Micro Chip RN 4020
05/03/2023 12
Estimotes Beacon
• Estimote Beacon is a small computer [3].
• 32-bit ARM® Cortex M0 CPU with accelerometer, temperature sensor.
• 2.4 GHz radio using Bluetooth 4.0 Smart.
• Beacons can last more than 3 years on default settings on a single CR2477 battery.
05/03/2023 13
How we should access BLE? Purpose of accessing BLE Device:-
• Setup & Configuration of the UUID, Major, Minor values
•Discovery of Nearby Smart Device
•Connection Management & State Management of Smart Device
•Retrieve, understand and use characteristics •(Read/Write/Notify/Advertise) through Generic Attributes and Services (GATT Services)
•Naming and Addressing Devices
•Measurement of RSSI values of Nearby devices for Energy Modeling and Calculation for Energy Estimation
05/03/2023 14
Accessing Estimote Beacons
There are three ways to access:
1. Estimote App (Ex: NRF Master by Nordic) 2. Estimote Cloud (https://cloud.estimote.com/)
3. Estimote SDK (http://developer.estimote.com/)
05/03/2023 15
• Then on the Android Phone run any BLE app from • BLE Checker• BLE Scanner • BLE gatt • Nrf Master
• These all applications have the GATT Characteristics that is mainly supported by the BLE
• Generic Attribute Profile (GATT) is built on top of the Attribute Protocol (ATT)[2].
• GATT defines two roles: Server and Client.
Accessing Estimote BLE using Android APK
05/03/2023 16
Checking BLE Support with Android Phone using BLE Checker
05/03/2023 17
Discovery of Nearby Smart BLE Devices using BLE Scanner
05/03/2023 18
NRF Master Control Panel – GATT Server Configuration
05/03/2023 19
Sample GATT Server Configuration
05/03/2023 20
Generic Attributes (GATT) & Services – Clients (Node)
05/03/2023 21
Generic Attributes (GATT) & Services – Server(System)
05/03/2023 22
Generic Attributes (GATT) & Services – Server(System)
05/03/2023 23
Renaming Estimotes name using Android
05/03/2023 24
Renaming Estimotes using Android
05/03/2023 25
Renaming Estimotes name using Android
05/03/2023 26
05/03/2023 27Android Code of APK
05/03/2023 28
05/03/2023 29
Estimotes Setting through Estimote Cloud
05/03/2023 30
Estimotes Setting through Estimote Cloud (Cont..)
05/03/2023 31
References[1] Xiaolin Jia, Quanyuan Feng , Taihua Fan, Quanshui Lei, “RFID technology and its applications in Internet of
Things (IoT)”, Consumer Electronics, Communications and Networks (CECNet), 2012 2nd International Conference, IEEE, April-2012.
[2] https://www.bluetooth.org/tpg/RefNotes
[3] ”BLE/Beacons/ibeacon, Internet of Things”, Tim McKendrick ,Director of Project Management | Vectorform
[4] An introduction to beacon, Locolo,Beekn, www.BEEKn.net
[5] https://www.linkedin.com/pulse/what-bluetooth-low-energy-means-internet-things-premaratne
[6] Microchip RN4020 (Bluetooth Low Energy Module)- Guide, 2014 Microchip Technology Inc. , Advance Information ,DS50002279A.
[7] Saminath.V, Jung Su ,”Understanding of Internet of Things (IoT) and Experimental Approach using WICED Sense in Android Platform “, International Journal of Scientific and Research Publications, Volume 5, Issue 7, July 2015, ISSN 2250-3153.
05/03/2023 32
Acknowledgment
• Prof. Rahul Shrimali, Ph.D Scholar, Ganpat University• Prof. Umang Shukla, Asst Professor, SAL Engineering College• Ms. Jinal Patel, M. Tech. Scholar, Saffrony Institute of Technology
05/03/2023 33
Thank You
Reach Us:Hemal.shah@ganpatuniversity.ac.in
top related