Skip to content

Android mobile application acting as the client for EnvironmentalSensing peripheral sensor data, specifically from Temperature and Humidity sensors via BLE. Here, Arduino Nano BLE Sense is used as the server that provides the EnvironmentalSensing data.

License

Notifications You must be signed in to change notification settings

ranitraj/SmartThermostat

Repository files navigation

SmartThermostat

This repository is an Android mobile application which demonstrates the mechanism to receive data from the inbuilt sensors (temperature and humidity) embeddded in an Arduino-Nano 33 and display the same in the Android device using Bluetooth LE.

Peripheral and Client

Peripheral

  • Arduino-Nano 33 BLE Sense, which advertises data. (GATT Server) [Refer: BLE_Thermostat.ino file in ArduinoBlePeripheralForAndroid repository]

Client

  • The mobile application, which receives data advertised by the peripheral device. (GATT Client) [Refer: Current Repository]

Features in the application:

  1. Scan for BLE devices broadcasting Environmental-Sensing Service
  2. Connect to the BLE device
  3. Receive data advertised by the peripheral
    • Environmental-Sensing Service
      • Temperature (Characteristic Property: Read and Notify)
      • Humidity (Characteristic Property: Read and Notify)
    • Device-Information Service
      • Manufacturer Name (Characteristic Property: Read)
      • Manufacturer Model (Characteristic Property: Read)
    • LED Service (Custom Service)
      • LED Status (Characteristic Property: Write)

Implementation:

  • Activity:
    • MainActivity - Allows user to scan for BLE devices of type Environmental-Sensing via Dialog and display them in BleDeviceAdapter along with data from BLE peripheral
  • Service:
    • BleConnectivityService (Bounded-service) - Performs asynchronous operations of connecting, disconnecting and receiving data from the peripheral and, communicates with the UI via Broadcast-Receiver
  • Broadcast-Receivers:
    • AclBroadcastReceiver - Broadcasts global events of connection and disconnection of BLE devices

Screenshots:

WhatsApp Image 2021-06-28 at 21 27 43 WhatsApp Image 2021-06-28 at 21 27 53 WhatsApp Image 2021-06-28 at 21 28 03 WhatsApp Image 2021-06-28 at 21 28 15 WhatsApp Image 2021-06-28 at 21 28 25 WhatsApp Image 2021-06-28 at 21 28 35 WhatsApp Image 2021-06-28 at 21 28 44 WhatsApp Image 2021-06-28 at 21 28 54

License:

Copyright 2021, Ranit Raj Ganguly

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Android mobile application acting as the client for EnvironmentalSensing peripheral sensor data, specifically from Temperature and Humidity sensors via BLE. Here, Arduino Nano BLE Sense is used as the server that provides the EnvironmentalSensing data.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages