Skip to main content

Home Automation using Google Firebase

 Home Automation Using Google Firebase




Introduction :

This is a home automation project which uses firebase and nodeMCU. First why I have chosen Firebase is because it can be maintained easily it has progress report, Crash Analytics etc and exactly it is free of cost so we can use this project to control the lights, fans, TV, etc. So let's get started

Supplies:

  • NodeMcu - 1 Nos 
  • Relay Module - 1 Nos 
  • Breadboard - 1 Nos 
  • Male to female jumpers – 3 Nos
  • An internet connection
  • An android phone

Step 1: Creating Database



First you need to go to this website and log in to your Google account.       And click on create a new project 

 
And give your project name and click continue.



After a few minutes, it says, “your project is ready “and a continue button appears to click it, the dashboard appears.


On the left side database tab will be there click on it.

 
And slowly scroll down you will see create real-time database button click on it.


 It opens a dialog box telling you to choose either a locked mode or a test mode. Select test mode and click enable. You will be directed to the Data tab on top you will see four tabs click on the rules tab and check whether both read and write rules are true. If not change both to true.



Now go to project settings and copy your project id and web API key which we will use later. And also go to service accounts tab, on the left database secrets tab will be there click on the tab and scroll down you will see database name and a secret click on the show option on the right side of the secret and copy the secret and paste it in a notepad window. And now this part is over. Now we'll go to the app inventor part.

Step 2: Configuration of the App

The app part is not a tough job I have provided the link to download the .aia file. You can just download it and import it to your account.

 
 First, sign in to the MIT app inventor and on the top, my project will be there click on it a list of options will be displayed click on import project (.aia) from my computer and select the downloaded aia file and click import the project will be imported and will be opened.



 now click on the firebaseDB1 widget the settings tab will open on the right side in that change the firebase token with the web API key and change the firebase URL with your firebase project id in the format (https://{your-project-id}.firebaseio.com/). And click the build option to download the apk file of your app. Now install the app on your mobile phone. And we'll move to the next step.

Step 3: Code



 So I have provided the code too. So download the code and open it change the firebase_HOST with your project id in the format ({Your-project-id}.firebaseio.com). Also change firebase_Auth with your firebase secret you copied earlier. And especially don't forget to change the wifi name and password.

Link: Code&App

If you have any doubts please put up a comment 

Comments

Popular posts from this blog

Smart Weather Station(using Arduino)

  Smart Weather Station(using Arduino) A weather station is a facility, either on land or sea, with instruments and equipment for measuring atmospheric conditions to provide information for weather forecasts and to study the weather and climate. The measurements taken include temperature, atmospheric pressure, humidity, wind speed, wind direction, and precipitation amounts. So today we are going to make a working prototype of it which helps us to find the temperature and dew. This project works on the principle of Bluetooth master and slave modes. Come on let’s get started Step 1: Things Required Arduino x 2 HC-05 Bluetooth Module x 2 16x2 LCD Display x 1 DHT 11 x 1 Breadboard x 2 Communication Cable Step 2: What Is the Bluetooth Master and Slave Mode? Bluetooth networks (commonly referred to as piconets) use a master/slave model to control when and where devices can send data. In this model, a single master device can be connected to up to seven different slave devices. Any slave ...