Sleep Like a Baby - DIY a Baby Sleeping Monitor
185 Views, 1 Favorites, 0 Comments
Sleep Like a Baby - DIY a Baby Sleeping Monitor
Welcome to build your own Baby's Sleeping Monitor!
Using the ESP32 and Blynk app, here are the main features that you're going to build:
- Detect noise level during the baby's sleep.
- Detect room temperature.
- Detect the movement of the baby during the night.
- Set an alarm clock to wake up your baby or play a lullaby.
This is the closest version for building your own baby sense!
Supplies
- ESP32
- 1 small doll
- 1 Buttery house
- User in the Blynk app
Input sensors:
- DHT22 (temperature&moisture sensor)
- MAX4466 (Noise detection sensor)
- MPU9250 (Movement sensor - Gyroscope)
Output sensors:
- Speaker
Launch the Blynk App
- Create an account in the Blynk app: https://blynk.io/
- Start a new project via "quick start"
- Download the Blynk app to your phone from app store.
- Open the Blynk app and start configuring the following screens.
Configurations
Define datastreams as follows:
- V0 - Virtual pin - for "Start sleeping session" button
- V1 - Virtual pin - for Baby's movement detection super-chart.
- V2 - Virtual pin - for Roon temperature value display.
- V3 - Virtual pin - for the "Wake up baby" button.
- V4 - Virtual pin - for Baby's noise detection super-chart.
After all data streams are defined, start adding the following components to your dashboard:
- Configure two buttons—one for "Start sleeping session" and one for "Wake up baby" (initiating an alarm). Both buttons need "switch" buttons; see the attached screenshot.
- Configure two super charts-one for "Baby's movement detection" and one for "Baby's noise detection". Both charts are line-charts.
- Configure one value display component- for presenting the room's temperature.
Make sure to connect the right datastreams to the right components.
Edit Your Dashboard
We edited the dashboard with relevant emojis and selected pastel colors, which should suit Baby's color palette.
Look at the dashboard's design in the attached screenshot, and play&plug with it.
Dashboard Components:
- "Start sleeping session" button - our code requires an indicator that a sleeping session has started. We will use a simple "switch" button for the user to configure it. This is a boolean button:
- "Awake" - represents OFF.
- "Sleep" - represents ON.
- "Baby's Movement" detection super-chart - whenever the baby's moving during the night, it will affect the mattress which will impact the baby's movement detection. The chart will collect the data and you can track movement in real-time.
- "Roon Temperature" value display- We will present the room's current temperature. The values are double numbers (2 points after the dot) and represent the room Celsius degrees.
- "Wake up baby" button—a simple "switch" button for playing a short part of the "Fur Elise" melody. We intend the button to be used as a nice alarm for the baby (this is why the button name is "wake up baby"), but users can also use it to play a nice lullaby. When the button is pressed, the melody starts.
- "Baby's Noise" detection super-chart- Track and collect data about the baby's crying during the night. The data will be collected via the chart.
Start Writing Your Code
- Attached here is the relevant code for this project; feel free to use it or improve it with your own features!
- The code is built for the Arduino IDE (CPP).
Downloads
Assemble the Doll
- Take the small doll and create a hole inside.
- Take out the doll-filling materials.
- Sew the speaker to the inner part of the doll and the DHT22 and MAX4466 to the outer part of the doll; Make sure these two sensors are located in a place that allows them to detect values from the environment. (In the screenshot, you can see that we've located these sensors with the owl's wings).
- Connect the sensors to the esp32 board and compile the code.
- Connect the batteries to the esp32.
- Cover the ESP32, sensors, and batteries before putting it inside the doll. We've covered everything with a small plastic bag. Put it inside the doll.
- Bring back some of the doll's filling.
- Sew the hole.