Skip to the content
PCBKitNew board
2 layers51.2 × 24 mmSmartsocket, the printed circuit board in 3D

Smart USB-C charge controller on the ESP32-C3: KiCad board, C++ firmware with Wi-Fi, Bluetooth and OTA updates, Android and Windows apps

Size
51.2 × 24 mm
Copper layers
2
Thickness
1.6 mm
Parts
20
Nets
25
Pads
66
Tracks, vias
150, 14
Pours
5
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
2 Nov 2026
Updated
2 Nov 2026

Overview

Smartsocket is an open-source printed circuit board by cLLeB, from the cLLeB/usb-c-charge-controller repository on GitHub. It is a 2-layer board of 51.2 × 24 mm with 20 parts on 25 nets, routed with 150 tracks and 14 vias.

It is built around the SI4435DDY. Its parts include 10 resistors, 3 capacitors, 2 diodes, 2 transistors and 2 connectors. It belongs with the radio and wireless boards and the ESP32 and RISC-V boards of this library.

Main components

1

README

README.md

ESP32-C3 smart USB-C charge controller

A small adapter that sits between a USB-C charger and a phone and stops charging at a battery level you choose, for example 80 %, then starts again at a lower one, for example 40 %. The phone reports its battery level over Wi-Fi, and the adapter does the switching. I designed the circuit and the board, wrote the firmware and the companion apps, and assembled, soldered and tested it in October 2026.

The assembled board: USB-C input, XIAO ESP32-C3 and the switching stage

How it works

To the charger the adapter looks like a simple 5 V device, and to the phone it looks like a simple 5 V charger. Stopping the charge is the same as pulling the plug out, so every phone already knows how to handle it.

  • Power path. A P channel MOSFET (SI4435) switches the 5 V VBUS line, driven through a 2N7000 by the ESP32-C3. Up to 3 A at 5 V, nothing above 5 V anywhere on the board.
  • USB-C signalling. The firmware reads the charger's CC pins to learn whether it offers basic current, 1.5 A or 3 A, then advertises the matching limit to the phone by switching one of three CC resistors.
  • Phone detection. An analog input on the phone side CC line tells the controller whether something is plugged in, even while the output is off.
  • State. The allowed or stopped state is kept in flash, so it survives a restart. A red LED shows the state, and the BOOT button gives "charge to 100 % once", WPS pairing and a reset.

The full circuit table, pin map and decision rules are in DESIGN.md.

Firmware

C++ for the Seeed XIAO ESP32-C3 in the Arduino environment (firmware/smart_socket/).

  • Wireless control over Wi-Fi, with a web page served by the adapter and a JSON API.
  • Setup over Bluetooth from the Android app, by WPS, or through a setup network.
  • Firmware updates over the air, through Wi-Fi or Bluetooth, with an MD5 check before restarting into the new program.
  • Each adapter answers at its own smartsocket-xxxxxx.local address, so several can share one network.
  • Upper and lower limits, a charge timer, charging hours, a heat cut out and the last 20 charging runs.

The decision rules are mirrored in Python in tools/logic.py and covered by 62 scenario tests. tools/test_device.py checks a real adapter feature by feature over Wi-Fi.

Before building, copy firmware/smart_socket/secrets.example.h to secrets.h and set your own update password.

Apps

  • Android (app-android/): finds every adapter on the network, sets one up over Bluetooth, and reports the phone's battery level in the background.
  • Windows (app-windows/): every adapter in one list with limits, timer, history and program upload.
  • iPhone: two Shortcuts automations calling http://smartsocket.local/api/battery?level=…, described in PHONE-SETUP.md.

Windows app

Board

Rev 0.2, 51.2 x 24 mm, two layers, made by PCBWay. The charger plugs into one end and the phone cable leaves from the other. Schematic and board are generated by scripts in kicad/ and checked with ERC, DRC and a netlist comparison.

KiCad 3D viewResistors fitted on the underside
Soldering the USB-C moduleFinished board in hand

A 3D printed case is drafted in OpenSCAD in case/.

Limits of version 1

  • 5 V only, up to 15 W. Laptops need 20 V and USB Power Delivery negotiation, which is a job for version 2.
  • Charge only: the data wires are not connected.
  • Needs a charger with a USB-C socket.

Tools

ESP32-C3, C++, KiCad, Python, Java for Android, C# for Windows, OpenSCAD.

Parts

20
QtyValueFootprintReferences
3100nCapacitor_THT:C_Disc_D4.7mm_W2.5mm_P5.00mmC1, C2, C3
3330kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2, R6
2100kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR7, R8
112kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR4
11N5817Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1
11kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR10
12N7000Package_TO_SOT_THT:TO-92_Inline_WideQ2
133kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR3
14.7kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR5
1680Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR9
1SI4435DDYPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmQ1
1USB-C socket boardConnector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalJ1
1XIAO ESP32-C3Package_DIP:DIP-14_W7.62mmU1
1cable to phoneConnector_Wire:SolderWire-0.5sqmm_1x03_P4.6mm_D0.9mm_OD2.1mmJ2
1red 5 mmLED_THT:LED_D5.0mmLED1

Questions

How big is the Smartsocket PCB?

It measures 51.2 × 24 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Smartsocket use?

20 parts, built around the SI4435DDY. 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.

Where can I download the Smartsocket KiCad files?

From the cLLeB/usb-c-charge-controller repository on GitHub, at the commit this page was made from: the board is kicad/smartsocket.kicad_pcb and its schematic kicad/smartsocket.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Smartsocket design in my own project?

Its repository states no licence, so its author keeps all rights: ask cLLeB before reusing the design.

Similar boards

  • 4 layers160 × 65 mmCapybara rocket, the printed circuit board in 3D

    Capybara rocket

    adam-kabbara/RSX-CANSAT-2026

    This is a repository design to manage the files made by the Aerial team under the Robotics for Space eXploration design team at the University of Toronto

    174 parts4
  • 2 layers161 × 87 mmPMS, the printed circuit board in 3D

    PMS

    Benjamin-Gunn/Poseidon-PMS

    Power Management System for Poseidon.

    182 parts1
  • 2 layers66.9 × 74.5 mmDeskHop Rev1, the printed circuit board in 3D

    DeskHop Rev1

    hrvach/deskhop

    Fast Desktop Switching Device

    20 parts7.9kGPL-3.0
  • 2 layers86.4 × 64.8 mmSlot machine, the printed circuit board in 3D

    Slot machine

    google/google-ctf

    Google CTF

    20 parts5.1kApache-2.0
  • 2 layers36.2 × 26.8 mmEsp32 minimal, the printed circuit board in 3D

    Esp32 minimal

    atopile/atopile

    Design circuit boards with code! ✨ Get software-like design reuse 🚀, validation, version control and collaboration in hardware; starting with electronics ⚡️

    20 parts4kMIT
  • 2 layers108.1 × 393.8 mmSweep compact ble, the printed circuit board in 3D

    Sweep compact ble

    davidphilipbarr/Sweep

    Sweep - a small promicro based keyboard inspired by the Ferris.

    20 parts2.1k
  • 2 layers26 × 15.9 mmTPS54340 Buck Regulator, the printed circuit board in 3D

    TPS54340 Buck Regulator

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    20 parts1.2k
  • 2 layers67.6 × 30.5 mmRgb to hdmi, the printed circuit board in 3D

    Rgb to hdmi

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    20 parts1kGPL-3.0