Development scheme of intelligent medicine cabinet for the elderly based on ESP32

 

♦Name:Smart medicine cabinet pcba

♦Master control chip:ESP32-WROOM-32

♦Pharmacoguidance mechanism :9g micro steering gear (one per cell)

♦Voice reminder module:SYN6288 TTS module (+ 3W speaker)

♦Display module:1.3 inch OLED screen (128*64)

♦power-supply module :18650 lithium battery (2 batteries in parallel) +TP4056 charging plate

Product Description

The scheme takes “easy to use for the elderly, controllable for children, stable and reliable” as the core, and relies on the WiFi/Bluetooth dual-mode capability of ESP32 to realize timed voice reminder, automatic pop-up of medicine grid, local/remote time setting functions. The specific design is as follows:

Core hardware selection (low cost + high stability)

 

Module type

Recommended model/specification

 key role

Elderly friendly design considerations

Master control chip

ESP32-WROOM-32

Coordinate timing, communication, and drive control

Built-in WiFi/Bluetooth, no additional modules, simplified circuit

Pharmacoguidance mechanism

9g micro steering gear (one per cell)

When the time is up, the corresponding drug grid pops up

Moderate torque (0.8kg·cm), soft spring force, no grip

Voice reminder module

SYN6288 TTS module (+ 3W speaker)

Customized speech (e.g., “It’s time to take your blood pressure medication”)

Supports Mandarin/dialect, volume adjustable (max 90dB)

Display module

1.3 inch OLED screen (128*64)

Display time, medication name, power

The font size is enlarged to more than 16px and supports color reversal display

 power-supply module

18650 lithium battery (2 batteries in parallel) +TP4056 charging plate

Power supply and charging protection

Voice and screen alerts when the battery is low, and mains power backup is supported

Physical buttons

3 large size silicone rubber keys (diameter 15mm)

Local “confirmation reminder”, “view plan” and “cancel”

The button protrudes 2mm, with clear feedback and no accidental touch

Assisted detection (optional)

Infrared photoelectric sensor (E18-D80NK)

Check whether the elderly take the medicine to avoid repeated reminders

Non-contact detection, no additional operation for the elderly

medicine cabinet

Implementation logic of system core functions

1. Timed reminder & Drug card pop-up process (core experience)

  1. Time trigger: ESP32 synchronizes the NTP network time through WiFi (uses internal RTC timing when disconnected from the network), and triggers the process after reaching the preset medication time;
  2. Multi-dimensional reminder: SYN6288 plays the voice first (such as “Grandpa Zhang, it’s time to take the hypoglycemic medicine at 9 o’clock in the morning”), and the OLED screen displays “medication name + dosage”;
  3. The medicine bar pops out: the steering gear corresponding to the medicine bar turns (preset Angle 120°), and the medicine bar is pushed out 1-2cm (convenient for the elderly to take medicine);
  4. Confirm termination: if the infrared sensor detects that the medicine is taken away, or the old person presses the “confirm” button, remind to stop; if the medicine is not taken within 5 minutes, repeat the reminder once (to avoid missing the medicine).

2. Time setting mode (both ends are controllable, taking into account the elderly/children)

(1) Local Bluetooth Settings (for elderly/children to operate in close proximity)

  • The mobile phone (Android /iOS) is connected to ESP32 through Bluetooth (the name of the Bluetooth is set as “elderly medicine cabinet _XXX” for easy identification);
  • Set it up with a simple APP (recommended to use MIT App Inventor visual development, no programming required): select the pill compartment (e.g., “No.1 compartment-antihypertensive drug”), set the time of taking the medicine (hours/min), and input the name of the drug (the APP automatically synchronizes to the TTS module and generates voice).

(2) Remote WiFi Settings (children control in different places)

  • ESP32 connects to the home WiFi and accesses the MQTT Internet of Things server (recommended free EMQX server or Aliyun IoT);
  • Children can remotely send the instructions of “new medication plan” and “modified time” through the mobile APP/weChat mini program (along with the same server);
  • After the instruction synchronization, the ESP32 screen displays “The medication plan has been updated” and a voice prompt (such as “The medication time has been adjusted. Please check the screen”).

 Elder-friendly detail optimization (key experience)

  1. Voice optimization: TTS voice adopts “gentle female/ male voice”, and supports the recording of children’s voice (such as “Mom, it is time to take blood pressure medicine”), which is more acceptable to the elderly than mechanical sound;
  2. Medication compartment design: The medication compartment is made of food grade ABS material, the single compartment capacity is more than 10ml (can hold 3-5 tablets/capsules), after popping out, the medication compartment does not fall off, and can be manually pushed back to reset after taking medicine;
  3. Error-proof design: If the same time of medication plan is set repeatedly, ESP32 will give a voice prompt “There is a plan at this time, do you want to overwrite?” to avoid remote operation conflict of children;
  4. Emergency handling: When WiFi/Bluetooth is disconnected, ESP32 uses the internal RTC to continue timing, and automatically synchronizes the time and schedule after networking, without requiring the old person to reset.

Key points of stability test

  1. Timing accuracy: 72 hours of continuous test, time error ≤1 minute after NTP synchronization, RTC error ≤5 minutes/day after network disconnection;
  2. Reliability of servo motor: 1000 times of single pop-up-reset cycle test, no jamming, no overcurrent burn (add servo motor overcurrent protection circuit);
  3. Reminder effectiveness: The volume is set to 70dB (the common hearing range of the elderly), which can be clearly heard within 5 meters. The interval of repeated reminders can be customized (1-10 minutes).