[edit] - Hackster seems to have lost the label that this is a project idea, not a full implementation. The baby webcam and audio monitor has been implemented, as has the wireless sensors. See my Uber Home Automation project for OpenHab and sensor integration.
Baby Room Home Automation
This project idea will utilize the Udoo to power the brains behind a home automation system for a baby nursery. Using a set of sensors and actuators, I want to automate common tasks, provide timely information to parents, and allow them to more easily monitor and analyze how their baby is doing. Aside from this specific example, the techniques used in this project would be applied to home automation in general.
Examples of what this project will do:
- Warn parents if nursery is too hot or cold
- Allow parents to see video feed of crib on any screen (TV, phone, or tablet)
- Pipe audio monitor to living room, similar to traditional baby monitors
- Automate baby room lights, night lights, white noise generator, and perhaps HVAC vents and windows
- Play lullabies, allow remote control of music so parents don’t have to re-enter the room to turn off music
- Use household lighting to cue hearing-impaired parents of a crying baby
- Provide flexibility to remotely turn outlets on/off via smart phone without entering nursery
Here is the general distribution of components. You can see a bunch of inexpensive sensors connected to the “Nursery Udoo”. In the living room, there’s another Udoo connected to the big screen TV and speakers. Tablets and smart phones around the house can be used to view sensor status and interact with automation system.
I'm using an open source home automation software called OpenHAB. This program runs on the Udoo, and provides the server, interface, and rules engine for the baby room automation. The logic that evalues “if temperature is too high, play audio alert in living room” comes from the functionality provided by OpenHAB. By using the Udoo in conjunction with the embedded Arduino, I can integrate many DIY sensors and a few DIY outputs into this system. In addition, I can also use OpenHAB to control commercial lighting products like Phillips Hue and Belkin WEMO. OpenHAB can also control Sonos speakers, send email alerts, and play MP3 files on the Udoo.
Baby Room Udoo
The “Baby Room Udoo”, detailed below, handles all the sensors. The diagram explains what program handles each function.
- Logitech Media Player (also known as Softsqueeze) is a free Linux program that plays music from a variety of sources (Pandora, podcasts, local audio files, networked audio files, etc…). The accompanying smart phone app allows you to control the volume as well as the content of what is played out of the speakers connected to the Baby Room Udoo. The app can be used from a smart phone in the living room, for example, so that music can be turned off once the baby is asleep without having to re-enter the room. Additionally, this program can be controlled with OpenHAB, which allows you to automate when the music starts or stops.
- The USB webcam provides the video and audio monitor. The program that provides the audio stream is ffmpeg, which can be used to create a multicast RTP session from the Udoo using the command below. The audio feed can then be played back from the Living Room Udoo or from a smart phone using the VLC app.
ffmpeg -re -f alsa -i plughw:0 -acodec mp2 -ab 128000 -ar 48000 -ac 1 -filter 'bandpass=f=1000:csg=0:width_type=q:w=.806' -f rtp rtp://224.1.2.3:1234
The USB webcam will be a cheap webcam with the IR filter removed and 950nm IR LED’s installed. This effectively creates a webcam that sees in the dark. I would use a program called “Motion" to provide the webcam stream. The video stream can be viewed from any screen in the home: a $20 spare smart phone on the bedside table, a spare smart phone over the kitchen sink, or even the big screen TV.
- Sensors are connected to the embedded Arduino. These include temperature/humidity, sound, motion, light, and maybe even a CO2 sensor to do some air quality monitoring. The sound, motion, and light sensors are used to interface with OpenHAB initiate audio alerts and facilitate other automation tasks.
- The embedded Arduino also handles some of the outputs. LED lights can be used as night lights, and automated with the interaction from the sensors. Relays can be used to actuate inexpensive radio controlled outlets
Living Room Udoo
The “Living Room Udoo”, detailed below, handles all the audio alerts and shows the video feed on the TV. It may also be utilized for entertainment as a HTPC.
Here’s a more detailed diagram of how the two Udoo’s communicate with each other. The living room Udoo subscribes to the MQTT broker running on the Baby Room Udoo. This is the mechanism that triggers temperature alarming in the living room, for example. Using MQTT, I can also add wireless nodes using a Sparkcore. These wireless nodes can reach where the Udoo’s GPIO cannot.
I made a configuration of the OpenHAB interface to show how it might function. It has a working webcam feed. It displays the temperature in different colors depending on comfort level. And it also provides the interface for scene selection, turning on room lights or night lights, and checking to see if the window is closed. This screen can accommodate pretty much any type of automation that would be added to the GPIO or to one of OpenHAB’s many compatible commercial devices.
Here's a video of the interface on a tablet.
There are many automation rules that can be constructed with the combination of sensors and outputs. These rules would be configured in the logic script in OpenHAB. Here's some examples.
Another way for parents to monitor the baby’s sleep is to capture webcam pictures at regular intervals on the Baby Room Udoo. This is a feature of the Motion program. The images could be strung together to give a good idea of what the baby does during sleep.
OpenHAB also provides graphs of sensor data. You can look back to see if changes need to be made to the temperature control in the room.
I haven’t figured out the details of how the servo motors can be used to control HVAC vents or window blinds. I’ll leave the mechanical details to actual implementation.
Thanks for reading my project idea.
Comments