Introduction: 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
Step 1: 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
Step 2: 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.
Step 3: 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
Step 4: 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
Step 5: 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
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
Step 6: 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
Step 7: 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:
3. In the build.gradle(Module: app) add in dependencies:
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
Step 8: How It Works (on Russian)
Participated in the
Arduino Contest 2020
Question 2 years ago on Step 7
hi, can we send data on mobile phone for led blink etc.? or how it can be? I dont want to use bluetooth module, esp8266 or different sensor, just nrf24l01 + arduino + mobile phone is it possible?
2 years ago
Thanks for sharing!