## Inspiration

The opioid crisis is a widespread danger, affecting millions of Americans every year. In 2016 alone, 2.1 million people had an opioid use disorder, resulting in over 40,000 deaths. After researching what had been done to tackle this problem, we came upon many pill dispensers currently on the market. However, we failed to see how they addressed the core of the problem - most were simply reminder systems with no way to regulate the quantity of medication being taken, ineffective to prevent drug overdose. As for the secure solutions, they cost somewhere between $200 to $600, well out of most people’s price ranges. Thus, we set out to prototype our own secure, simple, affordable, and end-to-end pipeline to address this problem, developing a robust medication reminder and dispensing system that not only makes it easy to follow the doctor’s orders, but also difficult to disobey.

## What it does

This product has three components: the web app, the mobile app, and the physical device. The web end is built for doctors to register patients, easily schedule dates and timing for their medications, and specify the medication name and dosage. Any changes the doctor makes are automatically synced with the patient’s mobile app. Through the app, patients can view their prescriptions and contact their doctor with the touch of one button, and they are instantly notified when they are due for prescriptions. Once they click on on an unlocked medication, the app communicates with LocPill to dispense the precise dosage. LocPill uses a system of gears and motors to do so, and it remains locked to prevent the patient from attempting to open the box to gain access to more medication than in the dosage; however, doctors and pharmacists will be able to open the box.

## How we built it

The LocPill prototype was designed on Rhino and 3-D printed. Each of the gears in the system was laser cut, and the gears were connected to a servo that was controlled by an Adafruit Bluefruit BLE Arduino programmed in C.

The web end was coded in HTML, CSS, Javascript, and PHP. The iOS app was coded in Swift using Xcode with mainly the UIKit framework with the help of the LBTA cocoa pod. Both front ends were supported using a Firebase backend database and email:password authentication.

## Challenges we ran into

Nothing is gained without a challenge; many of the skills this project required were things we had little to no experience with. From the modeling in the RP lab to the back end communication between our website and app, everything was a new challenge with a lesson to be gained from. During the final hours of the last day, while assembling our final product, we mistakenly positioned a gear in the incorrect area. Unfortunately, by the time we realized this, the super glue holding the gear in place had dried. Hence began our 4am trip to Fresh Grocer Sunday morning to acquire acetone, an active ingredient in nail polish remover. Although we returned drenched and shivering after running back in shorts and flip-flops during a storm, the satisfaction we felt upon seeing our final project correctly assembled was unmatched.

## Accomplishments that we're proud of

Our team is most proud of successfully creating and prototyping an object with the potential for positive social impact. Within a very short time, we accomplished much of our ambitious goal: to build a project that spanned 4 platforms over the course of two days: two front ends (mobile and web), a backend, and a physical mechanism. In terms of just codebase, the iOS app has over 2600 lines of code, and in total, we assembled around 5k lines of code. We completed and printed a prototype of our design and tested it with actual motors, confirming that our design’s specs were accurate as per the initial model.

## What we learned

Working on LocPill at PennApps gave us a unique chance to learn by doing. Laser cutting, Solidworks Design, 3D printing, setting up Arduino/iOS bluetooth connections, Arduino coding, database matching between front ends: these are just the tip of the iceberg in terms of the skills we picked up during the last 36 hours by diving into challenges rather than relying on a textbook or being formally taught concepts. While the skills we picked up were extremely valuable, our ultimate takeaway from this project is the confidence that we could pave the path in front of us even if we couldn’t always see the light ahead.

## What's next for LocPill

While we built a successful prototype during PennApps, we hope to formalize our design further before taking the idea to the Rothberg Catalyzer in October, where we plan to launch this product. During the first half of 2019, we plan to submit this product at more entrepreneurship competitions and reach out to healthcare organizations. During the second half of 2019, we plan to raise VC funding and acquire our first deals with healthcare providers. In short, this idea only begins at PennApps; it has a long future ahead of it.
## Inspiration

The inspiration for PillHero was to create a complete solution to helping the sick and elderly to learn and stick too their schedule for taking medication.

## What it does

Using the iOS app, the user enters their medication schedule, which is composed of a start date, end date, daily timings, and the medication name. The user places their medication on the pill mount. As the time nears for the user to take their medication, the app notifies the user that they should take their medication. The pill mount detects when they take their medication. If the user does not, the app notifies them. Should the user not take the pill within a specified period after this, it is counted as them having missed taking their medication.

## How we built it

-- Hardware --
The pill mount was built out of three main components: the Raspberry Pi 3, an infrared LED, and an infrared phototransistor. The LED and phototransistor are used as a touch-less way of detecting when the user removes the pill bottle from the mount. If this was done close enough to when the user is supposed to take their pills, then the assumption is made that the user took their pills for that time slot.
-- Software --
On the software side there was a combination of front end as well as back end developments. For the front end, an iOS mobile application was used to gain input from the user as well as to present calendar information. The input method utilizes speech-to-text technology to translate user voice input to a text input. From there, the user is able to edit the textfield if any mistakes were made. Then to input is passed to an AI for parsing and understanding of the statement. That data is later is sent to a back end server that keeps track of the user's pill intake via communication with the Raspberry Pi 3 and communicating using the calendar screen on the iOS application.

## Challenges we ran into

one of the major challenges we encountered was trying to connect the raspberry pi, the phone and the server all together. Due to the security of the wifi, it was very difficult to ssh into either the raspberry pi or properly set up http requests between the devices. Our work around for this was to set up a LAN that let us connect all our devices and easily make requests between them

## Accomplishments that we're proud of

Completing a project that involves hardware has been a goal of multiple team members for a while and this hackathon gave them the opportunity to do that. In reality though, the team is most proud that they were able to create an internet of things project where the hardware and software complement each other rather than feel arbitrarily attached.

## What we learned

The entire team learned a significant amount about network programming from troubleshooting issues with the Pi 3 and trying to interface the server with both system components. Otherwise, the learning was different for each member. The members who had experience with hardware were exposed to working with servers and databases. Simultaneously, the members with full-stack experience gained exposure to working with hardware. This resulted in all members becoming more well-rounded developers and gaining experience that will aid them in future hackathons and their careers.

## What's next for PillHero

Post-hackathon, the team plans to continue development of PillHero into a more complete product. Numerous upgrades are planned like the ability to track non-daily medication routines and functionality with multiple drugs. On the iOS side in particular, implementation of push notifications and text message reminders are planned. As for the pill mount, the team plans to add an accurate to team plans to add an accurate analog scale to the device so it can notify the user when they are running out of pills.
## Inspiration

Forgetting to take a medication is a common problem in older people and is especially likely when an older patient takes several drugs simultaneously. Around 40% of Patients forget to take medicines and most of them have difficulty to differentiate between multiple medications.

1. Patients forgets to take medication
2. Patients get confused in taking multiple medications as they look similar.
3. Patients don't take medications at correct time

Such thing leads to bad health and now-a-days these cases are increasing day by day and most people think that skipping medications is normal thing, which is bad for their health.

To avoid this I wanted to make a device which automatically gives medicines to the patients.

## What it does

It is a 3D printed Vending Box actuated by using servo motor and controlled using Raspberry Pi 4 and Mobile App. The Box will automatically sort out medicine according to Time and Schedule and Vend it using Servo Motor from the Box, the App will be connected via Firebase to Store, Add and Modify the Medicine Schedule and Raspberry Pi will collect that data from Firebase and Actuate the Servos Accordingly.

1. Doctors/Care Takers Can Add Medicine Schedule via the Mobile App.
2. The Patient will hear a Buzzer and Sound Details about Medicine and how much Doses he must take of that medicine.
3. The Box will automatically rotate via servo and Drop Off the Scheduled Medicine off the Box .

## How we built it

I bought Raspberry Pi and Servos at start of Hackathon, and Started Development of App until the Hardware got Shipped.
Timeline

* Day 1-2 : Planning of Idea and Hardware Ordering
* Day 3-4 : Research Work and Planning
* Day4 -6: App Development from Flutter + Firebase
* Day 7-9: CAD Design and started 3D Printing(took 13 Hours to print)
* Day 10: Hardware Arrived and Tested
* Day 10 -Day 12 Integrated 3D Printed Parts and Motors and Done with Project
* Day 13: Video Editing, Devpost Documentation , Code Uploading
* Day 14: Minor Video Edits and Documentation

#### Initial Research and CAD Drawings:

[![IMG-20210211-004826-2](https://i.ibb.co/bX3S3mZ/IMG-20210211-004826-2.jpg)](https://ibb.co/KWGMGhk)
[![IMG-20210220-234414](https://i.ibb.co/0qrh9zz/IMG-20210220-234414.jpg)](https://ibb.co/cJQD8ss)
[![IMG-20210220-234421](https://i.ibb.co/hHVRXRx/IMG-20210220-234421.jpg)](https://ibb.co/0ZrjBjp)

## Challenges we ran into

* 3D Printing Failed and took lot of time
* Late Shipment of Hardware
* Servo Motor Gear Issues

## Accomplishments that we're proud of

1. New to 3d Printing and Printed such Big Project for First Time
2. Used Raspberry Pi for First Time

## What we learned

* CAD Design
* Flutter
* Raspberry Pi

## What's next for MediBox

1. Creating 2 Level Box, for more medicine capacity using same amount of motors. [image]
2. Add good UI to App
3. Adding Medicine Recognition and automatically ordering .