We are working on a project in which we want to detect whether there are pills in specific containers or not—that’s our minimum requirement. Ideally, we’d also like to determine the exact number of pills in the container. We envision a container that can be held between your fingers or in your hand (approximately 4×4×4 cm), but any other container from which you can comfortably remove pills would also be acceptable.
We’re aiming for an inexpensive and reliable solution—ultimately, the cost of a single sensor should fall within the 10–20 PLN range.
What have we already tested?
Ultrasonic sensor – a resolution of around 1 mm turned out to be insufficient to clearly determine the presence of a pill.
IR camera + AI – works well, but the price skyrockets when dealing with multiple containers (issues with the USB bus, hardware costs, and optics).
Weight measurement – we’re concerned that small debris (e.g., crumbs) could cause false readings and require frequent cleaning.
IR LEDs from above + photoresistors underneath – would require building a matrix of photoresistors under each container, which again increases complexity and cost.
Magnetic sensors, reed switches – mainly detect motion, so they offer little insight into the number of pills.
Hall sensors – can detect changes in the magnetic field, but won’t tell us how many pills are in the container (only that the field has changed).
3D grid – there was also a concept to build an inexpensive (if possible) 3D grid of the container’s bottom at a certain interval, with a resolution of around 0.5 mm, and then process that data in software.
We’re looking for ideas and suggestions on what else could be implemented to achieve a reliable, low-cost sensor solution that’s also easy to maintain. Does anyone have experience with similar projects? What solutions would you propose? Are there any less obvious measurement methods or clever combinations of sensors?
Thank you in advance for any insights, and we look forward to discussing this further!
Perhaps turn it on its head and have a way of organising tablets - eg have them in a tube , so length of tablets gives you an answer .
Some companies are now supplying medication in daily ‘sets’ .
Worth a look around to see what is done in manufacture - how do they count ?
There may be other simile's in say ball bearings ?
You might need to try several prototypes