Final Project Journal
DON't forget to TAKE YOUR PILL
Project Ideation
1- Tell us about the idea of your project. Why do you care about this? What were you inspired by? Include images and videos of similar projects
Pill reminder product
the project is a pill reminder for patient who had a lot of medicine and forget to take it on the time.
I get inspired by mom who has a lot of pills every day some times she forget to take her medicine so I thought it is an good idea to design a product reminds her with her medicine time .
Using GOOGLE __PINTEREST___I searched for alike ideas.__
Project Construction
2- Explain the CAD process of your project. How did you use the software to design your project? (List the softwares/tools/materials...etc that you used)
softwares/tools/materials
3mm plywood
I going to use 3mm plywood in fabrication of final project
laser cutting
Morn MT3050D CO2 Laser Cutter
I going to use laser cutting machine
Fusion 360
sofware
sofware
I used fusion 360 to draw my design as its easy to use ,friendly interface and easy to modify the project on it .
Hex alankey
I going to use hex Alan key to fasten screw with.
3m screws and nuts
3mm - Hex head
I going to use screws and nuts to Join parts with each others
Laserwork
sofware
sofware
I used laserwork to prepare files for cutting on laser cutting machine.
Using Fusion360 software start to make 3D model
choose to start by sketching an angled side of the project (making a new sketch on one of sides of origin)
and develop it step by step(Rectangular pattern).
my technique is sketch one part then extrude it till the end
Using Extrude a new body to 3mm width.
rotate the body at 30 degree
using rectangular pattern with 90mm width to repeat body
start a new sketch on a side of the other side of the origin to make the integrated part with the last part.
using rectangular pattern to create the other 2 bodies.
start a new sketch on one side of pre-created bodies then draw the side with dimension and fully defined.
then choose projection to make slots on the side .
Extrude a new body to 3mm thickness.
Using 3D mirror I draw the other side
made an offset plane to make the front part
start new sketch and draw the front with dimension and fully defined.
Extrude a new body to 3mm thickness.
made an offset plane to make the Arduino holder.
start new sketch and draw the Arduino holder with dimension and fully defined.
Extrude a new body to 3mm thickness.
download Arduino and open it on the file place it on its place.
taking the holes place to the Arduino on the holder then use extrude cut with 3 mm depth
using extrude cut with 1 mm depth to hold breadboard
sketch the back then extrude 3 mm depth
and so on the bottom part.
start sketch on the back to create Arduino power inlet using projection
use extrude cut with 5 mm depth
modify slots
adding T-slot for screws
sketch components holder and accessories
I select all bodies and create components from bodies and join as-built
3- Explain the fabrication process of your project. How did you use the machine to fabricate your project? (List the softwares/tools/materials...etc that you used)
Laser Cut Process:
my file parameters:
cut
power: 65%
speed: 18%
scan
power: 35%
speed: 300%then Inserted 3mm plywood sheet into the Morn MT3050D CO2 Laser Cutter machine
After coping the file to PC >>open the file on leaserwork programme >> download
on the machine we set origin, searching for the file name on machine screen>>press enter to start laser cutting.
After cutting I joined the parts together and added screws.
Project Electronics & Power Management
4- Describe your electronic circuit. What are the input and action components? What is the function of each? How do the components integrate together to form your smart system? (List the softwares/tools/components...etc that you used)
LCD (Character LCD 4×20) Blue
piezo 5v
LEDs
Arduino UNO
Breadboards
touch button
I2C
keypad
RTC module
5V adaptor
wires
electric Tape
OUTPUTS
INPUTS
OTHER
4 LEDs for alarm issue
LCD to display the interface to user
Piezo to alarm issue
Keypad to enter data by user
RTC module to add the virtual time to project
touch button to stop alarm
4 resistors 320 ohm for LEDs
Wires (female-male)(female-female)(male-male) to connect components
Breadboards to connect components
Brain
Power managements
Arduino uno rev3 to sent signal to components in my circuit to make it a smart one.
Adaptor 5V to supply the circuit with an appropriate voltage and current.
The power source is 5V adapter as
LED needs less than 5v adaptor and piezo needs 5v .
components intergradation
connect to Arduino
keypad has 7 pins to connect start connect:
-- keypad from 4 black pins (rows)to end to Arduino
-- LCD VCC with 5 v Arduino
GND with ground Arduino
SDA with A4 ARDUINO
SDL with A5 ARDUINO
--Touch button VCC with 5 v Arduino
GND with ground Arduino
in-pin with a digital Arduino pin
--LEDs attached on breadboard with resistors as they are 3v only and Arduino gives 5v(not to damage)
--one leg of lED go with one digital pin and the other with the ground
--Piezo attached one leg with one analog pin and the other with the ground
Set time
user set rooms time using LCD (display data) and keypad(entering data) that saved on a EEProm (internal storage in Arduino)
user can Check the room timing choosing (show option) Pressing ( key 2 ) on keypad and interface on LCD
Alarm time
when its the time RTC compare time and LEDs & Piezo make noise to grape attention
patient can stop alarm using touch button
5- What is your power source? How did you select the suitable power source for your project? (List the softwares/tools/components...etc that you used)
the circuit needs 5v adaptor
I searched for every components voltage and current
all my component needs only 5v
5V adaptor
Testing
Project Programming
6- Describe the code of your project. How did you program each function of the project?
__Over View____________________________________
this chart explain code for one room:-
all system depends on the equality of the alarm and real time so i began with if else statement check the equality
most part of the system go through the un-equality of the alarm and real time and the rest of code shows alarm behavior.
__libraries____________________________________
1-LCD:
#include<LiquidCrystal_I2C.h>
#include<Wire.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
2-Keypad:
#include<Keypad.h>
const int ROW_NUM = 4; //four rows
const int COLUMN_NUM = 3; //three columns
char keys[ROW_NUM][COLUMN_NUM] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte pin_rows[ROW_NUM] = {8, 7, 6, 5};
byte pin_column[COLUMN_NUM] = {4, 3, 2};
Keypad keypad = Keypad( makeKeymap(keys), pin_rows, pin_column, ROW_NUM, COLUMN_NUM );
3-EEPROM:
#include<EEPROM.h>
4-RTC:
#include <TimeLib.h>
#include <DS1307RTC.h>
Functions:
Core of the system:
set_time function:
First we will build what will appear in lcd (Interface) :
Using : lcd.clear(), lcd.print(), lcd.setCursor():
//------interface------- //
lcd.clear(); //
lcd.setCursor(0,1); //
lcd.print(" *-del #-back"); //
lcd.setCursor(0,0); //
lcd.print("Time: "); //
lcd.setCursor(8,0); //
lcd.print(":"); //
lcd.setCursor(6,0); //
create variable to save the inserted time later:
String copier;
Making a way to wait the user with our rules(function):
char key = ;
//------wait-input---------
key = NO_KEY;
while(key == NO_KEY)
{key = keypad.getKey();}
//-----------------------------
We want to insert numbers from keypad for:
1-add on copier variable.
2-appear on LCD in the right position.
So:
lcd.print(key);
copier = copier + key;
inserting number should jump after “:” symbol so we will use length of variable copier to do that
if(copier.length() != 2) {
lcd.print(key);
copier = copier + key;
}
else {
lcd.setCursor(9,0);
lcd.print(key);
copier = copier + ":" + key; }
before we continue we have to discuss EEPROM first
2- set_in_EEPROM()
Simply, EEPROM is a non-volatile memory has 1024 place to save the data.
Each place take one char, so we have 4 rooms every room has alarm time in string dtype has 5 chars, so we want 20 places for all rooms in EEPROM.
This function made to save time alarm for each room character by character.
//-----------set-the-time-in-EEPROM---(function)-------------------------------
void set_in_EEPROM(int start_pos, int end_pos , int extra_pos, String times)
{
for(int i = start_pos ; i < end_pos ; i++)
{
Serial.print(times[i]);
EEPROM.update(i, times[i - extra_pos]);
}
}
//-----------------------------------------------------------------------------
We will notice that ( times[i - extra_pos] ):
Numbers range for EEPROM change while indices of variable not so we have to subtract from start point number to begin range of numbers from 0 as indices does for any variable.
3- get_from_EEPROM function
Almost the same idea of set_in_EEPROM function
//--------------getting-epprom-time----------------------------------------------
String get_from_EEPROM(int start_pos, int end_pos)
{
String tim_back;
for(int i = start_pos ; i < end_pos ; i++)
{
char letter = EEPROM.read(i);
tim_back = tim_back + letter;
}
return(tim_back);
}
//-------------------------------------------------------------------------------
Lets return to set_time function:
A way to back in case you don’t want to set time
//-------back--------------
if (key == '#')
{
lcd.clear();
lcd.print("ok!...");
delay(500);
switch(room_num)
{
case '1': return(String(get_from_EEPROM(0, 5)));
case '2': return(String(get_from_EEPROM(5, 10)));
case '3': return(String(get_from_EEPROM(10, 15)));
case '4': return(String(get_from_EEPROM(15, 20)));
}
}
Condition for breaking while loop:
if(copier.length() == 5)
break;
finally return copier:
return (copier);
Alarm
when it set time (from user saved in EEPROM) = real time (from RTC module) Arduino gives signals to LEDs and Piezo
putting the last condition on if condition touch button if its low () there is alarm else stop alarm
Project Integration & Testing
7- Demonstrate with text and visuals how did you integrate the project’s modules together? What are the testing results? (Include a Demo video separately, showing a proof of functionality)
first of all I test each component if it works or not then start to test:
Piezo with LEDs
LCD with Keypad
LCD & Keypad & EEPROM with Piezo & LEDs
LCD & Keypad & EEPROM & Piezo & LEDs with touch button
LCD & Keypad & EEPROM and RTC
Piezo with LEDs
LCD & Keypad & EEPROM with Piezo & LEDs
test LCD with keypad
Sharing & Collaboration
8- Did you ask for feedback? What are the ideas that others have contributed or suggested? What was someone else’s idea that you built upon? How did you help your peers? How did your peers help you?
my old version idea had 3 piezo Amany suggested to use one piezo rather than 3 and this simplify my idea and helped alot .
my brother helped me alot in building the code and minimalize it to 25% from the original version the by using functions (450 code statements).
this is my first brother's notebook "Spam Filtering" on kaggle
Overcoming Challenges
9- When you got stuck, what/who did you turn to? At what point did you have to pause to research or learn more before moving on? What are some mistakes, pitfalls, or challenges that others can avoid if they were doing this project?
1-i had a problem in RTC how it works unfortunately my first RTC module was broken that take me 2 days ti know that was After trying many options and codes the problem was that there is no increment in time so I hade to replace it again from the store and that time it works
I check it with that code
2-I tried to solder LEDs with wires , but I failed. The wires and LEDs were damaged I connected new wires and LEDs with tape finally it works.
Future Work
10- If you had more time, what is one thing you would change/ Do next in your project?
if I had more time I would take some days to try random ideas and enjoy it