This is a project for Submission for the Online Training of Internet of Things and Machine Learning Course Offered by Bolt IOT.
My project is a Smart Morning Alarm system which uses an ultrasonic sensor to measure the distance. Just place the device in the side of the bed take one reading and put that limit in the program. Set the time when you want to wake up for e.g., you want to wake up at 4 a.m. so, min_time=4 and max_time=5. Once all the parameters have been set up the run the code.
I made this project because I am very lazy and because of this habit I get late everyday. Once the alarm beeps I snooze or turn off the alarm and sleep. So, to change this behaviour of mine I made this alarm system which I cannot snooze or turn off.
Arduino Code:I have imported all the libraries needed and the limit is the distance b/w the wall and ultrasonic sensor. The limit can change and it depends where the sensor is placed. The max and min time is the time in b/w I need to wake up i.e., 4a.m. and 5 a.m. The max_time is taken because till 4:00a.m. - 4:59 a.m. the hour will be 4 only that is the current_hour in the program. Since it repeats the whole process after 10 seconds so, we need not to worry about getting late.
There is a buzzer which will beep once the condition is satisfied and it takes two input i.e., pin and value.
Once the condition for time is true then it reads the data transmitted by the Arduino to the Bolt via RX and TX pins and serialRead is the function which reads the data. After this we print the data and change it into integer value. There are two if statements, one is for the time and other is for distance. It takes the current hour and compares it with the time(i.e., max and min) and if it satisfies then it goes to next if statement. The second if statement compares the limit to the current distance and if the current distance is less than the limit, the buzzer beeps for 5 seconds and stops. Again after 10 seconds it repeats the whole process and keeps repeating itself.
The principle of working is that I as a person act as an object that disrupts the transmission. So, the distance reduces and It detects that you are still sleeping. Once you get out of bed then there would be no object in between the sensor and the wall therefore the second if condition doesn't satisfies.
OUTPUT:
Comments
Please log in or sign up to comment.