Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Sensor Data Monitoring on Android Phone

By Praveen Kumar, Chennai, India March 14, 2021

Mobile phones are so common these days and every new technology is connecting and overlapping with the mobile domain these days. Even many embedded systems projects are being under development which involves the use of smartphones. This project is about monitoring sensor data on an Android phone. The sensors used in the project are LDR and DHT 11 which allows monitoring light intensity, temperature, and humidity. The sensors are interfaced to an Arduino Pro Mini which relays the data to an Android phone with the help of an HC-05 Bluetooth module. 
The project also involves the development of a mobile application which is built using MIT App Inventor. The software allows developing a mobile app by just creating the interface and integrating code blocks. The app developed for the project can be downloaded from the Engineers Garage.
The Arduino code for the project reads the sensor data and transmit it to the Android phone through Bluetooth module. HC-05 is a serial Bluetooth module which transmits or receives data serially. The data is displayed on a single activity app under temperature, humidity, and light intensity headings. The same data is also displayed on an LCD display. 

Components Required – 

• Arduino PRO MINI
• 16×2 LCD
• HC-05 Bluetooth module
• DTH 11 sensor
• LDR sensor
• 7805 voltage regulators
• 5 mm LED
• 1K ohm Resistor

Block Diagram – 

Block Diagram of Arduino based Bluetooth Controlled Sensor Data Monitor
Fig. 1: Block Diagram of Arduino based Bluetooth Controlled Sensor Data Monitor  
                            

Circuit Connections – 

Prototype of Arduino based Bluetooth Controlled Sensor Data Monitor

Fig. 2: Prototype of Arduino based Bluetooth Controlled Sensor Data Monitor

The project involves an Arduino based circuit and an Android phone. The Arduino based circuit is assembled the following manner – 

Power supply – The power is provided by an 18V battery. The supply from the battery is regulated to 5V DC using 7805 voltage regulator IC. The IC has three pins – pin 1 should be connected to the anode of the battery, pin 2 and 3 with the cathode (common ground). The 5V DC should be drawn from the pin 3 of the IC. A LED along with a 10K Ω pull-up resistor can also be connected between common ground and output pin to get a visual hint of supply continuity.
16X2 LCD: The 16X2 LCD display is used to display the sensor’s data. It is connected to the Arduino board by connecting its data pins to pins 2 to 5 of the Arduino board. The RS and E pins of the LCD are connected to pins 13 and 12 of the Arduino UNO respectively. The RW pin of the LCD is grounded.
Table listing circuit connections between Arduino Uno and Character LCD
Fig. 3: Table listing circuit connections between Arduino Uno and Character LCD
The standard open-source library for interfacing LCD with Arduino board is used in the project. The library works as expected and needs no changes or modifications.
DHT-11 Temperature and Humidity Sensor – The DHT -11 sensor reads the ambient temperature and humidity and relays the data to the microcontroller as digital data. The data pin of temperature and humidity sensor DHT11 is connected to pin A0 of the Arduino Pro Mini and VCC and ground are connected to the common VCC and ground.
LDR Sensor – The LDR is used to sense the intensity of light. The sensor is connected to the A1 pin of Arduino board. The sensor is connected in a potential divider circuit. The LDR provides an analog voltage which is converted to digital reading by the inbuilt ADC.
HC-05 Bluetooth Module – HC-05 Bluetooth module is serial port protocol module. It operates on ISM band 2.4GHz with V2.0+EDR (Enhanced data rate). It can work in both Master and slave modes.  The Bluetooth module has six pins – Enable, VCC, Ground, Transmit Data (TxD), Receive Data (RxD) and State. The Enable and State pin are unused and so not connected in the circuit. The VCC and Ground pins are connected to the common VCC and Ground. The TxD and RxD pins of the module are connected to the pins 8 and 9 of the Arduino Pro Mini respectively.

How the circuit works – 

Image of Arduino based Bluetooth Controlled Sensor Data Monitor

Fig. 4: Image of Arduino based Bluetooth Controlled Sensor Data Monitor

When the circuit is powered on, the Arduino board loads the required libraries and start fetching data from the DHT-11 Temperature and humidity sensor and the LDR sensor. DHT11 Temperature and Humidity Sensor is a digital sensor with inbuilt capacitive humidity sensor and Thermistor. It relays a real-time temperature and humidity reading every 2 seconds. The sensor operates on 3.5 to 5.5 V supply and can read temperature between 0° C and 50° C and relative humidity between 20% and 95%. 

The sensor cannot be directly interfaced to a digital pin of the board as it operates on the 1-wire protocol which must be implemented only on the firmware. First, the data pin is configured to input and a start signal is sent to it. The start signal comprises of a LOW for 18 milliseconds followed by a HIGH for 20 to 40 microseconds followed by a LOW again for 80 microseconds and a HIGH for 80 microseconds.
After sending the start signal, the pin is configured to digital output and 40-bit data comprising of the temperature and humidity reading is latched out. Of the 5-byte data, the first two bytes are the integer and decimal part of reading for relative humidity respectively, third and fourth bytes are integer and decimal part of reading for temperature and the last one is checksum byte.
For Arduino, standard library for the DHT-11 sensor is already available. The data from the sensor can be easily ready by calling read11() method of the DHT class.
The LDR sensor is connected in a potential divider circuit and inputs a voltage at the analog input pin of the controller. The voltage is read and digitized using inbuilt ADC channel.
The Arduino sketch stores the sensor data in a set of global variables and transfers it to the Bluetooth module in a formatted string via serial communication. The same data is sent to the LCD module for display. The mobile app on the Android phone must be paired with the Bluetooth module. The Bluetooth module used in the project had a Mac address 05 20:15:01:30:17:25 for its unique identification and a password 1234 for pairing. Other Bluetooth modules also have Mac addresses and password for identification and pairing with other devices respectively. Once the Android phone is paired with the Bluetooth module on the circuit, the serially transmitted data from it is displayed on the main activity of the custom built app.
The transmission of sensor data is kept uninterrupted in the project and displays under temperature, humidity, and light intensity headers on the app’s main activity.
Check out the program code to learn how the Arduino reads data from the DHT 11 and LDR sensor and transmits it serially through Bluetooth module.

Programming Guide – 

The Arduino sketch imports SoftwareSerial library for virtual serial communication with Bluetooth module, LiquidCrystal library for LCD interfacing and DHT.h for handling temperature and humidity sensor. A LED pin is declared for testing transmission progress and an object of DHT type is declared.  An object for virtual serial communication is declared and mapped to pins connected to Bluetooth module. An object of LCD type is instantiated and mapped with respective Arduino pins. The variables to hold temperature, humidity and light intensity values are declared.
A setup() function is called in which the baud rate for serial communication with the Bluetooth module and LCD is set to 9600 bits per second and some initial text strings are printed on the LCD module.
Screenshot of Initializaation and Setup Function in Arduino Code for Bluetooth Controlled Sensor Data Monitor
Fig. 5: Screenshot of Initializaation and Setup Function in Arduino Code for Bluetooth Controlled Sensor Data Monitor
The loop() function is called in which the data from sensors is read by using standard library functions and stored in respective variables. The values stored in variables are displayed on LCD and serially transmitted to Bluetooth module for sending them to the mobile app. The mobile app receives the transmitted values on Bluetooth and displays them on the main activity of the app.
Screenshot of Loop Function in Bluetooth Controlled Sensor Data Monitor
Fig. 6: Screenshot of Loop Function in Bluetooth Controlled Sensor Data Monitor
You would find the complete code for Sensor Data Monitoring on Android Project in the source code tab.
Note: You may find the rar file Sensor Data mobile app in the attachment given below.

You may also like:


  • What are LoRa gateways and what types are available?

  • How does LoRa modulation enable long-range communication?

  • What are the different EV charging protocols?

  • What are the different types of EV charging connectors?

  • What types of motors are used in electric vehicles?

  • What is the role of embedded software in electric vehicles?

Project Source Code

###

//Program to 
#include  // Software Seral library

#include 

#include

const int ledPin = 13; // LED's

dht DHT;

#define dht_dpin A0

SoftwareSerial BTserial(8,9); // RX | TX

LiquidCrystal lcd(13, 12,5, 4, 3,2);// Pins used for RS,E,D4,D5,D6,D7

int humi,temp,data;

void setup() {

  Serial.begin(9600);

  BTserial.begin(9600);

  lcd.begin(16,2);

  lcd.setCursor(0,0);

  lcd.print("Engineers Garage");  

  lcd.setCursor(0,1);

  lcd.print("  BT CONNECTION ");

  delay(3000);

  lcd.setCursor(0,1);

  lcd.print("                "); 

  }



void loop(){

digitalWrite(ledPin, HIGH);

DHT.read11(dht_dpin); //read DTH11 data

data = analogRead(A1);

humi = DHT.humidity;   // DTH11 Humidity sensor data

temp = DHT.temperature; // DTH11 Temperature sensor data

lcd.setCursor(0,1);

lcd.print(humi); 

lcd.setCursor(7,1);

lcd.print(temp);

lcd.setCursor(13,1);

lcd.print(data);

BTserial.println(humi);

Serial.println(humi);

BTserial.print("|");

BTserial.println(temp);

Serial.println(temp);

BTserial.print("|");

BTserial.println(data);

Serial.println(data);

delay(1000);

digitalWrite(ledPin, LOW);

delay(50);

}

###


Project Video


Filed Under: Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • connector model question
  • value of feedback resistance in self biased inverter
  • Industrial Relay Board Design for Motorcycle Use
  • Sendust vs Ferrite for SMPS
  • sim7090g

RSS Electro-Tech-Online.com Discussions

  • using a RTC in SF basic
  • It's Amazing What A Buck And A Quarter....
  • Microinverters and storeage batteries?
  • ac current limiting
  • More fun with ws2812 this time XC8 and CLC

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • Infineon launches 3D magnetic sensors with ±50 mT to ±160 mT measurement ranges
  • Nexperia adds 1200 V 20 A silicon carbide Schottky diodes to power portfolio
  • EPC introduces 15 ARMS per phase motor drive in 32 mm diameter form factor
  • Non-contact angle sensors deliver +0.3% linearity across full measurement range
  • TDK introduces RGF board-mount EMI filters for high-current power supply applications

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe