This project aims to develop a home automation system that gives the user complete control over all remotely controllable devices in his/her home using an IOT Android app.
There are many third party online servers and platforms available for showcasing the data of your IOT project. But, out of all of these platforms like ThingSpeak, Adafruit.io, Blynk and IFTT etc., today I select Firebase.
Components Required:
This book will help you to gain more knowledge about this subject:
Arduino, Raspberry Pi, NodeMCU Simple projects in easy way
Why Choose Firebase?Firebase provides a quick way to keep sensory data collected at the device level, and it works great with the Android APIs, which is supported by AndroidThings. A lot of mobile and device programmers that I have come across struggle with server-side programming. Firebase can really help bridge that gap and make it easier. It will be interesting to see developers use its offline features. If you are new to IoT or generally any device that collects data and needs to transmit it over networks, the golden rule to be assumed is that network connectivity cannot be assumed. As a result, you will need to collect the data offline and when the network is available, transmit this over to your server. Firebase with its offline features can really make this simple for a lot of developers.
Firebase has a ton of features including Real-time Database, Authentication, Cloud Messaging, Storage, Hosting, Test Lab and Analytics, but I’m only going to use Authentication and Real-time Database.
OK, let's move on to project construction.
I will divide this project into three parts:
- Creating a Firebase account
- Making the app
- Programming Arduino
First go to https://console.firebase.google.com/ and login. Click on Add a project
, then you will see the interface shown below. Give it a project name and select a country/region.
Here I chose the project name home automation and, after selecting my country, I press create.
After a moment you should see the screen shown below; click on Continue.
Then go to Get started.
Now enable it.
Go to Rules and edit the code as seen in the images.
Go to Settings and note your web API key.
Part one is complete.
Making the AppDon't stress. I will provide you a complete row file for App Inventor. Just click here and download. Now go to ai2.appinventor.mit.edu to open this file.
Now go to My Projects and import the Homeautomation.aia file on your computer.
Click on the option circled in red, and follow the below image's directions.
OK, now this part is over.
Programming ArduinoYou have to need to make some changes for your Arduino code:
FIREBASE_HOST
: copy and paste into the Firebase databaseFIREBASE_AUTH
: copy and paste into Project Settings
Setup your WIFI name and password. Download the Arduino code (click here).
More projects:
- Introduction to NodeMCU8266 & Steps to Import ESP Board Libraries
- NodeMCU8266 Basic Project - Blink a LED
- NodeMCU8266 Digital Read (Push Button)
- Analog Data Read Using NodeMCU8266
- NodeMCU LED Control Use in Blynk App in IOT platform
- NodeMCU to DHT Interface in Blynk App | On IOT Platform
- The Best Way to NodeMCU GPS Tracker Blynk App | in IOT Platform
Comments