
ESP32Anglerfish
Matchboxscope/Matchboxscope
ESP32-based mini microscope for fluidic device observation

PCB-based charging circuit with automatic cut-off; optimized for safe long-term operation
AUTO CUT OFF CHARGER is an open-source printed circuit board by arhamjaffer, from the arhamjaffer/auto-cutoff-battery-charger repository on GitHub. It is a 2-layer board with 17 parts on 14 nets, routed with 142 tracks and 0 vias.
It is built around the BD139. Its parts include 5 diodes, 4 resistors, 3 connectors, 2 capacitors and 1 IC. It belongs with the power boards of this library.
PCB-based charging circuit with automatic cut-off; optimized for safe long-term operation
An automatic battery charger with cut-off protection — designed to safely charge a 12V lead-acid battery and automatically disconnect when fully charged, preventing overcharging and extending battery life.
This project covers the full PCB design cycle: circuit design, schematic capture in KiCad, component selection, PCB layout, and fabrication-ready Gerber export.
Designed as part of my circuit design & PCB prototyping work at NUST-PNEC.
(Add your PCB layout screenshot or 3D render here)
| Schematic | PCB Layout | 3D View |
|---|---|---|
![]() |
| Parameter | Value |
|---|---|
| Input Voltage | 14–15V DC (from transformer + rectifier) |
| Output / Charging Voltage | 13.8V – 14.4V (12V battery) |
| Cut-Off Voltage | ~14.4V (fully charged threshold) |
| Max Charging Current | ~1A |
| Battery Type | 12V Lead-Acid / SLA |
| Cut-Off Mechanism | Comparator-based (LM358 / LM393) |
| Indication | LED — Charging (Red) / Full (Green) |
| Protection | Overcharge cut-off, Reverse polarity |
| PCB Layers | 2-Layer |
| EDA Tool | KiCad |
AC Mains Input
↓
Transformer (Step-Down)
↓
Bridge Rectifier (1N4007 × 4)
↓
Filter Capacitor (Smoothing)
↓
Voltage Regulator / Charging Stage
↓
Comparator Circuit (LM358)
monitors battery voltage continuously
↓
Battery Voltage < 14.4V → Relay ON → Charging continues 🔴 LED
Battery Voltage ≥ 14.4V → Relay OFF → Charging stops 🟢 LED
↓
Battery (12V Lead-Acid)The heart of this circuit is the LM358 op-amp comparator — it compares the battery terminal voltage against a fixed reference (set via a voltage divider using a potentiometer). When battery voltage crosses the threshold, the comparator output switches, triggering the relay to cut off charging automatically.
auto-cutoff-battery-charger/
│
├── 📁 Schematic/
│ └── battery_charger.kicad_sch # Full schematic
│
├── 📁 PCB/
│ └── battery_charger.kicad_pcb # PCB layout
│
├── 📁 Gerbers/
│ ├── battery_charger-F_Cu.gbr # Front copper
│ ├── battery_charger-B_Cu.gbr # Back copper
│ ├── battery_charger-F_Silkscreen.gbr
│ ├── battery_charger-B_Silkscreen.gbr
│ ├── battery_charger-F_Mask.gbr
│ ├── battery_charger-B_Mask.gbr
│ ├── battery_charger-Edge_Cuts.gbr # Board outline
│ └── battery_charger.drl # Drill file
│
├── 📁 BOM/
│ └── BOM.csv # Bill of Materials
│
├── 📁 images/
│ ├── schematic.png
│ ├── pcb_layout.png| # | Component | Value / Part | Package | Qty |
|---|---|---|---|---|
| 1 | Op-Amp Comparator | LM358 / LM393 | DIP-8 / SOP-8 | 1 |
| 2 | Relay | 12V SPDT | PCB Mount | 1 |
| 3 | Relay Driver Transistor | BC547 / 2N2222 | TO-92 | 1 |
| 4 | Rectifier Diodes | 1N4007 | DO-41 | 4 |
| 5 | Flyback Diode | 1N4007 | DO-41 | 1 |
| 6 | Voltage Regulator | LM7812 / LM317 | TO-220 | 1 |
| 7 | Trimmer Potentiometer | 10kΩ | 3296W | 1 |
| 8 | Resistors | 1kΩ, 4.7kΩ, 10kΩ | 0805 / TH | 6 |
| 9 | Filter Capacitor | 1000µF / 25V | Electrolytic | 1 |
| 10 | Decoupling Capacitor | 100nF | 0805 | 2 |
| 11 | LED (Charging) | Red | 3mm / 0805 | 1 |
| 12 | LED (Full) | Green | 3mm / 0805 | 1 |
| 13 | LED Resistors | 470Ω | 0805 | 2 |
| 14 | Screw Terminals | 2-pin | 5.08mm | 3 |
| 15 | Fuse Holder + Fuse | 1A | PCB Mount | 1 |
Full BOM available in
/BOM/BOM.csv
1. Circuit Design & Hand Calculations
↓
2. Schematic Capture (KiCad Schematic Editor)
↓
3. Component Selection & Footprint Assignment
↓
4. Netlist Export → PCB Editor
↓
5. PCB Layout & Component Placement
↓
6. Trace Routing (Power traces wider — 1.5mm+)
↓
7. Design Rule Check (DRC) — 0 errors
↓
8. Gerber Export (Fabrication-ready)| Feature | Implementation |
|---|---|
| Overcharge Protection | Relay cuts off at ~14.4V via comparator |
| Reverse Polarity Protection | Diode at battery input |
| Overcurrent Protection | Inline fuse (1A) |
| Flyback Protection | Freewheeling diode across relay coil |
| Visual Indication | Red = Charging, Green = Full |
/Gerbers/ folder.gbr and .drl files# Clone the repository
git clone https://github.com/arhamjaffer/auto-cutoff-battery-charger.git
# Open in KiCad
# File → Open Project → select battery_charger.kicad_pro⚠️ Requires KiCad 6.0 or later. KiCad 10.0 recommended.
Once assembled:
⚡ Warning: If using with a mains transformer, ensure proper isolation and follow electrical safety practices. High voltage is dangerous.
Arham Jaffer B.E. Electrical Engineering — NUST-PNEC, Karachi 🇵🇰 Co-Founder @ GenXi Tech Solutions
This project is open-source under the MIT License. Feel free to use, modify, and build upon it — just give credit!
| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | Conn_01x02_Pin | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J1, J3 |
| 2 | LED | LED_THT:LED_D5.0mm | D4, D5 |
| 1 | 0.1u | Capacitor_THT:CP_Radial_D10.0mm_P5.00mm | C2 |
| 1 | 10 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R4 |
| 1 | 1000u | Capacitor_THT:CP_Radial_D10.0mm_P5.00mm | C1 |
| 1 | 10k | Potentiometer_THT:Potentiometer_Bourns_3296W_Vertical | RV1 |
| 1 | 1N4007 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D2 |
| 1 | 1k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R3 |
| 1 | 220 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1 |
| 1 | 2k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R2 |
| 1 | BD139 | Package_TO_SOT_THT:TO-126-3_Vertical | Q1 |
| 1 | Conn_01x02 | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J2 |
| 1 | D_Bridge_+-AA | Diode_THT:Diode_Bridge_Round_D9.8mm | D1 |
| 1 | D_Zener | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D3 |
| 1 | LM317_TO-220 | Package_TO_SOT_THT:TO-220-3_Vertical | U1 |

Matchboxscope/Matchboxscope
ESP32-based mini microscope for fluidic device observation







xtarke/automated_buggy
This shield connects microcontroller (MSP-EXP430FR2355) pins to the car's power board. Go to Power Board for more hardware information.
17 parts, built around the BD139. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the arhamjaffer/auto-cutoff-battery-charger repository on GitHub, at the commit this page was made from: the board is AUTO CUT OFF CHARGER.kicad_pcb and its schematic AUTO CUT OFF CHARGER.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask arhamjaffer before reusing the design.