ESP32 Medical Device Schematic

0:00

Work done
  • Renamed the project to ESP32 Medical Device Controller.
  • Added the full schematic component set for the controller, motor driver, ADC/display, sensor block, and power subsystem, including U1, U2, U3, OLED1, U4, U5, BT1, D1, VR1, SW1, S1, CN1, J1, plus the passive network R1 through R9, C1 through C7, and L1.
  • Wired the main control and peripheral nets, including GPIO assignments for U2 STEP/DIR/ENABLE from U1, the GPIO19 limit switch input, shared I2C bus to U3 and OLED1, the potentiometer/photodiode analog input path to U3 A0, and most of the 12 V / 5 V / battery grounding structure.
  • Created and populated Design Notes to record architecture decisions and flag the unresolved power-path and sensor-front-end review items.
Success criteria review
  • ✅ Main ESP32, motor driver, ADC, OLED, sensor parts, and power subsystem parts were added to the schematic.
  • ✅ Required GPIO mappings were mostly implemented: STEP on GPIO23, DIR on GPIO22, ENABLE on GPIO21, and limit input on GPIO19.
  • ✅ The LM2596, TP4056, and 18650 battery interface were added, and the main rails were partially defined.
  • ✅ Ambiguous details were explicitly documented for review in Design Notes.
  • ❌ The schematic is not yet functionally complete: the motor connector wiring is incorrect/incomplete after connector replacement, the new J1 12 V input connector is not yet reconnected to the VIN rail, and the current motor nets still reflect the old temporary connector state.
  • ❌ The simple D1 resistor front-end is only a placeholder and needs engineering review before fabrication for a medical sensing application.
  • ❌ The battery subsystem is present but the final power-path behavior between the external 12 V supply and switched battery output is still only flagged, not fully implemented.
Next steps
  • Reconnect the replaced connectors correctly: wire J1 to the VIN_12V/GND input rails and wire CN1 to the four A4988 motor outputs.
  • Finish the power-path definition between U4, U5, BT1, and S1.
  • Review or redesign the D1 analog front-end if this optical measurement needs higher sensitivity or medically relevant accuracy.
  • After those fixes, the natural next step is PCB layout: board sizing, stackup, and component placement. Once the schematic is corrected, I can proceed directly to that stage.
12 days

Started implementing a plan

Goal: Create a comprehensive schematic for an ESP32-based device integrating ESP32 control, A4988 stepper driver + NEMA17 connector, ADS1115 ADC + SSD1306 OLED on shared I2C, sensor block (10k slide pot, 5x 940nm IR LEDs, BPW34 photodiode), and power blocks (12V->5V buck via LM2596, TP4056+18650 charging) with correct GPIO mapping.

Status / progress so far:

- Project renamed to "ESP32 Medical Device Controller".

- Major components added to schematic: ESP32-DEVKITC-32D (U1), A4988 module (U2), ADS1115 module (U3), 0.96" SSD1306 OLED (OLED1), LM2596S-5.0 (U4) with L1 and bulk/decoupling caps, TP4056 protected module (U5) + 18650 holder (BT1), BPW34 photodiode (D1), 5x TSAL6400 IR LEDs (D2–D6) with series resistors (R1–R5), slide pot (VR1), limit microswitch (SW1), battery switch (S1), I2C pull-ups (R8/R9), photodiode load resistor (R6), limit pull-up (R7), 12V input connector (J1), and a 4-pin motor connector (CN1).

- Created project doc [design-notes](https://www.flux.ai/shahdtarekk/silly-gray-robot-vacuum/files/design-notes~4c) capturing architecture + open ambiguities.

- Connected key nets:

- STEP: U1 IO23 -> U2 STEP

- DIR: U1 IO22 -> U2 DIR

- ENABLE: U1 IO21 -> U2 ~ENABLE

- LIMIT: U1 IO19 with pull-up R7 to 3V3 and SW1 contact to GND

- I2C bus: U1 IO18 -> SCL, U1 IO17 -> SDA; pull-ups R9/R8 to 3V3; connected to U3 and OLED1

- Sensor: VR1 wiper + BPW34 K + R6 -> ADS1115 A0; VR1 ends to 3V3/GND; BPW34 A to GND

- Power: J1 provides VIN_12V to LM2596 VIN and A4988 VMOT; LM2596 SW node -> L1 -> 5V rail feeding ESP32 EXT_5V, OLED1 5V, TP4056 IN+, IR LED anodes; bulk/decoupling caps connected.

- Battery subsystem wired locally: BT1 -> U5 BAT; U5 OUT+ -> S1 COM, S1 A = BAT_SW net (not yet used elsewhere).

Implementation plan (remaining work only):

1. Fix motor output wiring to the 4-pin motor connector CN1:

- Connect U2 1A/1B/2A/2B to CN1 pins 1–4 (define consistent coil pair mapping, e.g., 1A/1B = Coil A, 2A/2B = Coil B).

- Remove/clean any stale motor nets left from prior connector replacement.

2. Restore/verify 12V input connectivity after connector replacement:

- Confirm VIN_12V net still connects to J1 pins and to U4 VIN, U2 VMOT, and input bulk capacitor.

- If any VIN_12V connections were destroyed by J1 replacement, reconnect them.

3. Complete LM2596 power stage correctly for fixed 5V part:

- Tie U4 FEEDBACK to OUTPUT per LM2596 fixed-output datasheet (currently FEEDBACK is incorrectly tied to GND).

- Add/verify catch diode (Schottky) from switch node to ground and ensure correct polarity.

- Add/verify output/input capacitor ESR suitability (or at least add notes/properties if using generic caps).

4. I2C level-translation review:

- Confirm OLED module VCC pin is truly 3.3V-compatible or requires 5V; if module is 5V-only, add level shifter or power it from 3.3V and update rail accordingly.

5. Sensor block refinement (flagged ambiguity):

- Decide whether BPW34 needs a transimpedance amplifier (TIA) instead of simple load resistor; if yes, select op-amp and implement TIA + filtering.

- Confirm IR LED drive current targets; adjust R1–R5 values and consider adding a transistor/MOSFET driver if GPIO-controlled modulation is required.

6. Power-path architecture decision and schematic update:

- Decide whether battery should provide backup to system 5V (OR-ing/ideal diode) or remain standalone.

- If backup required, add power-path OR-ing (ideal diode controller or Schottky diodes) and connect BAT_SW into the system supply (likely into 5V rail via boost or into VIN via buck/boost), as appropriate.

7. Schematic QA:

- Run connectivity review: ensure all required pins are powered, grounds are common, unused pins are handled (MS1/MS2/MS3/reset/sleep already strapped), and no shorted nets.

- Add labels/notes for medical-device safety review (isolation/ESD/fusing) as needed.

Notes:

- Some earlier connections were miswired and corrected; re-check netlist around I2C and motor connector after final wiring.

- The power connector J1 was replaced mid-stream; verify VIN_12V net integrity.

12 days
1-Connect the 12V input from J1 to the VIN rail. Wire the CN1 connector pins to the four output pins of the A4988 motor driver. Also, ensure the common ground (GND) is shared between the ESP32, A4988, and the ADS1115 ADC.
12 days

Working on your request...

10:30

12 days

Refine this doc
Ask about this doc
Design Notes
Architecture Decisions
  • Main controller: ESP32-DEVKITC-32D development board.
  • Motor driver: A4988 module with STEP on GPIO23, DIR on GPIO22, ENABLE on GPIO21.
  • ADC and display share the 3.3 V I2C bus.
  • Main battery-powered system supply: TP4056 charger charges the single-cell 18650 battery, the battery positive is routed through the main power switch, and the switched battery rail feeds the LM2596 buck regulator input.
  • LM2596 fixed-output feedback is tied to the regulated 5 V output node after the inductor, and the 5 V output powers the ESP32 dev board VIN input.
  • The LM2596 ON/OFF pin is tied to the switched battery input so the regulator is enabled whenever the main switch connects the battery.
  • The 10k linear slide potentiometer models the force-sensor spring mechanism with one end on 3.3 V, one end on GND, and the wiper routed directly to ADS1115 A0.
  • BPW34 front-end upgraded from a simple resistor load to an op-amp transimpedance amplifier using OPA333, 100 kΩ feedback, and 47 pF compensation to provide a cleaner low-impedance signal to the ADS1115.
  • IR LED series resistors were reduced to 39 Ω to target a substantially higher but still continuous-current operating point from the 5 V rail.
  • Generic 4-pin SSD1306 module is assumed to be powered from 5 V while remaining on 3.3 V-pulled-up I2C; PCA9306 level shifter footprint added as fallback if a specific module proves not 3.3 V-I2C compatible.
Open Review Items
  • The current LM2596 stage now runs from the 1-cell battery path exactly as requested, but this is not a physically valid regulation path for a 5 V output from a single 18650 cell; a boost regulator or a different charger/power-path architecture will be needed for a true battery-backed 5 V rail in hardware.
  • TP4056 IN+ is currently tied to the 5 V rail in this design snapshot; verify whether that rail is intended as a charger input source or if a dedicated external charger input should be added.
  • Optional I2C level shifter U7 is present as a fallback population option, but may be bypassed if the chosen OLED module is verified compatible with 3.3 V I2C pull-ups.
  • Medical-device safety items such as input fuse, TVS/ESD protection, and isolation review still need explicit system-level review before production use.

    Architecture Decisions

    Open Review Items

Documents

    Design Notes

Assets

Assets are files uploaded to this project which can be used in various ways.

ESP32 Medical Device Controller thumbnail
Welcome to your new project. Imagine what you can build here.

Properties

Properties describe core aspects of the project.

Pricing & Availability

Distributor

Qty 1

Arrow

$8.14–$13.93

Digi-Key

$27.17–$30.02

LCSC

$9.22–$9.82

Mouser

$19.40–$19.48

TME

$6.64

Verical

$8.11–$32.06

Controls