ICP_4 - akkipant/IoT-Fall-2019 GitHub Wiki
Introduction:
This practical was about interfacing a Bluetooth module with Arduino and controlling a LED with an Android application. The "MIT App Inventor 2" was introduced to develop a simple application and download it on the phone.
Objectives:
The first objective was to interface the Bluetooth module with Arduino, develop a simple App to control LED in MIT Inventor 2 and control it's ON/OFF functionality. This App controlled the ON/OFF operation of LED. The second part, was interfacing any sensor with the WiFi module and displaying data on App and getting notifications if value exceeds limit.
Approaches/Methods:
Our first approach was to connect the Bluetooth module with the Arduino. Then, connect the LED at the output of Arduino. The second task was to develop an Android App using MIT Inventor 2 and download the same on an Android phone to control the LED. After completing the Bluetooth interface, we proceeded with the WiFi interface to display data on App. We developed the WiFi app for interfacing temperature sensor using MIT App Inventor.
Workflow:
- Connect the Bluetooth Module to the Arduino. Connect TX --> to Arduino's RX, RX --> Tx, VCC=5V and GND.
- Connect LED at the output of digital pin 8.
- Log in to the 'MIT Inventor 2' website. Create a new project, name it. Create the screen in 'Designer' tab as per the steps mentioned.
- In 'Blocks' tab drag and drop the coding blocks, in order to activate the screen and connect with the Arduino.
- Download the 'MIT AI2 Companion' App on the phone from Google Play Store. Download the .apk file to the phone by Build--> App (provide QR code for .apk). In the phone's Bluetooth Settings, connect to the Bluetooth module. It will then be displayed in the MIT Inventor app after clicking on the "Bluetooth Connect" icon. Connect to it and control the ON/OFF function of LED by clicking on the ON and OFF symbol on the app. Capture the video.
- Then, we proceeded to the next part of sending temperature sensor data to the app using WIFI. We connected the WiFi module as done for 2nd ICP.
- We followed the steps to develop the MIT app inventer screen for WIFI. The circuit diagram is like ICP3 for temperature sensor and WIFI interface.
Circuit Diagram:
Bluetooth Circuit Diagram
WiFi Circuit Diagram
Parameters :
The Bluetooth name of the module is: DSD TECH HC-06 LED : Red Resistor: 220 ohm App developed in : MIT App Inventor
Video
Evaluation and Discussion:
- Initially we had received bad Bluetooth module, hence we were unable to connect to the module and spent most of the time on changing the code.
- We connected our app to the other team's module to turn Bluetooth ON/OFF
- But, finally, we replaced the module and were successful in completing the ICP.
Conclusion :
Through this session, we learned to interface the Bluetooth module with Arduino, design Android app using MIT App Inventor and control the hardware using Bluetooth/WiFi interface. The MIT App inventor is an interesting tool to develop apps using drag and drop method.