An automated Medicine Reminder that reminds you to take your medicine in time.
For any query please mail at ashraf_minhaj@yahoo.com
PARTS YOU'LL NEED:
1. Arduino pro mini -5v 16mHz
2. Buzzer3. 330r/220 /1k resistor
4. Vero board
5. Female pin
CODE:
After restarting the Arduino it waits for 24 hours and then keeps on buzzing.
Change the delay as your requirement.
It won't stop untill you press the restart button, which means you have to get
to your medicine box in order to stop the alarm. And after you press the button
it'll again alarm after 24 hours.
24 hours = 24 * 60 minutes
= 24 * 60 * 60 seconds
= 24 * 60 * 60 * 1000 mili seconds (1sec = 1000 mili second)
= 86400000 ms
/* MeDuino: Automatic Medicine reminder. * By Ashraf Minhaj www.ashrafminhajfb.blogspot.com * For any query mail at ashraf_minhaj@yahoo.com * * Use this and you'll never miss your medicine. * * This is made for my Mother - Sahida Rahman. * I LOVE YOU MOM. */ const int blue = 3; // Connect BLUE LED to pin 3 int buz = 2; // Buzzer on pin 2 void setup() { // initialize the LED & Buzzer pin as Output: pinMode(blue, OUTPUT); pinMode(buz,OUTPUT); } void loop() { tone(buz,1000,100); //Beep for 1 second- Starting Sound delay(86400000); /*delay 24 hrs. untill next period to take med. * 24hr * 300s * 1000ms */ goto buz; //going to buz: goto Statement buz: { digitalWrite(blue, HIGH); //Blue led on delay(100); digitalWrite(blue,LOW); //LEd off --thus BLINK delay(100); tone(buz,1000,150); //Start beeping delay(1000); goto buz;/*going again to buz: so that the Code runs untill you come near the Medicine Box and Push the reset switch*/ } }
Comments
Post a Comment