Smart Baby Crib | MindPlus Coding Kit for Arduino Started Tutorial E19

0 3611 Easy

"Baby baby go to sleep…”. The mother hums the lullaby by the crib, and gently rocks the baby to the dreamland. The mother pads out of the room for a glass of water and housework, while the closed door silences the baby's heartbreaking cry. When the mother comes back, the baby was already crying out of breath. The mother can only hold the baby and say sorry, with regret and reproach all over her heart. Wouldn’t it be better if there is a smart crib that reports any situations of the baby, and soothes the baby when the mother goes back?

Let's try to make a smart crib now!


Task Navigation
1.Making a Smart Baby Crib

Knowledge Point Analysis

Make a smart baby cradle and connect a sound sensor to transmit the sound intensity value of the current environment to the IoT service platform. When value is received, check whether the baby is crying. Then send information to the WiFi IoT module, and send control command to the RGB light module, which starts to change colors. At the same time, it can also control the rotation angle of the servo to to make the crib swing.


Command List 


Hardware connection (analog sound sensor -- A0, servo -- D3,
LED-R -- D4,WiFi IoT: GND -- GND, VCC -- VCC,D/T-SDA, C/R-SCL)

Please match the colors when plugging


1. Write the program

That’s an awful lot of hardware at first glance. But just relax, everything except communication is what we already used before.


Still, we need to open “Extensions” in Mind+ to load corresponding modules.

The idea here is similar to the previous chapter. The only differences are temperature and humidity sensor is replaced by analog sound sensor, and output devices also include LED lights. The overall structure of the program remains largely the same.

2. Reference program


3. Program results

When the sound intensity is larger than 30, it sends a message to the cloud. When we receive the message, we send “soothe” command to WiFi IoT module. Upon receiving the command, lights turn on and servo rotates to soothe the baby, until sound intensity reduces.

4. Program analysis

the crib has to control the light flashing in addition to swing and stop actions to soothe the baby.

Considering the actual application scenario, the swing has to be gentle, so the servo rotation angles shall be small and intervals shall not be too short.

Next, we analyze the functions in two parts, upload and execution.

Initialize the servo and WiFi IoT


Upon receiving the “soothe” command, execute:


Fill in what functions to perform:


Further Reading 

Smart Baby Swing Crib Design

With the rapid progress of society and the continuous improvement of life quality, the requirement for baby products is getting higher. As one of the most commonly used baby products, cribs have received the attention of many parents. Modern life’s fast pace also greatly exhausts new parents when they have to do babysitting and maintain day-to-day work. Traditional crib adopts a fixed-legs or wheels design, as a result, they can only be used as a bed. It cannot notify parents when baby wets the bed or soothe the baby when he/she is crying, a huge headache at night for parents. This article presents a design of a smart baby swing crib to solve the above problems.

Overall Design

The overall design of the baby swing crib in this article is shown in Figure 1. When the baby wakes up, the parents are first reminded by sound detection sensors to know the baby is no longer asleep. At the same time, the smart crib uses a motor connected to a swing arm to drive the automatic slow swing, accompanied by a recorded lullaby or mother’s voice, in order to help the baby go to sleep again. For the baby’s poo and pee, they are detected in real-time through the installed temperature and humidity sensor; a text message will be sent to the parents or caregiver through the GSM module as an alert. And the temperature sensor detects the quilt temperature of the crib in real-time and can check whether the quilt is covered properly. In addition, a settings module can provide custom settings for every baby and parents’ various needs.


Further Exercise 

With what’s introduced in Further Reading, can you add new features to the crib?

icon Program 8-2 E19.rar 166KB Download(4)
All Rights