CMPE 277 SMARTPHONE APPLICATION DEVELOPMENT
In this project, we have designed a Cloud - IoT based environmental monitoring system mobile app. DHT11 sensors are used to get the current temperature and humidity values. These input values from the DHT11 sensor are interpreted by the NodeMCU- ESP2866-12E module. Arduino C code is downloaded to the NodeMCU to convert the analog input values from the DHT11 sensor to the JSON format values. Along with the default temperature and humidity values, heat index, dewpoint, temperature in Fahrenheit is also calculated. These JSON values are then passed on Wifi to AWS IOT core endpoint subscribing to a user-defined MQTT topic where the clients using this mobile app can gain access to the same MQTT topic by an unauthorized AWS Cognito ID. An android app is designed which acts as an MQTT subscriber/client and it interprets the values received from the AWS MQTT publisher. The sensor values are displayed on the dashboard of the app with information showing health-related messages based on the received values. Air Quality is checked in the app by providing area zip code by the user to find out whether the air quality in that particular area is safe.
Below figure depicts the flow of sensor data from DHT11 to connected mobile devices.
The below diagram depicts a picture of the NodeMCU microcontroller used.
- NodeMCU - ESP826
- DHT11 - Temperature and Humidity Sensor
- 3 to 5V power and I/O
- 5mA max current use during conversion (while requesting data)
- Good for 20-80% humidity readings with 5% accuracy
- Good for 0-50°C temperature readings ±2°C accuracy
- No more than 1 Hz sampling rate (once every second)
- Body size 15.5mm x 12mm x 5.5mm
- 4 pins with 0.1" spacing
- Arduino
- Android Studio
- AWS Mobile SDK
- AWS IoT Core
- AWS IoT Topic
- AWS Cognito
- AWS IoT 1-Click
- AWS SNS
- AWS SES
- AWS IoT Analytics
- AWS Lambda
- AWS DynamoDB
- AWS RDS
- AWS Mobile Hub
- Launcher Activity of the Application
- Sensor Values Displayed on the Screen.
- Temperature In C
- Fahrenheit in F
- Humidity in %
- Heat Index in C
- Dew point in F
- Health related messages displayed depending on the parameters
- Application Paused in the Background
- Restore of the current values when the Main Activity is resumed
- Manually stimulating DHT sensor value changes by testing the sensor by covering it in hand for a few minutes. Values from sensors are changed appropriate messages are displayed on the App screen
- Entering Zipcode for San Jose, CA for air quality and AQI is displayed
- Entering Zipcode for Phoenix, AZ for air quality and AQI is displayed - showing more degraded air quality
- Moderate AQI in Backerfield, CA.
- Arduino Software showing NodeMCU board
- MQTT connection from NodeMCU to AWS IOT thing and sensor values are sent to AWS IOT shadow table.
- MQTT messages are received from AWS IOT in Json Format at regular intervals
- AWS Shadow table
- The number of MQTT messages received and advertised to the IOT devices subscribed to the IOT topic
- Federated Identities for the IOT Thing in AWS Cognito. This is used to access AWS IOT Topic from the Andriod Apps