DIY Automatic Pill Dispenser

by ardutronic123 in Circuits > Assistive Tech

2506 Views, 3 Favorites, 0 Comments

DIY Automatic Pill Dispenser

How I made an Automatic Pill Dispenser

My younger brother and sister, unfortunately, have to take medication every day. Every evening you have to make sure that they do not forget to take the pills. I figured I could spice it up a bit by buying a pills dispenser, but most of the products were either too expensive or not intuitive to use. I decided to build my own device which does a great job! But from the beginning.

Assumptions

1.png

I would like my device to be as easy to use as possible, and ideally, the kids shouldn't have to do anything except taking pills. It will not have any buttons because it will be controlled via wifi thanks to the BLYNK app. I designed a dispenser that has 14 slots, which means the pills will last for a week, assuming two people will take one pill in the evening. The 18650 battery will be responsible for powering the electronics, and I will charge it via USB type C.

PCB Preparing

DSC_1459.JPG

Based on these assumptions, I created the layout diagram, determined the shape of the board, and placed all the components in it, and Eagle created the wires himself. Then I ordered a PCB from PCBWay and was informed that they would come to me in a week. At that time, I decided to sort the parts I had so far so that I would know what I was missing for this project. Unexpectedly, 4 days after placing the order, the courier with my PCB was waiting at the door.

Microchip

In my project, I used 3 components from Microchip which play a very important role. The first is a DC / DC boost switching regulator that will power devices that require 5V. The second is a 3.3v stabilizer that lowers the voltage for ESP. The third component is the RTC module, thanks to which the dispenser can dispense pills at a set time.

A Minor Mistake

DSC_1473.JPG

After unpacking the shipment, I immediately spotted an error with the battery holder, namely, instead of the 18650 battery holder, I put an AA battery holder. However, I decided to use an ordinary 3.7V battery. I also had to cut a piece of PCB to be able to put the USB socket in its place.

Soldering

DSC_1498.JPG
DSC_1482.JPG

So it's time to soldering. This time I soldered the board using a soldering iron. I put the flux and tin on one of the pads, put the resistor in its place, soldered it first to the first pad, and then to the second pad, and repeated this action with the rest of the elements. As the first, I soldered the charging module, and after making sure it was working properly, I proceeded to solder the ESP12.

Programming

shot_210124_155458.png

To upload a program to ESP, press the button on the board, connect the power, and finally put the programmer in its place. I uploaded the code supporting the BLYNK application, thanks to which I checked whether the communication between them is as it should. Then I soldered the components responsible for increasing the voltage from 3.7V to 5V, which is required to power the servo and the stepper motor. This is how the finished tile looks like.

Bye RTC

shot_210124_155141.png

There is a place to solder the RTC module on the PCB as I had a plan to connect the ESP to the Arduino cloud, however, I was not able to do that so I decided to use the BLYNK application which supports controlling ESP outputs depending on the real-time. For this reason, I didn't have to use this module on my board, however, you can do so if you want to use it offline.

3D Printing

DSC_1616.JPG
DSC_1618.JPG

The most time-consuming part of this project turned out to be 3d printing because I had huge problems with ABS printing on my 3d printer - the prints were detaching from the table, making them finally deformed. I tried various solutions - glue, glass table, temperature changes, but the best result was when I placed the printer under the desk and covered it with a blanket to keep it warm.

Assembling

DSC_1593.JPG
DSC_1610.JPG
DSC_1601.JPG
DSC_1606.JPG

The time has finally come to assemble this project. I started by putting brass inserts with a soldering iron. Then I put the parts of the frame together and tightened the screws. I folded the frame and placed the sides of the housing in it, and screwed the PCB to the top panel. In the middle of the top cover, I placed magnets, thanks to which I created a magnetic closure.

That's All!

DSC_1683.JPG
DSC_1678.JPG

The final step was to write the code and configure the application. Now I can upload the program. It works in such a way that at a certain time it gives a tablet that we must first place in the dispenser. When filling, we need to close the hole with the servo that will be lowered during the first dispensing of the drug.

My Youtube: YouTube

My Facebook: Facebook

My Instagram: Instagram

Get 10 PCBs for only $5: PCBWay