Intro: Night Light and Sound Soother
Do your kids ever struggle to fall asleep? Do your kids feel calmer when you play relaxing music? Then this is the device for you!
With this device, after you tuck your little one in and turn off the lights, the device is activated to turn on a night light and begin to play soothing music of your choosing. These sleep conditions are especially helpful for infants.
Step 1: Gather Your Supplies
In order to start this project we're going to need to grab a few things first.
- LinkIT ONE
- Light Sensor
- LED Light
Step 2: Upload Relaxing Songs to the Device
In this step we are going to upload MP3 files of calm and soothing tracks to play when the device is activated. This could include music such as a babbling brook, crackling fire, or ocean waves - your choice! As a kid, I used to love listening to Enya to fall asleep and it did just the trick.
We are going to store the MP3 files in the flash memory of the LinkIt One. To prepare your LinkIT One to do this, turn the MS/UART switch to MS mode (a.k.a. Mass Storage mode). This will allow your computer to recognize the device essentially as a FlashDrive. From there, you can simply drag and drop MP3 sound files into your LinkIt One Flash Storage. Once complete, turn the MS/UART switch back to UART mode to upload your code.
Step 3: Connect LED Light and Sensors to Device
There are 2 prongs to the LED light that fit nicely into the LED module. Simply align the prongs and connect to turn on your light!
Plug in your battery, your speaker, and Light Sensor as well.
Step 4: Upload Your Code
Now it is time to upload your code! Download the code file that is attached to this step and install it on your linkit one!
First, you'll need to adjust the light sensor's setting to make sure it only is triggered when it is 'dark' in your room. This can be a bit tricky, since some kid's rooms are already pretty light! You want to play around with this line of code until you find the right value that finds what 'dark' is that works for you:
const int thresholdvalue=10;
You're going to want to find this code line:
Where it says 'EnyaSong.mp3' in the code line, you will want to rename this segment to whatever you call your music file, otherwise it won't play.
Step 5: Install Device at Bedside
You may or may not want to hide the speaker depending how old your child is, but be sure to make the bulb visible so it can act as a night light.
Step 6: Storytime!
Now that your device is installed, it's time to read your child a story, tuck them in, and turn out the lights. The device will activate automatically to begin playing soothing tones with the added bonus of a night light!