most pal one
Posts: 1
Joined: Tue Mar 03, 2020 7:15 pm

Rasp Berry Pi, Pill Dispenser

Tue Mar 03, 2020 7:20 pm

Hi,

I am trying to make a pill dispenser using a rasp berry pi and an Arduino. I am trying to structure it so that
I will create a web server on the Rasp Berry Pi with several URLs corresponding with each type of pill to be dispensed.
Then I will have one URL that consists of the user interface that will access one of the other several URLs .

I need to make a mechanism that runs a script to output a digital 3 bit signal from the gpio pins to the arduino.
How would I go about doing this?

Heater
Posts: 15968
Joined: Tue Jul 17, 2012 3:02 pm

Re: Rasp Berry Pi, Pill Dispenser

Tue Mar 03, 2020 8:32 pm

Do not do it.

When your pill dispenser fails the consumer of the pills will get sick or die through overdose or underdose.

Your pill dispenser will fail, judging by your experience level.

Do you really want that on your conscience?
Memory in C++ is a leaky abstraction .

jbudd
Posts: 1424
Joined: Mon Dec 16, 2013 10:23 am

Re: Rasp Berry Pi, Pill Dispenser

Tue Mar 03, 2020 10:16 pm

The original poster is new to the forum, I expect they will find advice along the lines of "Don't do that because you have insufficient experience" a bit less than helpful.
Perhaps the pills in question are homeopathic and when the device fails the patient will improve even faster.

I use MQTT (Mosquitto) to send messages between a Raspberry Pi and Arduinos, over a network / the internet. That lets me concentrate on making the devices do what I intend without worrying about the details of comms.

W. H. Heydt
Posts: 12671
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Rasp Berry Pi, Pill Dispenser

Tue Mar 03, 2020 10:23 pm

There are commercial pill dispensing "robots". See if you can arrange a tour of a pharmacy that uses one so you can see how it's done. The most common form (that I know of) uses cassettes to hold the pills, with a bar code on the cassette to identify the contents. Sometimes the wrong pills get loaded to the cassettes (either the wrong medication or the wrong dosage). When the error is discovered, the pharmacy will have standard reports that can be run to determine which patients received the erroneous meds. (That this happens often enough to have standardized reports does inform one that (a) it happens often enough for pharmacies to be aware of the issue, and (b) that expecting it to occur is part of the pharmacy software design. Potential inexperience on the part of the OP isn't the complete picture.)

jbudd
Posts: 1424
Joined: Mon Dec 16, 2013 10:23 am

Re: Rasp Berry Pi, Pill Dispenser

Tue Mar 03, 2020 10:35 pm

Some years ago I tried to come up with ways for a Pi to help ensure that a relative took their pills every day and only once a day.

After some thought I decided that a device that actually decanted the pills into a cup at the right time, if it failed to decant, would make the problem worse.
A screen to say "Take your pills now" and a button to confirm were likely to be forgotten.

Now it's myself who forgets if I've taken the damn things, I still don't think technology can improve on the little plastic boxes labelled Mon, Tue, etc.

I hope the OP can succeed!

PhatFil
Posts: 1681
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Rasp Berry Pi, Pill Dispenser

Tue Mar 03, 2020 11:27 pm

+1 for the little 7day pill boxes and (in my case) a dedicated alarm clock.. even with them i will occasionally shake a box at the end of a week and discover a set of forgotten pills arghh!!

OP fun sounding starter project as long as the above caveats are taken into account - go for it..

for the board to board coms a twisted wire pair null modem connection between serial pins(RX-TX and TX-RX) is pretty reliable, but if networked mqtt as suggested above is very flexible and easy too.

Heater
Posts: 15968
Joined: Tue Jul 17, 2012 3:02 pm

Re: Rasp Berry Pi, Pill Dispenser

Wed Mar 04, 2020 12:01 am

jbudd wrote:
Tue Mar 03, 2020 10:16 pm
The original poster is new to the forum, I expect they will find advice along the lines of "Don't do that because you have insufficient experience" a bit less than helpful.
I don't care. I only want to stop them killing people. Or at least be aware of the risks involved.
jbudd wrote:
Tue Mar 03, 2020 10:16 pm
Perhaps the pills in question are homeopathic and when the device fails the patient will improve even faster.
That made me chuckle. I presume it was intended as a joke.
Memory in C++ is a leaky abstraction .

Return to “General discussion”