This repo includes the simulation of the Medibox using ESP32.
The ESP32 Medibox is a smart medicine box designed to help users effectively manage their medication schedules. Utilizing an ESP32 microcontroller, it integrates various sensors, actuators, and communication modules to offer a comprehensive medication management solution.
Built using the following tools and technologies:
You can view the complete circuit diagram and simulation on [Wokwi]https://wokwi.com/projects/391493988516700161).
- WiFi Connectivity: Enables remote monitoring and control via MQTT.
- Temperature and Humidity Monitoring: Uses the DHT22 sensor to track environmental conditions.
- Light Intensity Measurement: Detects ambient light levels with LDRs and adjusts the servo motor accordingly.
- Servo Motor Control: Modulates the position of the shaded window based on light intensity.
- Buzzer Notifications: Alerts users for scheduled medication times.
- Button Interface: Allows user interaction for canceling alarms or confirming actions.
- Customizable Settings: Adjusts the servo motor’s minimum angle and control factor through MQTT.
- ESP32: The central microcontroller for the system.
- DHT22: Sensor for measuring temperature and humidity.
- LDRs: Light-dependent resistors to measure light intensity.
- Servo Motor: Controls the shaded window's position.
- Buzzer: Emits audio notifications.
- Buttons: Facilitates user interaction.
The ESP32 Medibox assists with medication management through:
- Monitoring: Continuously tracks temperature, humidity, and light intensity.
- Notifications: Provides timely reminders via a buzzer for medication.
- Remote Control: Enables remote adjustment and monitoring via MQTT.
The system is adaptable, allowing users to customize parameters like the servo motor’s minimum angle and control factor.
You can find the Node-RED flow for this project in the node-red-flow.json
file. Import this file into your Node-RED setup to interact with the ESP32 Medibox through MQTT.
To set up Node-RED:
-
Install Node-RED:
- First, install Node.js.
- Then, run this command to install Node-RED:
npm install -g --unsafe-perm node-red
-
Start Node-RED:
- Use the command:
node-red
- Access Node-RED at http://localhost:1880.
- Use the command:
-
Create and Deploy Flows:
- Design and deploy flows in the Node-RED interface to interact with your ESP32.
Node-RED allows you to build interactive dashboards and control mechanisms for enhanced functionality.
This project utilizes the following MQTT topics:
- MQTT-ON-OFF: Controls the buzzer (ON/OFF).
- MQTT-SCH-ON: Manages buzzer notification schedules.
- MQTT-TEMP: Receives temperature readings.
- MQTT-LDR: Receives light intensity data.
- MQTT-MIN-ANG: Sets the servo motor’s minimum angle.
- MQTT-CTRL-FAC: Adjusts the servo motor’s control factor.
- MQTT-DROP-DOWN: Chooses predefined settings for the servo motor.
To begin with the ESP32 Medibox:
- Clone the Repository:
git clone https://github.com/Chathura-Jayasinghe/ESP32-Medibox