From 9508f6a81d325dfc280c23cff89d0548c04328b6 Mon Sep 17 00:00:00 2001 From: rafael Date: Tue, 29 Sep 2026 14:21:21 +0800 Subject: [PATCH] Add battery wiring diagram --- WIRING-DIAGRAM.md | 235 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 WIRING-DIAGRAM.md diff --git a/WIRING-DIAGRAM.md b/WIRING-DIAGRAM.md new file mode 100644 index 0000000..e913f69 --- /dev/null +++ b/WIRING-DIAGRAM.md @@ -0,0 +1,235 @@ +# Battery-Powered 28BYJ-48 Stepper Controller + +This project uses one 18650 cell, a TP4056 charger module, an MT3608 boost +converter, an Arduino Nano, and a ULN2003 driver board to power a 28BYJ-48 +stepper motor. + +A DPST switch controls the battery-to-boost path and independently disconnects +the motor supply. The Arduino Nano clone used here has **no USB VBUS Schottky +diode**, so the USB and battery-powered 5 V supply must not be connected to the +Nano at the same time. + +> This document describes wiring and power only. It does not include Arduino +> code. + +--- + +## 1. Components + +| Component | Notes | +|---|---| +| 18650 Li-ion cell | Single cell, suitable holder or secure battery connection | +| TP4056 charger module | Use a protected module with separate `B+`, `B−`, `OUT+`, and `OUT−` terminals | +| MT3608 boost converter | Adjustable; set its output to 5.0 V before connecting the loads | +| DPST on/off switch | Both poles operate together | +| Arduino Nano clone | This clone has no VBUS Schottky diode | +| 28BYJ-48 stepper motor | Use the 5 V version | +| ULN2003 driver board | Matches the motor’s 5-pin plug | +| Optional fuse | Near TP4056 `OUT+`; rated above normal load current and below safe limits of the cell, protection board, and wiring | +| Optional capacitor | 100–470 µF across the 5 V rail; observe capacitor polarity and voltage rating | + +Check the labels on the actual modules: board layouts and terminal names vary. +Some TP4056 boards do not have a protection circuit or separate `OUT` terminals. +This diagram requires a protected module with separate load terminals. Do not +assume an unprotected TP4056 board provides battery over-discharge or +over-current protection, and do not use its `B+`/`B−` pads as though they were +protected `OUT+`/`OUT−` pads. + +--- + +## 2. Power flow + +```text +18650 ──► TP4056 protected battery/load terminals + │ + └── OUT+ ──► DPST Pole A ──► MT3608 ──► 5 V rail + ├── Nano 5V + └── DPST Pole B ──► ULN2003 VCC +``` + +The TP4056 is a **charger**, not a 5 V power supply. Its `IN+`/`IN−` terminals +are the USB charging input. The `B+`/`B−` terminals connect to the battery. +The protected module’s `OUT+`/`OUT−` terminals provide the battery-voltage load +connection. + +The MT3608 boosts the cell voltage (approximately 3.0–4.2 V) to 5.0 V. + +--- + +## 3. Wiring schematic + +```text +Battery: + 18650 (+) ──► TP4056 B+ + 18650 (−) ──► TP4056 B− + +Charging input: + USB 5 V (+) ──► TP4056 IN+ + USB GND ──► TP4056 IN− + +Battery-powered load path: + TP4056 OUT+ ──[optional fuse]──► DPST Pole A common + DPST Pole A switched terminal ──► MT3608 IN+ + + TP4056 OUT− ──► common system GND + MT3608 IN− ──► common system GND + MT3608 OUT− ──► common system GND + Nano GND ──► common system GND + ULN2003 GND ──► common system GND + +5 V and motor supply: + MT3608 OUT+ ──► 5 V rail ──┬──► Arduino Nano 5V + └──► DPST Pole B common + DPST Pole B switched terminal ──► ULN2003 VCC + +Control and motor: + Arduino Nano D9 ──► ULN2003 IN1 + Arduino Nano D10 ──► ULN2003 IN2 + Arduino Nano D11 ──► ULN2003 IN3 + Arduino Nano D12 ──► ULN2003 IN4 + + 28BYJ-48 5-pin plug ──► ULN2003 motor connector +``` + +### Important TP4056 ground detail + +Connect the cell’s negative terminal to **`B−` only**. Connect system ground to +**`OUT−`**. Do **not** add an external wire directly joining `B−` to `OUT−`; +that can bypass the protection circuit on a protected TP4056 module. + +The battery negative and system ground may be connected internally through the +module’s protection circuitry. Use the module’s labeled load terminals for the +load. + +--- + +## 4. DPST switch operation + +The DPST switch has two electrically separate poles operated by the same +handle: + +- **Pole A:** connects TP4056 `OUT+` to MT3608 `IN+`. +- **Pole B:** connects the 5 V rail to ULN2003 `VCC`. + +| Switch state | Pole A | Pole B | Result | +|---|---|---|---| +| **ON** | Closed | Closed | Battery powers the MT3608; Nano and motor receive 5 V | +| **OFF** | Open | Open | Battery is disconnected from the boost input; motor supply is disconnected | + +With Pole B open, the motor’s supply is physically disconnected even if the +Nano is powered separately. The Nano itself can still be powered by USB when +the switch is off. + +Pole B disconnects only the ULN2003 `VCC`; it does not disconnect the driver’s +`IN1`–`IN4` signal wires or its ground. If the Nano is powered over USB while +Pole B is open, its outputs can still drive the ULN2003 inputs and draw input +current. For USB debugging in this state, hold the Nano in reset or disconnect +the `IN1`–`IN4` signal wires. The motor supply remains disconnected because +ULN2003 `VCC` is open. + +--- + +## 5. MT3608 setup + +The MT3608 is adjustable; it is not a fixed 5 V supply. + +1. Turn the DPST switch **OFF**. +2. Leave the Nano and ULN2003 disconnected. +3. Connect the cell and measure MT3608 `OUT+` to `OUT−`. +4. Adjust the module’s potentiometer until the output is **5.0 V**. +5. Power-cycle and recheck the output. +6. Connect the Nano and ULN2003 only after confirming the voltage. + +The module’s current capability depends on its components, input voltage, and +cooling. The MT3608 IC’s “2 A” switch-current rating does not mean every module +can deliver 2 A at 5 V. + +--- + +## 6. Operating modes + +### Run from battery + +- DPST: **ON** +- Nano USB: **unplugged** +- TP4056 charging USB: **unplugged** + +The Nano and motor are powered from the MT3608’s 5 V output. + +### Charge the battery + +- DPST: **OFF** +- TP4056 USB input: connected to a 5 V charger +- Nano USB: **unplugged** + +With Pole A open, the battery-powered load path is disconnected. Keep the Nano +USB unplugged during charging as the conservative procedure. + +### Debug over USB serial + +- DPST: **OFF** +- TP4056 charging USB: **unplugged** +- Nano USB: connected to the computer +- Disconnect the MT3608 `OUT+` wire from the 5 V rail while debugging. + +The Nano clone has no VBUS Schottky diode. Disconnecting the boost output during +USB debugging avoids applying USB 5 V to the MT3608 output. Pole B remains open, +so the ULN2003 motor supply is isolated. + +**Never connect Nano USB while the DPST is ON.** In that state, the MT3608 +supplies the Nano’s 5 V pin, which could back-feed the computer’s USB port. + +With the DPST OFF during USB debugging, the signal pins remain connected to +ULN2003 `IN1`–`IN4`; hold the Nano in reset or disconnect those wires, as +described above. + +--- + +## 7. First power-on checklist + +1. Confirm the cell goes to TP4056 `B+` and `B−`. +2. Confirm the circuit ground goes to TP4056 `OUT−`; do not bridge `B−` to + `OUT−`. +3. With the switch OFF and loads disconnected, set the MT3608 output to 5.0 V. +4. Recheck polarity and wiring. +5. Connect the Nano and ULN2003. +6. Run from battery only with the switch ON and Nano USB unplugged. + +--- + +## 8. Design notes + +- Use the Nano’s **`5V`** pin for the regulated 5 V rail. Do not use `VIN` for + this 5 V supply. +- The 28BYJ-48 plugs directly into the ULN2003 board; individual coil wires + should not need to be jumpered. +- Standard 28BYJ-48 ULN2003 boards do not have a current-adjustment trimmer. + Leave their bypass capacitors installed. +- An optional 100–470 µF capacitor can be placed across the 5 V rail and GND + near the loads to help with supply dips. Observe its polarity. +- Keep the Nano, MT3608, and ULN2003 grounds connected to the TP4056 + `OUT−`-referenced system ground. +- Pole B isolates the ULN2003 motor supply only. It does not isolate the control + inputs or ground, so it is not a complete electrical disconnection of the + driver board. +- Do not charge and run the load simultaneously with this simple TP4056 + arrangement. Supporting that requires a proper power-path/load-sharing + design. + +--- + +## 9. References + +These tutorials cover the stepper/driver portion of the project: + +- 28BYJ-48 + ULN2003 + Arduino walkthrough: + https://lastminuteengineers.com/28byj48-stepper-motor-arduino-tutorial/ +- element14 stepper wiring walkthrough: + https://community.element14.com/products/arduino/arduino-projects/b/blog/posts/how-to-control-28byj-48-stepper-motor-with-uln2003-driver-and-arduino + +TP4056 load-sharing background: + +- Arduino discussion of TP4056, boost converter, and Nano: + https://forum.arduino.cc/t/using-li-ion-battery-with-tp4056-to-power-arduino-nano/1324112 +- TP4056 load-sharing modification discussion: + https://forum.arduino.cc/t/tp4056-lithium-charger-module-modification-to-add-power-sharing/1008473