Medication dispenser project


I have only taken Introduction of Programming course before and basically have no background of coding, neither in 3D printing. This course is a total new experience for me to combine the 3D printing and programming together and the first time to get to know about ESP32 and Arduino.  Group member Adrian contributed a lot in the programming and so did Roda.


The actual ideas of building a rotating medical box which alert the family members and caretakers was given by Roda, and we thought it is a brilliant idea, Hence we started the project.

What did you need to learn 

Building a rotating medical box using ESP32 requires a combination of technical skills and actual design. We searhed online for some example but unfortunnally the details of the design was not clear from those examples. We recicved helps from the teacher and decided the  key aspects to learn for successfully implementing this project.

ESP32 Programming is important, the ESP32 microcontroller is the heart of the project, and learning to program it is essential. WE need to familiarize ourselves with the ESP32 and the Arduino, which provide tools and libraries for ESP32 development. Learn about General Purpose Input and Output control, serial communication, and sensor integration.

Stepper Motor Control as the Rotating system play a crucial role in the rotating mechanism of the medical box. Gain an understanding of how stepper motors work, different types of stepper motors, and their wiring configurations. Learn about controlling stepper motors using libraries or directly through GPIO pins, including concepts such as steps, direction, and acceleration.

We were also discussed the notification system that how we suppose to send notification when patients forgot to take the tablets. With 24 hours, the buzzer and LED light will start working and after 24 hours, the system will automatically send messages to the family member and caretaker. So, we need to figure out the process of Buzzer and Led works with ESP32, and how would it be to connect WIFI to send messages. WE thought of connect a buzzer and an LED to GPIO pins on the ESP32. Ensure you have the necessary resistors and wiring components. Set up the Arduino IDE with the ESP32 board support package. Install the necessary libraries for the ESP32, including the libraries for Wi-Fi, WhatsApp integration, and any additional dependencies required by the buzzer and LED. Write the code to control the buzzer and LED based on specific events or triggers. Or use the built-in functions to generate sound patterns or control the LED’s brightness or color.

Learn about basic electronics, including voltage, current, resistors, capacitors, and transistors. Study circuit design principles to create a reliable and efficient electrical system for the rotating medical box. Understand how to connect and interface the ESP32 with other components, such as sensors, stepper motor drivers, and power supplies. With the Sensor Integration, we need to integrate various sensors. Learn about sensor types, such as proximity sensors, temperature sensors, or humidity sensors, and how to interface them with the ESP32. Explore sensor library and understand how to read sensor data and make decisions based on the measurements. But eventually we chose servo motor as the sensor to monitor the movement of the door.

Besides the above we were also given the suggestions from teacher about the display of the date and time for using LCD(Liquid Crystal Display), how does the LCD works with ESP32 is our main concern.

All the theory phares were done in March and April. Here is the timeline of previous works:

  • Prior dates 
  • Planning the design 
  • 02.03.2023 
  • Identifying & Acquiring component parts 
  • 09.03.2023 
  • – 
  • 16.032023 
  • Rotating system (stepper motor) 
  • 30.03.2023 
  • Notification system 
  • Buzzer (final tune needs to be chosen) 
  • LED light 
  • Whatsapp msg 
  • 06.04.2023 
  • Door system (servo motor, button) 
  • Get & Display date and time (LCD) 

For the Whatsapp notification, We managed to find a free WhatsApp API called CallMeBot, this can be useful to receive notifications from the ESP32 with sensor readings, alert messages when a sensor reading is above or below a certain threshold, when motion is detected, and many other applications. WE started by getting the CallMeBot API Key, and then to make a POST request to the URL with our own information including phone number, message and our own API key. Nest step is to installing the URLEncode Library, it was successful. And we also considered to send multiple messages to different people at same time.

The building phase 

We started building and testing each components with ESP32.

Stepper motor setup
All parts on the table
3D printed rotor and cage

And the timeline of building phrase.

  • 04.05.2023 
  • Combining codes 
  • 11.05.2023 
  • Combining all the wirings 
  • 3D printing the medical box 
  • Intensive week  
  • Combining everything 

The outcome 

Unfortunately our project didn’t work at the final stage, all the components worked very well independently however when the codes were combined, we started to get problems with the libraries and the modules which hadn’t happened before. However we did learned tremendously from this project. By studying this course we have learned valuable insights into the world of embedded systems. Especially by studying the ESP32 is big help for the following innovation study.

We have learned Microcontroller Architecture by understanding the architecture and components of the ESP32 microcontroller provides a solid foundation for working with other microcontrollers. Learning about the CPU, memory organization, pins, timers, and peripherals helps in designing and developing efficient and scalable embedded systems. Also for the programming skills by working with the ESP32 requires learning how to program, as well as using specific frameworks like the Arduino IDE or ESP-IDF. This enhances programming skills and promotes familiarity with low-level hardware interactions and high-level application development. I personally didn’t learned much about programming, still a mystery for me. A big surprise is how much resources we get from a big community of people who interested in ESP32, it has a large and active community of developers and enthusiasts for example

By engaging with this community, studying online resources, and participating in forums and discussions, individuals gain access to a wealth of knowledge, tips, and best practices, fostering continuous learning and collaboration. Working with the ESP32 also teaches the importance of proper project management and documentation. By documenting code, hardware connections, project specifications, and design decisions, individuals develop skills in organizing and documenting projects effectively, enhancing future collaboration and maintainability. The ESP32’s versatility and capabilities inspire creativity and innovation. Studying the ESP32 fosters a mindset of exploring new possibilities, experimenting with different applications, and pushing the boundaries of what is achievable in the future. And also provides a wide range of technical skills, develop a problem-solving mind that can be applied to various projects and studies.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.