Sleep Like a Baby - DIY a Baby Sleeping Monitor

by mtelzur in Living > Kids

173 Views, 1 Favorites, 0 Comments

Sleep Like a Baby - DIY a Baby Sleeping Monitor

sleep-activity-baby-sensor.jpg

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:

  1. Detect noise level during the baby's sleep.
  2. Detect room temperature.
  3. Detect the movement of the baby during the night.
  4. 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

Screenshot 2024-03-15 at 11.55.33.png
  1. Create an account in the Blynk app: https://blynk.io/
  2. Start a new project via "quick start"
  3. Download the Blynk app to your phone from app store.
  4. Open the Blynk app and start configuring the following screens.

Configurations

IMG_3682.PNG
IMG_3683.PNG
IMG_3684.PNG
IMG_3685.PNG
IMG_3686.PNG

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

WhatsApp Image 2024-03-15 at 12.45.23.jpeg

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).


Assemble the Doll

IMG_8866.jpeg
  1. Take the small doll and create a hole inside.
  2. Take out the doll-filling materials.
  3. 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).
  4. Connect the sensors to the esp32 board and compile the code.
  5. Connect the batteries to the esp32.
  6. 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.
  7. Bring back some of the doll's filling.
  8. Sew the hole.