Home Weather Station With Your Own Android App
by piKOzh in Circuits > Arduino
2217 Views, 8 Favorites, 0 Comments
Home Weather Station With Your Own Android App
In this work I show how to send Sensor Data to Android using Google Firebase & ESP8266 NRF24L01 Wifi Gateway with Arduino NRF24L01 Node
Bill of Materials
- Arduino UNO (Arduino UNO R3 Development Board) - (1)
- NodeMCU (ESP8266-12E Board) - (1)
- NRF24L0 (12.4 Ghz Transceiver Module) - (2)
- DHT11 Sensor (DHT11 Humidity Temperature Sensor) - (1)
- Connecting WiresJumper Wires
Connections of Transmitter
The first circuit diagram is a Transmitter End Section. Assemble the Circuit as shown in the figure. It consists Arduino Uno, NRF24L01 & DHT11 Humidity & Temperature Sensor.
Connection of Receiver
The second circuit diagram is a Receiver End Section. Assemble the Circuit as shown in the figure. It consists NodeMCU ESP8266-12E WiFi Module and NRF24L01
Transmitter Code
Download these libraries:
- Radiohead NRF24L01 Library: https://github.com/PaulStoffregen/RadioHead
-
iDHT11 Library: https://github.com/eduardonatario/Arduino-Sensor-d...
Then use this code
Downloads
Receiver Code
FirebaseArduino is a library to simplify connecting to the Firebase database from Arduino clients. It is a full abstraction of Firebase’s REST API exposed through C++ calls in a wiring friendly way. All JSON parsing is handled by the library and you may deal in pure C/Arduino types.
The library cannot work standalone. So you need to add the ArduinoJSON library as well.
1. So first go to the library manager and search for “JSON” & install the library.
The latest JSON library might not work with the code. So you may need to downgrade the library to version v5.13.5
2. Then you need to install Google Firebase library as well. So, download the library from below link and add it to Library folder after extraction
https://github.com/FirebaseExtended/firebase-ardui...
3. Before uploading the code, make sure to do the changes to FIREBASE_HOST (it ends on .......firebaseio.com) You can get this parameter from Google Firebase Console. Also change the WIFI_SSID & WIFI_PASSWORD from the given code and replace it with your wifi SSID & Password.
Check the complete code here
Downloads
Google Firebase
Google Firebase is a Google-backed application development software used for creating, managing,and modifying data generated from any android/IOS application, web services, IoT sensors & Hardware. To learn more about the Google Firebase Console, you can read the official https://firebase.google.com/docs from Google Firebase
Android Studio
1. You need to use AndroidStudio and Create a project. Main Activity Class should contain folowing code (MainActivity).
2. In the build.gradle(Project: nameofyourproject) add in dependencies:
classpath 'com.google.gms:google-services:4.3.3'
3. In the build.gradle(Module: app) add in dependencies:
compile 'com.google.firebase:firebase-database:19.3.0'
and at the end
apply plugin: 'com.google.gms.google-services'
After all changes in gradle files you should click on (Sync now) from above
4. Main Activity xml file should contain code (activity_main)
For all additional information watch video tutorial https://www.youtube.com/watch?v=LpWhAz3e1sI&t=193s