In the world, millions of babies are born to day. A baby needs special care, things like humidity, temperature, danger moves, and others, are important factors for a healthy baby. In this project we measure humidity and temperature from a cot of a baby, this is possible using a DHT11 then, we use a NODE MCU for upload the data to Firebase, the parents can supervise your baby in a Android App that generates notifications when the data are not secure for the baby, in the same app, the parents can modificate the threshold for a secure range.
Send Data to FirebaseUsing the NodeMcu we upload the data to a project in firebase and they may see like the next image:
When we create a project in firebase to facilitate the use we need follow the next steps:
- Click on 'Database':
- Click on 'Rules' (I'm from Colombia, that's why it's in Spanish):
- Delete and write this:
Now we don't require authorization for editing data, but, we'll need an auth code for our library in NODE MCU, for this, in the project configuration click on 'service accounts' then, in 'Secrets of the Database', finally click on 'To Show' and copy the code.
In this moment we use the code for Arduino IDE and programming the NODE MCU whit each your data (ssid, password, firebaseurl, auth). (Attached is the application code)
Android AppIn Android Studio, we'll make an app for download the data of sensors and established the secure range, when the data are out of secure range, the app generates an notification. (Attached is the application code)
The following image shows the application:
The sensor data is updated in every second and shows in the up of the app, in the bottom, the parents can modify the value of the ranges and this values also upload to firebase:
The app compares the sensor data with the range and if the data are out of range the app will generates a notification:
And this is the end, this is a short project make for protect our babies.
Comments