The purpose of my project is to organize the timing and type of medication for any patient, specifically targeting individuals who often forget to take their medicine. This solution will address the challenge of medication adherence.
My project aims to be sustainable and socially beneficial, inspired by my grandmother's struggles with her illness.
Fusion 360
Started the project by, making new components
Sketching
made to every side a component
The Project's Base:
First i sketched the Ground of the project and did the T'-slots
Then Extruded this Parts making sure the T-slots parts are Being Cut.
The Lid Base Part:
I did a plane offset ,Then copied the ground part to this plane then made a sketch on this surfes to make a Hollow part on the Lid support
The Lid Part:
I did a sketch of the Lid then extruded it, then projected the inner frame of the lid Base to make the Lid stable and to close well
The Main side:
I sketched the first side by using the Project Tool to make the perfect dimensions that fit well , Then extrued
The Rest sides:
Used the Circular Pattern to Finish the sides Then Sketched The T-Slots by using the projection
Then projected the " LCD, Push button, Led" on the front side
and made a hole to the pill to be dispensed
and for the Back side
I Projected the Arduino Uno sockets
The cylinder Part
I sketched a 150 mm diameter Cirlce then divide it into 7 sections
and finally after projecting the moving part of the stepper motor, I extrued this part
The middle Part
I sketched the Middle part by project the inner parts of the project' body
Then Project The Stepper motor to this part and extrude it
The V Part
I sketched this part to dispense the pill from the cylinder to the hole that made for it
The Final enclosure
I Used the Joint tool to joint all the parts togther then added the Electronics And Ta daaa
LaserCad
Fusion 360
LaserCad
El Malky ML64
fisrt Exported all the parts using "DXF for laser cutting"
imported the file into "Laser Cad"
"I set the right parameters to each line and Adjust the speed and power (Cut:- 10 speed , 65 Power / Speed Cut :- 200 Speed , 30 Power)
Then i exported the file as "Ai" Format.
copy your file as "Al" format to the machine and select it .
Put the plywood sheet.
make sure that the plywood sheet is not warped ( and if it's you can hold it with a holder and stuck it to the machine) .
Adjust the focal length.
Choose the place you want to print by.
set the origin .
Click on "box" to detect the size and make sure that the design fits .
Click on "start" to cut.
Exported all the faces as "dxf" format using "DXF for laser cutting"
Imported all the parts in "Laser Cad" and set The machine adjustments
Exported all the files as "ai" foramt and dowloaded to the machine
Buzzer
Push Button
ULN2003 driver
White Led
SDA ===> A4 Arduino Uno (Green)
SCL ===> A5 Arduino Uno (Blue)
VCC ===> +ve rail on breadboard (Red)
GND ===> -ve rail on breadboard (Black)
The connections are straightforward. Begin by connecting an external 5V power supply to the ULN2003 driver.
Control Pins:
IN1 ===> Pin 8 (Arduino Uno)
IN2 ===> Pin 9 (Arduino Uno)
IN3 ===> Pin 10 (Arduino Uno)
IN4 ===> Pin 11 (Arduino Uno)
VCC ===> +ve rail on breadboard (Red)
GND ===> -ve rail on breadboard (Black)
SDA ===> SDA Arduino Uno (Grey)
SCL ===> SCL Arduino Uno (Brown)
VCC ===> +ve rail on breadboard (Red)
GND ===> -ve rail on breadboard (Black)
Control Pin: 7 (Arduino Uno)
VCC ===> +ve rail on breadboard (Red)
GND ===> -ve rail on breadboard (Black
Control Pin: 6 (Arduino Uno)
GND ===> -ve rail on breadboard (Black)
Control Pin: 5 (Arduino Uno)
GND ===> -ve rail on breadboard (Black)
RTC (Real-Time Clock):
Input Type: Current time (hours, minutes, seconds).
Action Triggered:
Checks if the current time matches any of the predefined alarm times.
Triggers an alarm (buzzer and LED) if the time matches.
Button:
Input Type: Physical button press (buttonPin set to INPUT_PULLUP).
Action Triggered:
Stops the buzzer and turns off the LED.
Activates the stepper motor to dispense pills.
Buzzer:
Control Pin: 5 (Arduino Uno)
Action:
Sounds an alarm when it's time to take pills.
Stops when the button is pressed.
LED:
Control Pin: 7 (Arduino Uno)
Action:
Turns ON when an alarm is triggered.
Turns OFF when the button is pressed.
Stepper Motor:
Control Pins: 8, 9, 10, 11 (Arduino Uno)
Action:
Rotates to dispense pills when the button is pressed during an alarm.
LCD Display:
Control Type: I2C communication.
Action:
Displays the current date and time.
Shows alarm messages ("It's time to take your Pills!") and confirmation ("Pill dispensed!").
I used a 5V adapter to provide an external power source for the stepper motor, as it required more current than the Arduino could supply. This ensured the motor operated smoothly and reliably without overloading the Arduino.
To connect the stepper motor to the adapter, I incorporated a DC power jack. This allowed for a secure and stable connection, ensuring consistent power delivery to the motor. Additionally, using an external power source helped maintain the overall stability of the circuit and prevented potential voltage drops or disruptions.
LiquidCrystal_I2C:
Controls a 16x2 LCD display with an I2C interface (address 0x27).
Displays the current date, time, and alarm messages.
RTC_DS3231:
A real-time clock module that keeps track of the current date and time.
If the RTC loses power, it sets the time to the compilation time of the code.
Stepper Motor:
Used to dispense pills. It moves a specific number of steps (stepsPerSection = 300) when triggered.
Buzzer and LED:
Act as alarms to notify the user when it's time to take pills.
Button:
A push button connected with a pull-up resistor.
When pressed, it stops the alarm and triggers the stepper motor to dispense a pill.
Alarm Times:
The system has multiple alarm times defined in the arrays alarmHours[] and alarmMinutes[].
In this example, the alarms are set for 8:00, 23:59, and 1:23.
Initializes the LCD, RTC, buzzer, LED, button, and stepper motor.
Sets the stepper motor speed to 60 RPM.
Checks if the RTC is connected and initializes it. If the RTC lost power, it sets the time to the compilation time.
The loop() function runs continuously and performs the following tasks:
Display Current Date and Time:
Fetches the current date and time from the RTC.
Displays the date (year/month/day) and time (hour:minute:second) on the LCD.
Check for Alarm Times:
Compares the current time with the predefined alarm times.
If the current time matches an alarm time and the alarm hasn't been triggered yet (alarmTriggered[i] == false), it activates the alarm.
Alarm Activation:
Displays a message on the LCD: "It's time to take your Pills!"
Turns on the buzzer and LED to alert the user.
The alarm lasts for 1 minute (60,000 milliseconds) unless the user presses the button.
Button Press Handling:
If the button is pressed:
Turns off the buzzer and LED.
Activates the stepper motor to dispense a pill by moving stepsPerSection steps.
Displays a message on the LCD: "Pill dispensed!" for 2 seconds.
Marks the alarm as triggered (alarmTriggered[i] = true) to prevent multiple triggers in the same minute.
Reset Alarms at Midnight:
At midnight (00:00), all alarm triggers are reset (alarmTriggered[i] = false), allowing the alarms to activate again the next day.
Delay:
The loop runs every 1 second (delay(1000)) to avoid excessive CPU usage.
Real-Time Display: I integrated an RTC (Real-Time Clock) module to display the current time and date accurately.
Manual Stepper Motor Control: The stepper motor can be activated using a button. Each press rotates the motor to the next section, dispensing the correct pill dosage.
Time and Quote Display: The LCD continuously shows the real-time, and when it’s time to take the pills or after dispensing, it displays motivational or reminder quotes for the user.
Using Fusion 360's joint feature, measuring all the components to make sure that they'll be mounted easily, and finally mounting them after fabrication, solving the problems.
Using:
T-slots
3mm screws and nuts
Functionality of features:
The device is performing minimum, complete, and nice to have features.
Mego and Menna supported me throughout the project by brainstorming ideas related to my design and functionality.
They assisted with the dispensing mechanism's design and helped me to debug my code, which was disorganized
Farah guided me with the circuit connections when I felt stuck and unsure about certain parts.
I shared useful resources with them, such as component files and Fritzing diagrams, to support their work.
I was working on the circuit, but things weren’t going as planned.
The only thing that seemed to work was the buzzer, which kept beeping.
The stepper motor wasn’t moving at all, and after checking, I realized it was because the wiring was incorrect.
To make matters worse, the LCD screen wasn’t displaying anything either. nothing was functioning the way it should.
How I Solved It:
1.Fixed the Wiring:
I started by carefully rechecking the connections for the stepper motor. It turned out that some wires were connected to the wrong pins. I rewired the motor correctly, ensuring each connection matched the circuit diagram.
The Stepper motor circiut connection
2.Adjusted the Step Revolution Settings:
Even after fixing the wiring, the motor still wasn’t working properly.
I realized the step revolution settings in the code were off. I adjusted the settings to match the motor’s specifications, and that finally got it moving as intended.
Changed the stepspersection into 290
3.Checked the LCD Backlight:
For the LCD, I noticed the screen was completely blank. After some troubleshooting, I discovered the backlight jumper was disconnected. I reattached it, and the LCD lit up, displaying the information it was supposed to.
Make sure this jumper is on
After making these fixes, everything worked perfectly! The stepper motor ran smoothly, the LCD displayed the correct data, and the buzzer beeped only when it was supposed to. It was a great reminder of how important it is to double-check wiring, settings, and connections when troubleshooting electronics.
Perhaps in the future, I would focus more on enhancing the enclosure by adding intricate details, creative patterns, and a more polished finish. Additionally, I might consider improving its durability, incorporating user-friendly features, or exploring different materials to make it both functional and visually appealing. This would elevate the overall design and make the project more professional and aesthetically pleasing.