Inspiration

Many new parents are afraid their baby will crawl out of their crib at night. Our solution will notify parents their baby is currently crawling out of the crib so that they can save the day.

What it does

Babii is a system designed to allow parents to detect when their baby is crawling out of its crib. Parents often fear that their baby is going to crawl out, fall, and hurt themself. To help with this struggle, our team created a camera that mounts to the crib and detects if the baby is trying to crawl out. If the server detects that the baby might be in danger of crawling out, it'll immediately text and notify the parents, so they can stop their baby before anything bad happens. There's also an online portal so parents can watch their baby in real time.

How we built it

Babii.space was built using a Python Flask server with Socket.io to handle web sockets. OpenCV was utilized for image processing. On the front end, HTML, CSS, JavaScript, and Tailwind.css were used. The Raspberry Pi's end was a mixture of hardware and software. The Raspberry Pi Zero W was equipped with a PiCam, and a python script written to take a picture and send it through requests.post to the server. A box was then modeled using Fusion 360 and 3D-printed, after measuring the dimensions of the pi and the picam. The box has holes to be mounted on the bar of a crib for easy usage. The website is hosted on Replit.

Challenges we ran into

There were a number of challenges our team ran into.

  • At the start of creating the project, part of the CAD model for the enclosure was askew, which presented issues and resulted in part of the model being redone.

  • With the Raspberry Pi, there was some trouble with the wifi. The DukeOpen wifi performs authentication that the Raspberry Pi doesn't pass, so a lot of time was spent debugging until we found that the DukeVisitor wifi alleviated our problems there. SSH was also laggy, making development slower.

  • When we set up baby detection, we used opencv to detect the baby. However, Replit couldn't import opencv due to issues with the poetry lock file and module version conflicts. Our team thought we might have to move away from Replit altogether. Thankfully, this issue was solved by using the shell instead of clicking the run button. Also relating to opencv, the server utilized upper and lower bounds to detect the orange of the pumpkin (the baby). Using a stock orange filter, the pumpkin wasn't detected. We had to narrow down the color of the pumpkin to get this to work.

  • On the front end, using flex-grow and then h-full (setting the image to full height) caused the images to extend beyond the bottom bounds of the body. This was solved by explicitly defining the height of the bounding div.

Accomplishments that we're proud of

As a team, we're proud about every aspect of this project. We're proud that the cad model has the correct dimensions and is a compact product. We are also proud that it is baby safe because there are no exposed electronics. We are proud that we can detect the pumpkin(child) and get real-time texting alerts about its location. We are also proud of the UI on our website because it is friendly for new parents and easily usable.

What we learned

We learned lot through this - how to share files and work with multiple people on Fusion 360, how to send files through post requests on the Raspberry Pi, how to receive files and process them using Flask and OpenCV, how to use Twilio and send photos, and that the DukeOpen wifi should not be used with Raspberry Pi's.

What's next for Babii

Babii could be improved by using machine learning with computer vision to detect the baby. Right now it detects the color orange, but in the future this can be made more precise. It can also be improved by using an infrared camera, making it much more applicable during the nighttime. We can also use this by improving upon our design with older children to detect if they roll out of their bed or start to sleepwalk.

Share this project:

Updates