ESP325 printed parts + acrylic lidBambu Lab X1Phone app

Smart Pill Reminder

A rectangular pill dispenser with a 15-slot carousel, a talking alarm, and a cup you tip into your hand. The alarm keeps repeating until a switch feels the cup pushed all the way to its stop.

3D model of the pill reminder: teal rectangular base, LCD in the sloped front-left corner, cup bay on the front right, octagonal see-through lid over a 15-slot carousel
The whole machine in SolidCraft. The lid's window is clear acrylic, so you can see which slots are full. The LCD sits in the sloped top-front corner on the left with nothing over it, and the slope ends in a flat triangular facet whose top edge lines up with the lid's corner. The lid is an octagon centred on the carousel, so that corner stays free. The tall opening with rounded top corners is the hand cave: the cup hangs at the top of it.

01How it works

  1. At a dose time, the motor turns the carousel forward by one slot (24°). That slot's pills fall through a hole in the deck straight into the cup below.

  2. The speaker plays three beeps and «حان موعد الدواء», then repeats a reminder every 30 seconds. The LCD shows TAKE YOUR PILLS! and the phone app turns amber.

  3. The cup hangs on two pins at its top. The person slides a hand, palm up, into the opening under it (the hand cave) and pushes the small finger tab under the front of the cup back with the fingertips. The cup tips forward and the pills slide off its front edge into the palm.

  4. Pushed all the way, the cup hits a stop at 85°. Pills start sliding out at about 65°, so by then every pill is in the hand. Only right at the stop does the cup's finger tab press the lever of a second limit switch behind the bay. That counts as "taken": the alarm stops, the device says thank you, and the family's phones get a message.

  5. If nobody takes the pills within 30 minutes, the dose is marked missed. The next dose is not dropped on top of pills still in the cup.

Cut-through side view showing the V-shaped cup with its finger tab hanging under the drop hole, the hand cave below it, and the motor under the carousel
Cut through the middle of the cup bay. The front is on the left.
Top view with the lid hidden: 15 compartments numbered H and 1 to 14, the home switch at the back left
Top view without the lid. Slot H sits over the drop hole and has a roof, so no pill can be put in it by mistake during a refill; the home switch is at the back left.

Safety rule built into the code. To find H, the carousel only turns backward, and only past slots it has already emptied. A full search turn could drop full slots into the cup, so it runs only from the "Find H (empty carousel only)" button. If the power goes off, the device remembers which slot it was on.

How the machine knows the pills are out. The cup can only reach its stop by tipping 85°, and pills slide out from about 65°, so a cup at the stop has poured out everything, however many capsules were in it. A second mini limit switch, the same kind as the home switch, sits behind the back wall of the cup bay. Its lever reaches through a slot into the bay, where nothing but the cup's finger tab ever gets to, and only in the last few degrees: the tab first touches the lever at about 82.5° and the switch clicks at about 84°, just before the stop. The code only counts that if the switch was open first, so a switch stuck pressed can never silence the alarm. A small push doesn't count. Pills picked out with fingers don't count either: press "I took my pills" in the app.

Why two limit switches? In the ChatGPT chat the limit switch finds the carousel's start position, and that stays the same here: a bump on the carousel clicks the switch once per turn. The second switch does the same job for the cup: it clicks only when the cup reaches full tilt. It watches the cup, not the pills, so it works the same for every pill. Unlike a light sensor, it can't be fooled by sunlight, doesn't care about the cup's colour and needs no calibration, so the TCRT5000 from the parts list is a spare again.

02Parts

From your list

PartJob in the machine
28BYJ-48 5 V stepper + ULN2003 boardTurns the carousel. It sits under the deck with its shaft in the carousel's D-shaped hole.
Mini limit switch, 2 of themOne is HOME: it lies on the deck and is clicked by the bump on the carousel wall. The other is the full-tilt switch behind the cup bay, pressed by the cup's finger tab. Buy a second one, it is the same part.
TCRT5000 IR moduleNot used: the second limit switch does its job. Keep it as a spare.
DFPlayer Mini + 3 W 4 Ω 40 mm speakerPlays the voice files from the microSD card. The speaker sits under the grille on the top left.
1602 LCD with I2CShows the time, doses left, and messages. It sits in the front window.
20 cm female-female jumper wiresAll connections, plus a small soldered power bus.

Also needed

ItemQtyWhy
ESP32 38-pin board (micro-USB), soldered to a 57.2 × 56.3 mm prototype board1None of the links is an ESP32 (me-2974 is the speaker, listed twice). The bottom plate holds the prototype board as measured; the ESP32 itself is 48.3 × 25.4 mm.
microSD card, 32 GB or smaller, FAT321Holds the voice files.
1 kΩ resistor1Between ESP32 GPIO17 and DFPlayer RX. It stops a hissing noise.
Male header pins for a power bus2 × 6Power bus: one row for 5 V, one for GND, so three modules can share the ESP32's single 5 V pin. Solder them onto the ESP32's prototype board; the box has no separate place for a second board.
M3 × 10 countersunk screws + M3 nuts2Motor ears, screwed down from the top of the deck.
M2.5 × 12 screws + nuts4LCD, screwed in from the front. Its holes are 3.0 mm, too tight for M3.
M2.5 × 6 self-tapping screws4ULN2003 driver board onto its 4 posts on the bottom plate.
DS3231 clock module (with a CR2032 coin cell)1Keeps the time through power cuts. It runs from the ESP32's 3.3 V pin, where the board's battery-charging circuit can push almost no current into the cell, but a CR2032 must not be charged at all. So remove the charging resistor: the tiny part marked 201 in the top-right corner of the chip side, next to the small glass diode (desolder it, or ask an adult to snip it off). Don't use a rechargeable LIR2032 instead: 3.3 V can't charge it.
M2 × 12 screws + nuts4The two limit switches.
M3 × 8 countersunk screws4Bottom plate into the corner posts (they cut their own thread).
USB-C cable + 5 V 2 A phone charger or power bank1Plugs into the USB-C power socket at the back. A laptop USB port is too weak when the motor and speaker run.
2-pin KCD1 rocker switch (6 A), red1ON/OFF. It snaps into the top of the deck, left of the lid. Mikroelectron sells it as "Red Rocker Boat Switch 2P 20mm KCD1-101".
USB-C female power socket, snap-in (red and black wire)1Power input in the back wall. It clicks into its hole from outside with two springy latches, so it needs no glue. Yours has no LED.
3 mm clear acrylic, laser cut1The lid window, 153.4 × 154.6 mm. Take cad/laser/lid_acrylic.svg (or the .dxf) to any laser-cutting shop: red is cut, black is engraved. Keep the protective film on until you glue it.
Clear two-part epoxy or clear siliconeGlues the acrylic into the lid frame. Not superglue: its fumes leave a white haze on clear acrylic.
PLA, about 0.5 kg1Print the carousel and cup in white or a light colour. The lid frame can be any colour, since the window is acrylic.
470–1000 µF electrolytic capacitor, 10 V or more1Across the 5 V and GND rows of the power bus, long leg (+) to 5 V. It smooths the current spikes from the speaker amplifier and WiFi so the ESP32 doesn't restart in the middle of an alarm.
Hot glueSpeaker into its ring. The boards clip into printed holders.

03Print

Print the five files in cad/print/X1C/, one per filament colour, in the order below. Each is already sliced in Bambu Studio for the X1 Carbon with the 0.4 mm nozzle, "0.20mm Standard" and Bambu PLA Basic, on the Textured PEI plate at 55 °C. Open one in Bambu Studio and press Print plate, or copy it to the printer's microSD card and start it from the printer's screen. Load the colour in the file's name; each plate uses one spool from start to finish.

FileColourParts, and how they liePrint timePLASupports
0_FitTestTealFitTest, flat40 min14 gtree supports, only under the hinge-slot sample
1_White_Carousel+CupWhiteCarousel, as it sits
Cup, lying on its flat back
1 h 46 min79 gnone
2_Teal_BaseTealBase, upside down with the deck on the plate6 h 19 min268 gtree supports under the hand opening's ceiling and the LCD window's lower edge
3_DarkTeal_LidDark tealLid frame, upside down1 h 24 min53 gnone
4_Grey_PlateGreyBottom plate, flat1 h 55 min84 gnone
Total: teal 281 g, white 79 g, dark teal 53 g, grey 84 gabout 12 h 4 min497 g
The five parts laid out the way they go on the printer
How each part lies on the printer. Upside down, the base has three real overhangs: the hand opening's ceiling on either side of the cup bay, and the LCD window's lower edge. Its file puts tree supports there; snap them off once the print has cooled. The cup's hinge slots in the base print as short bridges, which the X1 handles. cad/build_plates.py slices the files again after a design change.

Print FitTest first (40 min). Check that the LCD bezel fits the window and its 4 holes line up, the D-hole slides onto the motor shaft without wobbling, the test pin drops into the hinge slot and swings freely, the speaker presses into the ring, a limit switch's 2 holes match the slots, the rocker switch clicks into its cutout and holds, the USB-C socket clicks into its hole in the wall piece and holds, the ESP32's prototype board clicks under the snap post (and lifts out again with a fingernail), and the clock module's board slides down the rail grooves without forcing. If something is off, change that number in SolidCraft (section 10) before printing the big parts.

04Wire

This is a logical map: the pins are grouped by job, not drawn in the order they sit on the board. Read the GPIO number printed next to each pin on your ESP32.

5 V3.3 VGNDsignaljoined
FromToNotes
USB-C socket, red wirePower switch, one pinPower comes in at the back. Solder the wires to the switch pins and cover them with heat-shrink.
Power switch, other pinPower bus 5 V rowSwitch on = everything on.
USB-C socket, black wirePower bus GND row
Power bus 5 V rowESP32 VINThe ESP32 gets its 5 V from the bus. Its own USB port stays reachable through the back opening for uploading code: switch the power off first.
ESP32 GNDPower bus GND rowEvery module's GND goes to this row.
5 V rowLCD VCC, DFPlayer VCC, ULN2003 +The motor, amplifier and LCD backlight need 5 V.
GPIO19Full-tilt switch NOIts C (common) leg goes to GND, just like the home switch. GPIO19 reads LOW while the cup is at its stop.
GPIO21 / GPIO22LCD SDA / SCLAddress 0x27 or 0x3F, found automatically.
GPIO21 / GPIO22DS3231 SDA / SCLThe same two pins as the LCD: solder both wires to the same pin on the prototype board. The clock answers at 0x68 (its memory chip at 0x57 isn't used). Leave its 32K and SQW pins unconnected.
ESP32 3V3DS3231 VCC3.3 V, not the 5 V row: at 5 V the module would charge its coin cell, at 3.3 V almost not at all (remove the 201 resistor anyway, see Parts). Its GND goes to the GND row.
GPIO17 (TX2)1 kΩ, then DFPlayer RXSolder the resistor in the wire and cover it with tape or heat-shrink.
GPIO16 (RX2)DFPlayer TX
DFPlayer SPK1 / SPK2SpeakerNot to GND. Keep the volume at 25 or below with the 4 Ω speaker.
GPIO25 / 26 / 32 / 33ULN2003 IN1 / IN2 / IN3 / IN4The motor's white plug goes into the ULN2003 socket.
GPIO18Limit switch NOThe switch's C (common) leg goes to GND. NO = normally open.

Two things to know. The LCD's I2C board pulls SDA and SCL up to 5 V, and the clock module pulls them up to 3.3 V, so together the lines sit at about 4 V. Almost every ESP32 project runs an LCD this way without trouble, but the ESP32's pins are rated for 3.3 V. Second, the motor and the speaker never run at the same moment (the code waits for one before starting the other), which keeps the current low enough for a 2 A charger.

05Inside the machine

Every part in the pictures below is drawn at its real size and in its real place in the SolidCraft assembly. The printed case is drawn see-through so the parts inside show.

See-through view of the assembled machine with the components numbered 1 to 7 and 12
Parts 1 to 7 and the power switch (12), seen from the front left. The front of the machine faces left. The boards (8 to 11) sit low on the bottom plate behind the carousel, so they are numbered in the top view below.
#PartWhere it sitsHow it is held
1CarouselOn the deck, under the lidD-hole pushed onto the motor shaft
2Stepper motor 28BYJ-48Under the deck, shaft up through the centre2 × M3 × 10 countersunk + nuts
3Home limit switchOn the deck, back left, under the lid2 × M2 × 12 + nuts, in slots so it can slide
4SpeakerUnder the grille, top leftPress-fit ring + hot glue
5LCD 1602 I2CSloped front-left corner, leaning back 20°4 × M2.5 × 12 + nuts
6CupHangs in the bay under the drop holePrinted pins in hook slots, no screws
7Full-tilt switch (mini limit switch)Behind the back wall of the cup bay, its lever through a slot2 × M2 × 12 + nuts, in slots so it can slide up and down
8ESP32 on its prototype boardBottom plate, back left, USB end against the back wall at the service portRests on ledges, clips under 4 snap posts
9DFPlayer MiniBottom plate, right of the ESP32, raised so its wires bend under itSits on a U-shaped stand between its two plug rows, clips in at the end away from the card
10ULN2003 driverBottom plate, behind the cup bay, LEDs to the front4 × M2.5 × 6 self-tapping screws into posts
11DS3231 clock moduleBottom plate, front left, standing up, pins at the topSlides down 2 slotted rails
12Power switch (KCD1 rocker)Top of the deck, left of the lidSnaps into its cutout
13USB-C power socketBack wall, right of the ESP32's USB openingClicks into its hole: 2 spring loops behind the thinned wall
Top view through the case with the boards on the bottom plate numbered 8 to 11 and the power socket 13
From above, boards 8 to 11 and the USB-C power socket (13) on the bottom plate. The front is at the bottom: the LCD on the left, the cup bay on the right. The speaker is drawn faint so the ESP32 under it shows.
Exploded view: bottom plate with the boards, the base with motor, LCD, speaker and cup above it, then the carousel and the lid
Pulled apart: the plate with its boards at the bottom, then the base with the parts fixed to it, then the carousel and the lid.

06Assemble

In each picture the part for that step is solid and everything else is faint.

  1. Motor: highlighted in the see-through machine

    Motor

    Turn the base over. Push the motor's round shaft collar up into the centre hole of the deck, with the motor body toward the back. Put the 2 countersunk M3 × 10 screws in from the top of the deck, through the motor ears, and add the nuts underneath. The screw heads must sit flat or below the deck so the carousel can slide over them.

  2. Home switch: highlighted in the see-through machine

    Home switch

    On top of the deck at the back left, lay the switch flat with its lever facing the carousel and the lever's hinge end next to the round wire hole. Fix it with 2 M2 × 12 screws and nuts, its black lever-side edge on the long tick of the little scale in the deck beside it, then push its 2 wires down through the round hole next to it. Leave the screws loose until calibration.

  3. Speaker: highlighted in the see-through machine

    Speaker

    Press it into the ring under the grille, cone facing up, and add a few dots of hot glue.

  4. LCD: highlighted in the see-through machine

    LCD

    The LCD sits close to the left wall, so first bend the 4 pins of its I2C board straight back with pliers (or solder the wires on). Then, from inside, push the LCD's metal frame into the window of the sloped front panel. Put 4 M2.5 × 12 screws in from the front and add the nuts behind.

  5. Full-tilt switch highlighted behind the back wall of the cup bay

    Full-tilt switch

    Behind the back wall of the cup bay, a rib hangs from the deck with two upright slots. Hold the second limit switch against the rib with its lever at the bottom, reaching forward through the slot in the wall, and fix it with 2 M2 × 12 screws and nuts, its lever edge on the long tick of the scale on the rib beside it. The front screw's nut drops into a narrow upright channel in the back wall of the cup bay, where it can't turn; the rear nut sits on the back of the rib. Leave them a little loose until calibration. Its NO and C legs get one wire each (section 04).

  6. Power switch and USB-C socket highlighted in the see-through machine

    Power switch and socket

    Push the rocker switch down into its cutout on the top-left of the deck until its clips click. The deck is thinner there so the clips can grip. Push the USB-C socket into its hole in the back wall from outside, wires first, until both latches click. The wall is thinner round the hole so the latches can grip. Solder its red wire to one switch pin, and a new wire from the other pin to the 5 V row (section 04).

  7. Bottom plate electronics: highlighted in the see-through machine

    Bottom plate electronics

    Each board has its own printed holder on the plate, made 0.3 mm bigger than the board all round. Press the ESP32's prototype board down onto its ledges until the 4 snap posts click over it, USB end at the back. Put the microSD card in the DFPlayer first, then lay its end without the card on the post with the catch and press it down. Screw the ULN2003 onto its 4 posts with M2.5 × 6 self-tapping screws, LEDs toward the front. Slide the clock module down its two rails, battery facing the front and pins at the top.

  8. Wire and close: highlighted in the see-through machine

    Wire and close

    Wire everything using section 04. Then lower the base onto the plate and fit the 4 M3 × 8 screws from underneath.

  9. Carousel: highlighted in the see-through machine

    Carousel

    Set it on the deck with its D-hole on the motor shaft. Turn it by hand until the line on slot H's roof points at the short line engraved on the deck in front of it.

  10. Cup: highlighted in the see-through machine

    Cup

    Hold the cup level and pass it in through the opening. Slide its two side pins into the slots in the two lugs under the ceiling, push it all the way back, then let it drop about 3 mm into the notches. It should swing freely and come back to rest by itself, leaning back slightly. Push the finger tab under its front backward: the cup stops against two small pads under the deck. That is full tilt.

  11. Lid frame and acrylic window highlighted in the see-through machine

    Lid

    First glue in the window. Lay the lid frame upside down, peel the film off the acrylic, and drop the panel into the frame so its 4 corner notches sit around the 4 pegs. Run a thin bead of clear epoxy or silicone along the edge where the panel meets the rim, and let it set. Then put the lid on: set it down roughly in place and its 4 tapered pegs slide into the funnel-mouthed deck holes. To take it off for a refill, lift it with a finger in each of the two notches on its left and right sides.

07Program

ESP32

  1. Open firmware/PillReminder/PillReminder.ino in Arduino IDE. The ESP32 board package (version 3.3.6) is already installed on this computer.
  2. In the config.h tab, type your home WiFi name and password.
  3. Choose Tools › Board › ESP32 Dev Module, choose the COM port, and press Upload. No extra libraries are needed.

Voice card

  1. Format the microSD card as FAT32.
  2. Copy the folder sd_card/mp3 to the card's root, so the card has /mp3/0001.mp3 and so on.
  3. Files 1–6 are Arabic and 11–16 are English. To use your own recorded voice, save it with the same file name.
FileWhen it playsWords
0001Dose droppedتيت تيت تيت · حان موعد الدواء · تيت تيت تيت
0002Repeats until takenمن فضلك، ادفع أسفل الكوب حتى آخره، وخذ حبوب الدواء
0003Pills takenشكراً لك. تم أخذ الدواء
0004Carousel emptyانتهت الأدوية. يرجى تعبئة الجهاز
0005Dose missedلم يتم أخذ الدواء في وقته
0006Switched onمنبه الدواء جاهز

Phone app

The app is a web page that lives inside the ESP32, so there is nothing to install from an app store. With home WiFi, open http://pillreminder.local or the IP address the LCD shows. If the home WiFi isn't found, the device makes its own network: join PillReminder (password pills1234) and open http://192.168.4.1. In the browser menu, choose "Add to Home screen" to get an app icon. The app works in Arabic and English. Each time it opens, it compares the device clock with the phone's and fixes it if it is more than a minute off; the clock module then keeps that time through power cuts.

Phone app Today tab in English during an alarm, with the carousel picture showing slot 5 over the cup
Today tab during an alarm. Amber is the slot over the cup; light slots are empty.
The same screen in Arabic, laid out right to left
The same screen in Arabic.
TabWhat you can do
TodayStatus, next dose, a picture of the carousel showing which slots are full, and the buttons I took my pills, Drop a dose now, Demo: dose in 1 minute, Test sound and Stop alarm.
ScheduleUp to 4 dose times a day, each with a name.
SettingsVolume 0–30, voice language, repeat time, minutes before "missed", family alerts, refill, motor fine-tune, and a "Cup at full tilt" light for setting up the full-tilt switch.
HistoryThe last 20 events: dropped, taken, missed, refilled.

Family alerts. Install the free ntfy app on the family's phones, subscribe to a made-up topic name such as grandpa-pills-4821, and type the same name in Settings. The device then sends "Pills dropped", "Pills taken" and "Dose missed" messages. This needs home WiFi with internet.

08Calibrate and test

  1. Full-tilt switch. Open Settings › Motor and sensors. Push the finger tab slowly until the cup stops: the switch must click and "Cup at full tilt" must light just before the stop, and go off when the cup comes back a little. If it clicks too early, loosen the 2 screws and slide the switch up in its slots; if it never clicks, slide it down. Move it one tick (0.5 mm) at a time on the scale on the rib beside it: the long tick is where it is drawn, and it only works within about 1 mm of it. Then tighten. Last, tip the cup slowly with real pills in it: when the light comes on, the cup must already be empty.
  2. Direction. With the carousel empty, press "Find H (empty carousel only)". The carousel must turn backward (slot 1 moves away from the hole) until the switch clicks. If it turns the other way, tick "Turn the other way", save, and try again.
  3. Home switch. If the bump passes without a click, loosen the 2 screws and slide the switch toward the carousel in its slots. If the motor stalls on the bump, slide it away a little. Go one tick (0.5 mm) at a time on the scale in the deck beside its end: the long tick is where it is drawn, and it only works within about 1 mm of it.
  4. Centre slot H. After "Find H", lift the lid: the line engraved on slot H's roof must point straight at the short line on the deck in front of the carousel. If it doesn't, change "Fine-tune the H position" and press "Find H" again. About 11 steps move the carousel 1°, or about 1 mm at its edge.
  5. Clock module. "Clock module connected" must light in Settings › Motor and sensors. Open the app once so the phone sets the time, then switch the machine off, wait a minute and switch it on again: the screen must show the right time without opening the app. If it shows --:--, check the coin cell.
  6. Test run. Put a few dry beans or sweets in slot 1, press "Refill done", then press "Demo: dose in 1 minute". After a minute they should drop into the cup and the alarm should start. Slide your hand in under the cup and push the finger tab to the stop: the beans drop into your palm, the alarm stops at once, and History shows "Taken".

09Science fair demo

  1. Power it from a power bank. Without home WiFi it makes its own network, so join PillReminder and open the app. The clock module already knows the time; if it was never set, the phone sets it now.

  2. Show the Schedule tab, then press Demo: dose in 1 minute while you explain the carousel.

  3. The pills drop and the alarm talks. Let a visitor slide a hand in under the cup and push the finger tab. A small push doesn't stop the alarm. Pushed all the way to the stop, the cup pours every pill into their palm, the alarm stops at once, and the app logs "Taken".

  4. Press Demo again and wait: if nobody tips the cup, the next drop is refused because the last dose is still in the cup. That is the safety rule against double doses.

Some power banks switch themselves off when a device draws very little current. If yours does, use a wall charger at the fair.

10Change the design

Open cad/PillReminder.sc in SolidCraft. Every part shares one set of parameters, so changing a number updates all the parts that use it. Then select a part and export it as STL or 3MF. To rebuild everything at once, including the print files and pictures, run python build_cad.py --check --swing --renders in the cad folder, then python build_plates.py to slice the colour plates in cad/print/X1C/ again.

ParameterNowWhat it changes
name_textSMART PILL REMINDERThe name engraved on the lid.
slots15Carousel positions (1 is H). Also change SLOTS in config.h. The slot numbers on the hub are drawn for 15.
comp_r · car_h66 · 25 mmCompartment size.
cup_ramp45°The cup's front slope. If pills stick, try 50°.
lcd_win_w · lcd_hole_dx72.3 · 75.14 mmUse these if your LCD differs.
shaft_d · shaft_flat5.25 · 3.2 mmUse these if the carousel is loose or tight on the motor shaft.
sw_hole_sp · sw_hole_in6.51 · 4.95 mmHome switch screw holes.
lever_out · lever_gap · lever_pre2.33 · 3.9 · 2.07 mmYour limit switch's lever: how far its tip reaches past the body, how far it hangs below the body, and how far it moves before it clicks. build_cad.py places the full-tilt switch from these so it clicks at TILT_CLICK (84°).
kcd_w · kcd_h18.9 · 12.1 mmCutout for the power switch: its measured body plus 0.2 mm a side. Its clips are ridged tabs that grip a range of thicknesses, so the deck round the cutout is thinned to 1.7 mm (kcd_panel). Check it on the FitTest before printing the base.
usbc_w · usbc_h13.7 · 5.8 mmHole for the USB-C power socket: its measured body plus 0.2 mm a side. Its two latches are V-shaped spring loops on the short ends whose slope starts just behind the flange, so the back wall round the hole is thinned to 1.2 mm (usbc_wall), where that slope presses the flange tight. Check it on the FitTest before printing the base.
tab_h · tab_w · tab_lean5 · 24 mm · 20°The finger tab under the cup: how far it hangs down, how wide it is, and how far its face leans toward the hand. Past about 8 mm it hits the back of the bay at full tilt, so run python build_cad.py --swing after changing it.
cave_w · cave_r80 · 12 mmThe hand cave: its width, and the radius of its two top corners. It is centred under the cup so the pills land in the middle of the palm, and runs up to the cup's rest ledge, 65 mm.
acr_t · lid_rim3 · 8 mmAcrylic thickness and the width of the lid frame. build_cad.py writes new laser files to cad/laser/ every time it runs.
lid_cut_f · lid_cut_b46.8 · 40 mmHow much the octagonal lid cuts off its front and back corners. The front cut keeps the LCD corner free and the back cut clears the home switch. build_cad.py stops with a message if a cut would bring the lid into the carousel's path.
LCD_TILT20°How far the LCD leans back, set at the top of build_cad.py.
TILT_STOP85°How far the cup tips before it hits the stop. It is set at the top of build_cad.py, which then moves the stop pads and the full-tilt switch to match.
cup_vee · cup_vee_y35° · 17 mmThe cup's V floor. After changing the cup, run python build_cad.py: it works out the cup's resting angle again and moves the stop pads and the full-tilt switch to match.

Parameters whose note says MEASURE are typical sizes. Check your own parts with a ruler or calipers.

11Check before you build

Already checked on the computer

SolidCraft found no overlap between any printed part and real-size stand-ins for the motor, LCD, speaker, ESP32, DFPlayer, ULN2003, DS3231 clock module, power bus, power switch, USB-C socket, the acrylic lid panel, and the home and full-tilt switches with their levers. That includes the LCD leaning back 20° in the sloped front-left corner and the octagonal lid centred on the carousel, whose walls stay at least 5.6 mm outside the path of the carousel's home bump and whose cut back-left corner clears the home switch by about 3 mm. SolidCraft also tipped the cup to 45°, 70° and 84.5°: it clears the deck, the carousel and the motor at every angle, and at 84.5° its only contact is the finger tab pressing the full-tilt switch's lever, as intended. At 86° it overlaps the base only at the two stop pads, so the pads are what stops it. A separate calculation of the tab's path puts the first touch on the lever at 82.5°, the click at 84° and about 1.5 mm of lever push at the stop, without the tab ever reaching the switch body. When the cup hits the stop, a push on its bottom presses the hinge pins down into their notches, not up and out. Every part fits the X1's 256 mm bed. The firmware compiles for ESP32 Dev Module (core 3.3.6). The voice files contain speech (checked by loudness, not by ear), so listen to 0001.mp3 once before copying it to the card.

Not tested yet: needs the real parts

Nothing has been printed or powered up. The angle at which the pills slide out of the cup depends on the pills: about 65° of tilt with the 45° front, and the stop is at 85°. Test with your own pills that every one is out before the switch clicks. Sticky gel capsules on a humid day are the risk. The exact click point depends on your switch's lever, so set it in its slots (section 08). The board sizes and hole spacings are typical values, which is why FitTest exists. The clock module code compiles but has never run on a real board, so do the clock check in section 08. After printing, push the cup to full tilt by hand and make sure its pins stay in their notches. Try the hand cave with the hand of the person who will use the machine: 80 mm wide fits most adult hands palm up, and cave_w changes it. The switch and socket sizes are taken from typical parts, so check the FitTest pieces with yours. Order the acrylic in the thickness you can actually get: if it isn't 3 mm, change acr_t before printing the lid.

Ideas for version 2. Add a small servo gate that drops one pill at a time from a bigger compartment, which was the idea in the ChatGPT chat. Add a second tray stacked on top.