A significant number of adults (95%) and adolescents (72%) engage in the habit of using their phones before bed, leading to detrimental effects such as poor sleep quality, increased anxiety, and physical issues like eye strain.
Designing a smart bedside alarm that promotes healthier nighttime habits and enhances overall wellness.
Smart Alarm
Hollow clock
SOFTWARE
Software that used to designe the glasses
Design preparation software
3D Printing preparation software
Collecting components that I will need from GRABCAD, like:
Designing using Fusion 360
3D Printing
Enclosure => Decide I will use a 3D printed design for the enclosure and it will contain every the components.
Laser Cutting
The front and back chase
Preparing Wooden Parts Using RDWorks
Importing the DXF file of the front face into the workspace.
Customizing the setting of black color:
Processing mode => Cut
Speed of cutting => 40 mm/s
Power of cut => 45
Customizing the setting of red color:
Processing mode => scan
Speed of cutting => 300 mm/s
Power of cut => 30
Download the file to the laser-cutting machine.
Slicing 3D parts using Ultimaker Cura
Open the Ultimaker Cura, choose the Prusa i3 Mk2 printer, and choose the kind of filament (PLA).
Importing the design into Cura software.
choosing the best orientation to minimize the time and support.
setting up the setting of printing to be:
Profile hight => 0.3 mm
Infill density => 10%
Supports => everywhere
Adhesion => on
Adding support blockers at some places.
Slicing to know how much it takes.
Saving the file as gcode.
MACHINES & MATERIALS
CNC Laser cutting machine
Plywood
PRUSA i3 MK2 (3D Printing machine)
PLA
I used 1 sheet of 3 mm plywood.
I fixed the sheet on the laserbed, set the focal lens, and set the frame.
After importing the file from the computer I started the laser.
It took around 2 minutes.
I first chose the preferred color of the filament for the printing which is blue then changed the existing one with the blue one.
Then, know the temperature range for this filament from the ticket on it (190:210 C) and set up the temperature from the Cura software.
I put the SD card on a 3D printer and chose my file.
It began first with heating the bed and nozzle to 210 C, calibrating.
Then, it started printing.
Using alcohol to remove the part out of the bed, tools like pliers and files to remove supports.
Arduino Uno: Serves as the central controller for managing all components.
RTC Module (Real-Time Clock): Keeps track of the current time accurately.
Joystick: Allows switching between two modes (time and alarm) and setting the alarm time.
LCD Display: Used to show the current time and date.
Speaker: Activates to sound the alarm at the set time.
First, testing each component to make sure that all works well.
Adapter 9v --> connecting the adaptor to the Arduino.
Arduino :
V_IN --> to +ve line on breadboard.
GND --> to -ve line on breadboard.
RTC module :
VCC --> to +ve line on breadboard.
GND --> to -ve line on breadboard.
SDA --> to PIN A4 on Arduino.
SCL --> to PIN A5 on Arduino.
Joystick :
VCC --> to +ve line on breadboard.
GND --> to -ve line on breadboard.
VRX--> to PIN A0 on Arduino.
VRX --> to PIN A1 on Arduino.
LCD :
VCC --> to +ve line on breadboard.
GND --> to -ve line on breadboard.
SDA --> to PIN A4 on Arduino.
SCL --> to PIN A5 on Arduino.
Finally, connected the Arduino Jake to the laptop, and from Arduino IDE I chose the correct port and then uploaded the code on Arduino.
My power source is a 9V adapter.
which I selected based on the specific power requirements of my project components. To ensure it was suitable, I calculated the total voltage and current needed for all connected devices. The adapter was chosen for its compatibility with my project’s input voltage range, reliability, and ease of use.
Libraries:
Wire.h, RTClib.h, LiquidCrystal_I2C.h: For I2C communication with RTC and LCD.
Hardware:
RTC (DS3231): Real-time clock to keep track of time.
LCD (16x2): Displays the current time and date.
Joystick: Used to set the alarm time.
Buzzer: Sounds when the alarm time matches the current time.
Modes:
Normal Mode (Mode 0): Displays the current time and checks for alarm.
Setting Mode (Mode 1): Allows the user to adjust the alarm time with the joystick.
Button Debouncing:
Ensures the joystick button doesn't trigger multiple times accidentally.
Functions:
displayCurrentTime(): Shows the current date and time on the LCD.
updateCursor(): Moves the cursor to the correct time-setting field.
increaseValue() / decreaseValue(): Adjust the hours and minutes when setting the alarm.
displayTime(): Displays the alarm time for editing.
Alarm:
Buzzer activates when the current time matches the alarm time.
First importing the libraries of LCD and RTC, inita
Some Variables:
lcd: Initializes the LCD with an I2C address of 0x27, 16 columns, and 2 rows.
rtc: Real-Time Clock object to keep track of time.
t: Stores the current time from the RTC.
daysOfTheWeek[]: Holds the names of the days of the week.
Hour, Min: Store the current hour and minute.
pset: Pin connected to the joystick's center button, used to switch between modes.
xPin, yPin: Analog pins for the joystick's X and Y axes.
cursorPosition, hour, minute, am, editing: Variables for alarm setting and time-editing state.
buzzer: Pin connected to the buzzer for the alarm.
mode: Keeps track of the system mode (0 for normal alarm mode, 1 for time-setting mode).
buttonforset: Stores the button state for debounce checking.
setup():
Initializes the serial communication, LCD, and RTC.
Sets up pin modes for the buzzer as (output) and joystick button as (input).
Checks if the RTC module is working and if it has lost power; if so, it resets the time to the current date and time (based on the compilation time).
The RTC can be manually adjusted if needed by uncommenting the rtc.adjust() lines.
loop():
Normal Mode (mode == 0): Displays the current date and time from the RTC on the LCD.
Reads the joystick button (pset) and, if pressed, switches to alarm mode.
Alarm Mode (mode == 1): Allows the user to adjust the alarm time using the joystick.
Joystick X-axis moves the cursor between hours and minutes..
Joystick Y-axis adjusts the values of the selected field.
Joystick button exits the setting mode and returns to normal mode.
Alarm Trigger: If the current RTC time matches the set alarm time, the buzzer is activated.
Debouncing: The joystick button is debounced using a delay to prevent multiple unintentional presses.
Functions:
displayCurrentTime(): Displays the current date and time on the LCD.
updateCursor(): Updates the LCD cursor based on which field (hour, minute) is being edited.
increaseValue() and decreaseValue(): Adjust the hour and minute values when the user moves the joystick up or down.
displayTime(): Displays the current alarm time being set on the LCD during the time-setting mode.
Key Functionalities:
The system displays the current time and allows users to set an alarm using a joystick.
The joystick button toggles between viewing the current time and setting the alarm.
A buzzer sounds when the current time matches the set alarm time.
Test the code to make sure it works as I need ( It displays the date & time until I press the joystick so it switches to the alarm mode to set the alarm after that press ok to return to the clock mode).
The enclosure from the 3D printing had many supports that had to be removed. so I used a cutter, and pliers to remove these supports and then used the heater to make the surface smoother.
My Instructors helped me alot with many problems I faced throughout the project.
I asked my peer Kirsten to help me with the code & dimensions of the speaker we used. She was very helpful.
I encountered several challenges during the project. One of the key hurdles was working with components I hadn’t used before, such as the RTC module and joystick. To overcome this, I first researched how they function and built small projects to familiarize myself with them.
Some sources helped me >
Another challenge was implementing the concept of modes. I explored various approaches and experimented with different codes, which required considerable time and effort to resolve.
In the fabrication phase, the 3D printing process faced an issue after an hour of printing due to a filament problem, causing me to restart the print from the beginning. Additionally, the laser cutting process had difficulties because the material sheet was bent, leading to further complications.
If I had more time, I would add more modes to the project like
Stopwatch mode
Timer mode
Reading mode
coffee mode
And more options and features make it more fun.
Maybe making the hollow clock design :)