What it shows
A real time clock chip keeps time even when the board is off, using a coin cell. The Arduino compares it with set alarm times and sounds a buzzer until a button is pressed.
The science
The DS3231 has a temperature-compensated crystal and is accurate to a minute or two a year. It talks to the Arduino on the I2C bus and gives hour, minute and second. The sketch stores three alarm times in an array. When the clock matches one and the dose has not been acknowledged, the buzzer and LED turn on, and pressing the button turns them off and records the acknowledgement.
Materials
Cost: under Rs 1,500. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.
- An Arduino Uno or Nano
- A DS3231 real time clock module with a CR2032 cell
- A 16 x 2 I2C LCD
- A buzzer and a green LED with a 220 Ω resistor
- A push button to say the dose has been taken
- A box with three compartments and a power bank
Safety
For this project: USB power only. This is a reminder model for learning, not a medical device: a family member must always check the real doses. Do not rely on it for anyone’s health.
Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.
All the safety rulesStep by step
8 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.
Connect the DS3231 and the LCD to the I2C bus: VCC to 5 V, GND to GND, SDA to A4 and SCL to A5.
Install the RTClib and LiquidCrystal_I2C libraries.
Run the example that sets the time from the computer clock, then comment it out.
Connect the buzzer to pin 8, the green LED to pin 7 and the button between pin 2 and GND.
Store the three alarm times for morning, afternoon and night as hours and minutes in arrays.
In loop, read the time and show it on the LCD; when it matches an alarm minute, set alarm active.
While the alarm is active, beep every second and light the LED; the button clears it and shows TAKEN on the LCD.
Test by setting an alarm one minute ahead; check that the clock keeps time after unplugging for a day.
What you should see
At each set time the buzzer sounds until the button is pressed, and the clock keeps correct time when the power is removed.
Viva questions
A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.
1Why use an RTC chip?
The Arduino clock is lost when powered off, but the RTC runs from its own cell.
2What bus does it use?
The I2C bus, using two wires, SDA and SCL.
3Why does the program need a flag for the alarm?
So the alarm triggers once and does not repeat every second during that minute.
4Why is this not a medical device?
It has not been tested for safety and can fail, so people must check doses themselves.
Take it further
Add a second button to snooze the alarm for ten minutes.
Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.
