Time Keeper with Sleep Function for Arduino Nano
This project creates a time keeper with an alarm function and sleep option using an Arduino Nano, DS1307 RTC module, LCD module, battery, breadboard, and 4 pushbuttons.
Components:
- Arduino Nano
- DS1307 RTC Module
- LCD Module (size and connection type depend on your choice)
- Battery (appropriate voltage for your LCD)
- Breadboard
- 4 Pushbuttons (Select, Up, Down, Enter)
- Buzzer
Functionality:
- Users can set 8 different time intervals in 24-hour format.
- When the current time matches a predefined stored time, the buzzer will sound for 60 seconds.
- Pressing the “Sleep” button during the alarm will mute the buzzer and display “Yes” on the LCD.
- If the sleep button isn’t pressed within 60 seconds, the buzzer will automatically turn off, and the LCD remains blank.
Customization:
This project can be customized with additional features, such as:
- Displaying the current time continuously
- Setting labels for each alarm slot
- Snooze button functionality (reactivate the alarm after a short delay)
- Multiple alarm melodies
Here’s a general outline to get you started (code will vary depending on your specific LCD module):
- Include Libraries: Include libraries for the DS1307 RTC and LCD module.
- Pin Setup: Define pins for buttons, buzzer, LCD connections (data, control, backlight, etc.).
- Time Variables: Create variables to store current time, set times, and alarm status.
- Button Reading: Use digitalRead() to check button presses (select, up, down, enter).
- Setting Time: Implement logic for setting 8 different times using select, up, down, and enter buttons. Update RTC with the selected time.
- Timekeeping: Regularly check the current time (read from RTC) and compare it with stored alarm times.
- Alarm Activation: If a match is found, activate the buzzer and display message on LCD.
- Sleep Button: Check for sleep button press during the alarm. If pressed, turn off buzzer and display “Yes” message.
- Automatic Alarm Deactivation: If the sleep button isn’t pressed within 60 seconds, turn off the buzzer and clear the LCD display.
Remember: This is a basic outline. You’ll need to write code to handle specific functions and integrate the libraries for your chosen components.
For in-depth coding assistance, consider searching online forums and communities dedicated to Arduino programming. They can provide code examples and troubleshooting help tailored to your specific hardware setup.
Reviews
There are no reviews yet.