# MASTER PROMPT — SINGLE-PUMP DRINK DISPENSER PCB Act as an expert electronics engineer, PCB designer, embedded engineer, power engineer, and firmware engineer. Design **ONLY ONE complete drink-dispenser pump channel** as a real PCB using individual components. This will become the repeatable building block for a future 30-pump machine. ## HARDWARE Control: ```text MCU → Relay Driver → Relay → 12V DC Pump ``` Include: * Bare MCU IC * 1 × 12V DC pump output * 1 × relay * Relay driver transistor/MOSFET * Gate/base resistor * Pull resistor if required * Relay flyback diode * Pump connector * 12V input connector * Fuse * Reverse-polarity protection * Overcurrent protection * TVS/filtering where appropriate * Power/status LEDs * Test button * Emergency-stop input * USB-C 5V logic/development input * Programming/debug connector * Expansion header Do NOT use: * Arduino boards * Ready-made relay modules * Ready-made pump controllers ## POWER Design: ```text 12V DC ├── Relay └── Pump 12V ↓ 5V / 3.3V REGULATOR ↓ MCU ``` USB-C provides **5V only for logic/development** and must NOT directly power the 12V pump. Include proper USB-C protection, ESD, OCP, OVP, reverse protection, and filtering. Keep high-current pump paths separated from MCU/logic circuitry. ## RELAY/PUMP The MCU must never directly drive the relay. Use: ```text MCU GPIO ↓ Driver ↓ Relay Coil ↓ GND ``` Use the relay's **normally-open (NO)** contact so the pump is OFF by default. Select relay, connector, fuse, MOSFET/transistor, traces, and protection based on the actual pump current. If pump current is unknown, **STOP and request the pump's exact model, operating current, startup current, and stall current. Do not guess.** ## MCU Use the simplest practical bare MCU. Required: * GPIO * UART * Programming/debug * Watchdog * Brownout/reset protection * Optional I2C/SPI/ADC for future expansion The default state after power-up/reset/crash must always be: ```text PUMP OFF ``` ## CONTROLS Include: ```text TEST PUMP BUTTON POWER LED MCU LED RELAY/PUMP LED E-STOP INPUT ``` Test button should run the pump for a safe maximum time. Emergency stop must disable the pump safely and should not depend entirely on firmware. ## FIRMWARE Provide basic firmware for: * Pump ON/OFF * Timed dispensing * Test button * Emergency stop * Watchdog * Safe startup * Maximum pump runtime Example: ```text BOOT ↓ SELF TEST ↓ PUMP OFF ↓ WAIT ↓ COMMAND ↓ RELAY ON ↓ PUMP RUNS ↓ TIMEOUT ↓ RELAY OFF ``` ## EXPANSION Add a small labeled expansion header: ```text 3.3V 5V GND GPIO ADC I2C SPI UART INT ``` Reserve resources for future: * Flow sensors * Liquid-level sensors * Touchscreen * Additional pumps * Wi-Fi/Bluetooth * Camera * Other sensors ## PCB DESIGN Provide: 1. Complete schematic 2. Every component and value 3. MCU pinout 4. Relay circuit 5. Pump circuit 6. Power circuit 7. Protection 8. Connector pinouts 9. PCB layout recommendation 10. Trace-width calculations 11. Thermal/current calculations 12. Complete BOM with manufacturer part numbers 13. Test points 14. ERC/DRC considerations 15. Manufacturing recommendations 16. Firmware 17. Step-by-step test procedure Clearly identify: ```text HIGH-CURRENT PATHS LOW-VOLTAGE LOGIC GROUND 12V 5V 3.3V PUMP RELAY USB-C E-STOP PROGRAMMING ``` ## VALIDATION Before connecting the pump: 1. Inspect PCB 2. Check for shorts 3. Test 12V 4. Test 5V 5. Test 3.3V 6. Program MCU 7. Test GPIO 8. Test relay driver 9. Test relay 10. Test emergency stop Then connect the pump and test timed operation. ## FUTURE 30-PUMP SYSTEM Design this as **CHANNEL 01**. Clearly separate: **PER CHANNEL:** * Relay * Relay driver * Protection * Pump connector * Status LED **SHARED:** * MCU * Main power regulation * USB-C * Programming * Communications The final circuit must be easy to duplicate: ```text CHANNEL 01 → CHANNEL 02 → ... → CHANNEL 30 ``` Do NOT design the 30-channel board yet. ## MOST IMPORTANT RULE **DO NOT GUESS MISSING ELECTRICAL SPECIFICATIONS.** Before finalizing, identify anything I must provide, especially: * Exact pump model * Pump voltage * Operating current * Startup current * Stall current * Power supply * Desired pump runtime * PCB size Final goal: **ONE MCU + ONE RELAY + ONE 12V PUMP + POWER + PROTECTION + SAFETY + EXPANSION** Create a professional, reliable prototype that can later be duplicated into a 30-pump drink dispenser.