Introduction: PillPoint(smart Pill Dispenser) --- HOWEST, CTAI
Picture a device that not only assists in adhering to medication schedules but also intervenes to prevent erroneous pill consumption through auditory cues. This innovative solution serves as a dependable aid for individuals managing complex medication regimens, including elderly populations, mothers navigating childcare responsibilities, and those contending with chronic health conditions.
By seamlessly integrating into daily routines, this advanced pill dispenser offers a sense of security, ensuring medications are administered timely and accurately. Its proactive approach fosters confidence in health management, positioning it as an indispensable tool in promoting wellness and treatment adherence.
Supplies
- Raspberry Pi 5 - 8Gb - Starter Pack (2023)
- Full HD 1080P Webcam with Built-in Microphone, USB Web Computer Camera
- Dispenser
- Project Kit Freenove
- Wooden Planks
- Paint
Step 1: Search Pictures for the Dataset
Searching for pictures of hands, pillboxes, pills
Step 2: Label Pictures
In Roboflow label pictures, so that there are at least 1000, using a detection model
For the pillBox, we label every compartment as well as the openings. At the end, we have 18 classes in Roboflow
Step 3: Download on Computer
You can click export as zip file your images labeled
Step 4: Visual Studio
Go to Visual Studio code.
Create an AI folder and an RPi folder in a repository.
Step 5: AI Part
Now you can add the unzipped file with the yolov8 from roboflow to the AI folder
Step 6: Change the Data.yaml File
The path needs to be changed
train: train/images
val: valid/images
test: test/images
Step 7: Create an Ipynb File
In the folder with the model from roboflow, create a file name.ipynb. That is a jupyter Notebook file.
There, you need to check first the paths to the train, test and valid images.
Step 8: Train the Model
Create another cell and put this code that is going to train the model.
Step 9: Create Image in Raspberry Pi
You need an SD card that has to be introduces first in the computer.
After that, follow the instructions in the video.
At the end, you introduce the SD card in the raspberry pi and reboot it.
Step 10: SSH Connection
On visual studio code, you click the remote button in the left bar and choose the adding connection. Mine was 192.168.168.167
Step 11: Connect to RPi
Make sure the AI folder and RPi folder are in the same repository.
Open a separate window of VS code with the connection to raspberry.
Then press Pull, so that all the changes made in the other window show up in the connection window as well.
Step 12: Rpi
this folder needs to have another subfolder Classes with 2 files: LCD, Buzzer and RGB LED.
Step 13: LCD
The LCD display needs the address, then it
Step 14: Buzzer
I am using the active buzzer from the Freenove Project kit which is at GPIO12. I created the bad notification tone to sound like a melody.
Step 15: RGB LED
Code for creating the RGB class, which should give the green and red lights accordingly. In the code, I also included the ADC reader.
Step 16: App.py
In RPi, but outside of Classes, program the WIFI connection between the computer and the raspberry pi, initialise the Buzzer and the LCD. Then run the code.
Step 17: AI Code
Create another name.py Python file where you code the program so that it detects the position of the pillbox compartments. Then, it detects if it is the right one or the wrong one. If it is the right one, the RGB LED turns green. If it is the wrong one, the RGB LED turns red and the buzzer goes off.
This is connected to the training with YOLOv8 and also to the WIFI, so that it can communicate with the RPi part of the project.


