Introduction: Smart Alarm Clock
The idea behind this project is to have a minimal but informative alarm clock in the morning. We don't need all of the information we get on our phones first thing, but many of us do want to know one or two things. For example, it's nice to know if it'll be an especially hot day.
Many of us have trouble getting out of bed as soon as the alarm goes off. This alarm clock also keeps track of what time you turned it off every day, which we hope in the future to use to add new features.
Our proposed solution is an alarm that wakes you up every morning, and uses LED lights to show you the data that interests you. Now it's summer, so we set ours to let us know if it's going to be an especially hot or humid day - beyond that, there's really no need to check the weather.
The information flow is as follows. The node MCU receives a webhook at 8am from IFTTT, which turns on the alarm. Another webhook from IFTTT gets the weather report and updates the LED lights according to our thresholds. When the 'dismiss' button is clicked, the time stamp is added to a google sheet for future use. We have the webhooks defined in a Blynk app as well, to keep it all connected.
What you'll need:
- Node MCU
- Bread board
- 2 led lights (different colors)
- 2 resistors (330R)
- 6 arduino cables
Step 1: Get Your Materials Together
Using a Node MCU, we connected two LEDs, a button, and a speaker.
Step 2: Set Up IFTTT Applets
You'll need a few applets for this alarm clock.
- At 8am, turn the alarm on
- At the same time, send a request for a weather report for the same day. Get the temperature and wind forecasts.
- When the alarm is turned off, send the time stamp to google sheets.
Make sure that each value that you need is associated with its own virtual pin.
Step 3: Configure the Blynk App
Set up a Blynk app and define the webhooks used there. You will also need to use the app's key in your code, so be sure to save it.
Step 4: Write Your Code
For each of the virtual pins that you defined in the blynk app, write a BLYNK_WRITE(Vn) function to handle all data.
We set the threshold for a Hot day at 30 degrees celsius, and the threshold for Windy at 40km/h. This way you're warned first thing if it's going to be an especially hot or windy day.
Step 5: Summary
The main challenge with this project was connecting all of the applets from IFTTT. We dealt with this by testing each individually, and then putting it all together only after we saw that each part of the project worked on its own.
The system we built is not as advanced as we hoped; since we do not have access to screens or other methods of displaying data to the user, we used a simplistic method - using LED lights to show only specific cases.
There are a lot of ways to continue this project.
One of the most practical ways we see taking this project is to alter the waking time based on how long it takes the user to wake up. Does it take you half an hour to turn the alarm off in the morning? If so it'll wake you up half an hour before the time you set. Maybe later on you'll get better at waking up quickly; in that case, it'll start waking you up later. This can be done by using the times we send to a google sheet, and doing some simple math to figure out the time allowance we should give for waking up.
Another idea is to add a screen to your project, and give an exact forecast for the weather report, along with any info the user likes to know first thing in the morning.
You can see a video of the alarm going off here: