Tekko BDSimSimulatorProjects

ওষুধের রিমাইন্ডার ঘড়ি — DS3231 আর দুটো নব দিয়েMedicine Reminder Clock with DS3231

DS3231 নিজের কয়েল সেলে সময় ধরে রাখে, লোডশেডিং হলেও ঘড়ি থামে না। দুটো নব ঘুরিয়ে ওষুধের সময় ঠিক করা যায় — ঠিক সময়ে সবুজ বাতি আর বাজনা চালু হয়ে যায়।

The DS3231 has its own coin cell and a temperature-compensated crystal, so it keeps time through load-shedding. Two knobs set the reminder hour and minute — no phone, no menu — and at that time the green lamp and buzzer take over.

▶ ফ্রি চালিয়ে দেখো / Run it free Parts অর্ডার করো (WhatsApp)

সার্কিট ডায়াগ্রাম · Circuit diagram

Medicine Reminder Clock with DS3231 circuit diagram — Arduino Uno R3, Clock module (DS3231 RTC), LCD 16x2 with I2C, Knob (potentiometer), Buzzer (5 V), Resistor 330Ω, LED (green), Jumper wires

যা যা লাগবে · Parts you need

তার লাগানো · Wiring

Clock module (DS3231 RTC) VCC→Arduino Uno R3 5V
Clock module (DS3231 RTC) GND→Arduino Uno R3 GND
Clock module (DS3231 RTC) SDA→Arduino Uno R3 A4
Clock module (DS3231 RTC) SCL→Arduino Uno R3 A5
LCD 16x2 with I2C VCC→Arduino Uno R3 5V
LCD 16x2 with I2C GND→Arduino Uno R3 GND
LCD 16x2 with I2C SDA→Arduino Uno R3 A4
LCD 16x2 with I2C SCL→Arduino Uno R3 A5
Knob (potentiometer) 1→Arduino Uno R3 5V
Knob (potentiometer) 2→Arduino Uno R3 GND
Knob (potentiometer) W→Arduino Uno R3 A0
Knob (potentiometer) 1→Arduino Uno R3 5V
Knob (potentiometer) 2→Arduino Uno R3 GND
Knob (potentiometer) W→Arduino Uno R3 A1
Buzzer (5 V) +→Arduino Uno R3 D8
Buzzer (5 V) -→Arduino Uno R3 GND.3
Arduino Uno R3 D13→Resistor a
Resistor b→LED A
LED K→Arduino Uno R3 GND.3

Code (Arduino C++)

#include <Wire.h>
#include <RTClib.h>
#include <LiquidCrystal_I2C.h>
// Medicine reminder clock: the DS3231 keeps the real time even without power.
// Two knobs set the reminder — the left one picks the hour, the right one the
// minute — so an elderly user can turn it to "9 at night" without a phone.
// When the clock reaches that time the green lamp lights and the buzzer
// sounds for half a minute.
RTC_DS3231 rtc;
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  Serial.begin(9600);
  if (!rtc.begin()) { Serial.println("DS3231 not found"); while (1) delay(10); }
  lcd.init();
  lcd.backlight();
  pinMode(8, OUTPUT);
  pinMode(13, OUTPUT);
}

void loop() {
  DateTime now = rtc.now();
  int hour = map(analogRead(A0), 0, 1023, 0, 23);
  int minute = map(analogRead(A1), 0, 1023, 0, 59);
  bool due = now.hour() == hour && now.minute() == minute && now.second() < 30;
  digitalWrite(8, due ? HIGH : LOW);
  digitalWrite(13, due ? HIGH : LOW);
  lcd.setCursor(0, 0);
  if (now.hour() < 10) lcd.print('0');
  lcd.print(now.hour()); lcd.print(':');
  if (now.minute() < 10) lcd.print('0');
  lcd.print(now.minute()); lcd.print(':');
  if (now.second() < 10) lcd.print('0');
  lcd.print(now.second());
  lcd.print(due ? "  MED!" : "     ");
  lcd.setCursor(0, 1);
  lcd.print("Med at ");
  if (hour < 10) lcd.print('0');
  lcd.print(hour); lcd.print(':');
  if (minute < 10) lcd.print('0');
  lcd.print(minute); lcd.print("  ");
  Serial.print("Clock ");
  if (now.hour() < 10) Serial.print('0');
  Serial.print(now.hour()); Serial.print(':');
  if (now.minute() < 10) Serial.print('0');
  Serial.print(now.minute()); Serial.print(':');
  if (now.second() < 10) Serial.print('0');
  Serial.print(now.second());
  Serial.print(" | Reminder ");
  if (hour < 10) Serial.print('0');
  Serial.print(hour); Serial.print(':');
  if (minute < 10) Serial.print('0');
  Serial.println(minute);
  delay(500);
}

আরো project · More projects