Search

Automated pill dispenser - finally finished

Updated: Sep 10




Since I started working on the pill dispenser 9 months ago, there have been seven different versions, each improving on the previous. Before settling on version 8,

In case you missed the previous videos and blog posts, you can find them here:




<---First video in the series





second video--->






<---latest video







We'll go over all the new changes now that you're up to date.

In terms of the physical design, I didn't really see anything that needed to be changed. I added the few obvious things: cable routing for cable management and a place to tuck away all the messy electronics.


The electronics took a lot of the Research and Design time, and I know it looks unimpressive, but that's the point, and I had to jump over some unnecessary hurdles to get here.


I just hated the previous design,

I used two microcontrollers to do the task of one. This mostly came from my inexperience and really wanting it to be connected to Wi-Fi. Essentially the D1 mini would talk to home assistant and it would get commands from node red on when to dispense pills. which would then tell the Raspberry Pi Pico to dispense the pills until the vibration sensor was set off, and all of this just because I couldn't set the frequency of the servos on Esphome. because in previous testing I found that 40 Hz instead of the default 50Hz gave me more moveability, and I could only change it on micro-python and that's how we ended up with this mess,


The new version is much simpler it only uses one microcontroller running micropython, which solves my problem with setting the servo to 40Hz and gives me Wi-Fi access.

The code is also a lot simpler,


I'm simply getting the current time from google's ntp server, and checking it against lists with times of when to dispense pills and the whole thing Loops every minute.







I made this cute little pinout board for my setup it helps to neaten it up. I did recently get approached by pcbway to sponsor a project, so if enough people would like a neat version of this I would be happy to work with them just let me know.



Currently you have to hardcode all the times you'd like pill to be dispensed and this works for me and I understand that might be intimidating to some people, I did consider working on a web-based UI. but with not a lot of experience programming in Javascript this was a bit daunting for me, but if there is enough interest or if you are a developer yourself who would be willing to lend me a hand but if there is enough interest or if you are a developing yourself who would be willing to lend me a hand. I even made this cool little mockup:


if you would like to build one yourself, here are some links to help you out:

https://www.printables.com/model/261354-pill-dispensers-v8

https://github.com/FireMarshmellow/pill-dispenser



740 views0 comments

Recent Posts

See All