This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)
The motivation for this device is that I have an elderly dog that requires medication throughout the day, and wanted a device that would allow me to "set it and forget it". With the ACMD I am able to load three doses of medication first thing in the morning, set three separate alarms, and rest easy knowing that my dog can get the medication he needs regardless if I am home or not.
Operation: An infrared remote is used to set the three alarms. Once an alarm is reached, the device emits a buzzing noise and proceeds to activate the motor and pinion, opening one chamber and releasing the medication. Three LEDs will illuminate when the corresponding alarm has been set, providing a visual confirmation for the alarm.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Creating the Pill Box.
The pillbox has an overall length of 165 mm and an height of 56 mm, with three pill chambers separated by 4 mm wide partitions. Dimensions to the overhang and slots for the sliding doors are shown in the attached images.
Step 2: Pillbox Stand and Ramp
The stand for the pillbox is 170 mm in length and 150 mm in height. The hollowed out cavity serves to reduce material when 3D printing. The overhang of the pillbox is designed to fit into the slot atop the pillbox stand. The slot has a width of 5.65 mm, length of 166 mm, and a depth of 6 mm. These dimensions accounted for the tolerances of the 3D printer and allow for a snug fit with the pillbox.
Step 3: Top and Bottom Sliding Doors
The top slide is designed with a stub of for ease of opening with stub dimensions: W = 7.75 mm, L = 12.75, H = 5 mm. The top slide's dimensions are: L = 163 mm, W = 30 mm , H = 4 mm. The bottom slide's dimensions are identical to those of the top slide, with the exception of the hook used to connect into the rack with dimensions shown in the attached image,
Step 4: Rack and Pinion
The rack and pinion were designed by following the video located at the following link. The only modification to the design shown in the video is a face width adjustment to 20 mm rather than the 12 mm used in the videos. The videos can also be found on the Autodesk forum linked below, which also includes a technical drawing with dimensions of the rack and pinion. The YouTube Chanel belongs to the user Ebrahim6000, an Autodesk educator and expert.
Additionally, the pinion is designed with a 10 mm by 7.5 mm rectangular extrusion to fit an adapter that connects to the stepper motor. Within the rack a cavity was designed to fit the hook of the bottom slide, and its dimensions should allow for a snug fit.
When the bottom slide is inserted into the cavity of the rack, the motorized pinion will be able to open and close the bottom sliding door.
Step 5: Rack and Motor Stands
The motor stand is the part with the Y-shaped fork, which connects to the motor via two screws on both sides of the fork. The rack stand has a 65 mm edge which the flat underside of the rack rests on. The dimensions of these two parts depend on the dimensions of the rack you wish to design. These two parts were glued back-to-back for the final product, and attached to the ramp via a hot glue gun on the chamfered surface on the left side of the motor stand.
Step 6: Arduino Code
Attached is the code for the ACMD. There are three lines before the code for "Alarm " that are commented out, which should be uncommented to set the initial time for the real time clock module. Once the program has been ran the RTC module should remember the time and therefore these lines should be commented out once again.
In the beginning of the code, the necessary libraries are included, and the utilized variables for the alarms, LCD display, RTC module, infrared receiver and remote, and stepper motor are defined. In the void setup the alarm LEDs are set to outputs, and the LCD display is initialized. The void loop contains the code for each of the three alarms and their corresponding buttons on the IR remote. At the end of the code the Buzzer function is defined.
Step 7: Circuit Diagram
Stepper Motor & Motor Driver Module: Connect the stepper motor to the motor driver module. Connect the motor driver module to power, ground, and the digital pins on the Arduino board.
5V Buzzer: Connect the 5V buzzer to ground and to the digital pins on the Arduino board.
RTC Module: Connect the RTC module to the SCL and SDA pins on the Arduino, as well as power and ground.
LCD Display: Connect the LCD display in series with the RTC module to the SCL and SDA pins. Also connect to ground and power.
LEDs: Connect the positive terminal of the LED to the digital pins on the Arduino board. Connect the negative terminal to the appropriate resistor and to ground.
IR Reciever: Connect the receiver to ground, the digital pin on the Arduino (with a resistor in between connected to the power rail), and to the power rail.
Connect the 5V pin and GND pin on the Arduino board to the power and ground rails on the breadboard.
The Fritzing file used to create the circuit diagram is attached.