Skip to the content
PCBKitNew board
2 layers185 × 98 mmMosfetload, the printed circuit board in 3D

Electric Load and Logger

Size
185 × 98 mm
Copper layers
2
Thickness
1.6 mm
Parts
96
Nets
75
Pads
350
Tracks, vias
643, 271
Pours
13
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
24 Nov 2024
Updated
28 Sep 2025

Overview

Mosfetload is an open-source printed circuit board by hnz1102, from the hnz1102/electricload repository on GitHub. It is a 2-layer board of 185 × 98 mm with 96 parts on 75 nets, routed with 643 tracks and 271 vias.

It is built around the ESP32-S3-WROOM-1-N16R8, TSB611ILT and CH224K, with the LD1117S33TR(MS), SPX3819M5-L and 2N7002K among its other parts. Its parts include 28 resistors, 22 capacitors, 9 ICs, 5 connectors and 4 transistors. It belongs with the power and sensors and measurement boards and the ESP32 boards of this library.

Main components

11

README

README.md

Electric Load and Logger

Electric Load and Logger

This is an Electric Load and Logger. It can consume the power of the device and send the data to the server. The maximum power is 100W, maximum voltage is 30V, and maximum current is 10A. But, it must be used under 100W. And it can measure the voltage, current, and power consumption of the device and send the data to the InfluxDB server. You can see the data on the Dashboard.

Feature

High Power - It can measure the power consumption of the device up to 100W.

Controllable - You can control the current consumption by the device. The current can be controlled every 10mA from 10mA to 10A.

Auto Control - The current consumption can be controlled automatically by the device using the PID controller.

High-resolution - By using Texas Instruments INA228 IC - 20-bit delta-sigma ADC, It can be got measurement data with 195.uV Bus voltage and 163.84mV Shunt voltage.

Microcontroller on board - No need for a client PC when you are measuring. Directly send to the server.

Transfer measurement data via WiFi - This Logger can transfer data to Linux PC via WiFi network and you can see the dashboard graph in influxDB.

Internal Memory Buffer - If the WiFi connection is not established, the data is stored in the internal memory buffer. When the WiFi connection is established, the data is sent to the server.

How to use the Electric Load and Logger

At first, connect the power supply to this electric load as shown in the image below. The Plus line is connected to the 'Input +' terminal, and the GND line is connected to the 'Input -' terminal. And Input- is connected to the GND terminal, and Input+ is connected to the 'VBUS' terminal. This allows the device to measure the voltage. terminal

Then, connect the USB Power Delivery (PD) line to the USB-C port. The PD line must be connected to the USB PD Charger. This load gets power from the USB PD 12V.

After connecting the power supply, the display will show the current voltage, current, and power consumption. Then, you can set the current consumption by the device using the touch pad. Clockwise rotation increases the current, and counterclockwise rotation decreases the current. The current can be controlled every 10mA from 10mA to 10A. Fast rotation will increase or decrease the current quickly every 100mA. After setting the current, press the Center Position of the touch pad during over a second to start the load and measurement. The current consumption can be controlled automatically by the device using the PID controller.

pad

The display shows the current, voltage, power consumption, target current, temperature, PWM duty and status of the load. If you start the load, the display shows the yellow color circle in the left bottom corner and blinking. If the load is stopped, the circle disappears. After the measure, the data is sent to the server. If the WiFi connection is not established, the data is stored in the internal memory buffer. When the WiFi connection is established, the data is sent to the server. However, the memory buffer is not stored more than 4096 samples. If the some data is stored in the memory buffer, the display shows the red bar in the bottom of the display.

You can see the realtime data using Dashboard by InfluxDB.

dashboard

After the measure, to stop logging, press the Center Position of the touch pad during over a second. The load is stopped and the data is not sent to the server.

The dashboard shows the graphs of voltage, current, power consumption, and PWM duty. The temperature of the heat sink and FAN RPM also shown in the dashboard.

How to build from code and Install to the unit.

Using Ubuntu 22.04.3 LTS and ESP-IDF V5.2.1

Prerequisites

Ensure that your system meets the following requirements before proceeding with the installation:

  • Operating System: Linux-based distribution
  • Required Packages: git, python3, python3-pip, gcc, build-essential, curl, pkg-config, libudev-dev, libtinfo5, clang, libclang-dev, llvm-dev, udev, libssl-dev, python3.10-venv

Installation Steps

1. System Update and Package Installation

Update your system and install the necessary packages using:

bash
sudo apt update && sudo apt -y install git python3 python3-pip gcc build-essential curl pkg-config libudev-dev libtinfo5 clang libclang-dev llvm-dev udev libssl-dev python3.10-venv

2. Rust Installation

Install Rust programming language and Cargo package manager:

bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After installation, activate Rust by sourcing the environment:

bash
. "$HOME/.cargo/env"

3. Additional Tools Installation

Install the following Rust tools:

  • ldproxy
  • espup
  • cargo-espflash

Use the following commands:

bash
cargo install ldproxy
cargo install espup
cargo install cargo-espflash

2024-08-12, cargo-espflash can not be compiled. If you have an error, use the following command.

bash
cargo install cargo-binstall
cargo binstall cargo-espflash 

4. ESP Environment Setup

Run the following command to install and update the Espressif Rust ecosystem:

bash
espup install
espup update

Set up environment variables:

bash
. ./export-esp.sh

5. Udev Rules Configuration

Configure udev rules for device permissions:

bash
sudo sh -c 'echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"303a\", ATTRS{idProduct}==\"1001\", MODE=\"0666\"" > /etc/udev/rules.d/99-esp32.rules'
sudo udevadm control --reload-rules
sudo udevadm trigger

6. Clone Repository

Clone the TimeLeapCam repository:

bash
git clone https://github.com/hnz1102/electricload.git
cd electricload/code

7. Setting WiFi SSID, Password, etc.

Change the following configuration file: cfg.toml You have to set the following parameters. WiFi SSID, Password, InfluxDB Server IP Address, InfluxDB API Key, and InfluxDB API with your ORG. You can get the API Key from the InfluxDB Web Console. Please see the 'How to Install the influxDB and Configure the Dashboard' section No.3.

bash
[electricload]
wifi_ssid = "<Your AP SSID>"  # Set your AP SSID
wifi_psk = "<Your AP Password>" # Set your AP Password
http_server = "<InfluxDB Server IP Address:Port>" # Set your InfluxDB Server IP Address and Port ex. 192.168.1.100:8086
pid_kp = "0.001"
pid_ki = "0.022"
pid_kd = "0.00001"
pwm_offset = "4500"
max_current_limit = "15.0"
max_power_limit = "105.0"
influxdb_api_key = "<InfluxDB API KEY>" # Set your InfluxDB API Key
influxdb_api = "/api/v2/write?org=<ORG>&bucket=LOGGER&precision=ns" # Set your InfluxDB API with your ORG and BUCKET ex. /api/v2/write?org=ORG&bucket=LOGGER&precision=ns
influxdb_tag = "currentch1"
influxdb_measurement = "electricload"

8. Build and Flash

Build the project.

bash
cargo build --release

9. Flash the Firmware

Connect the Electric Load and Logger to your PC using a USB cable. Then, flash the firmware:

bash
cargo espflash flash --release --monitor

If your device is not detected, power on the device and during the boot, press the BOOT button. Then, run the flash command again.

10. Monitor the Output

After flashing the firmware, the console shows the booting messages.

bash
[2024-11-24T08:43:44Z INFO ] 🚀 A new version of cargo-espflash is available: v3.2.0
[2024-11-24T08:43:44Z INFO ] Serial port: '/dev/ttyACM0'
[2024-11-24T08:43:44Z INFO ] Connecting...
[2024-11-24T08:43:44Z INFO ] Using flash stub
Finished `release` profile [optimized] target(s) in 0.19s
Chip type:         esp32s3 (revision v0.1)
Crystal frequency: 40 MHz
Flash size:        16MB
Features:          WiFi, BLE
MAC address:       xx:xx:xx:xx:xx:xx
Bootloader:        /esp32/electricload/code/target/xtensa-esp32s3-espidf/release/build/esp-idf-sys-37f4c3bc37bda4bb/out/build/bootloader/bootloader.bin
Partition table:   partitions.csv
App/part. size:    1,358,304/15,728,640 bytes, 8.64%
[2024-11-24T08:43:45Z INFO ] Segment at address '0x0' has not changed, skipping write
[2024-11-24T08:43:45Z INFO ] Segment at address '0x8000' has not changed, skipping write
[2024-11-24T08:43:46Z INFO ] Segment at address '0x10000' has not changed, skipping write
[2024-11-24T08:43:46Z INFO ] Flashing has completed!
Commands:
    CTRL+R    Reset chip
    CTRL+C    Exit

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)

How to Install the influxDB and Configure the Dashboard

1. Download influxDB and Install.

bash
$ wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.7.0-amd64.deb
$ sudo dpkg -i influxdb2-2.7.0-amd64.deb
$ sudo service influxdb start

2. Configure the influxDB

text
Connect to the 'http://<influxDB installed PC Address>:8086'

Click GET STARTED and set Username, Password, Initial Organization Name, and Initial Bucket Name

TermValue
UsernameSet login username as influxDB administrator web console
PasswordSet login password as influxDB administrator web console
Initial Organization NameOrganization Name ex. ORG
Initial Bucket NameLOGGER

After set them, click CONTINUE.

3. Copy the operator API token.

You can see the operator API token on the browser. YOU WON'T BE ABLE TO SEE IT AGAIN! If you want to get new API token, click API Tokens menu form Sources Icon, then click GENERATE API TOKEN and select All access token, click Save. You can see a new API token and get it. After copy the token, click CONFIGURE LATER.

4. Import the Dashboard Template.

Click the Dashboard icon, and select Import Dashboard from the CREATE DASHBOARD menu.

Drop the influxdb/electric_load.json file to Drop a file here, then click IMPORT JSON AS DASHBOARD.

You can see the ELECTRIC LOAD pannel on the Dashboards page.

Click this panel, and You can see the dashboard.

If you want to customize the dashboard design, click configure mark. You can change the graph design.

Schematic, PCB Gabar Data

There is a Schematic data in hardware directory. If you want to make the PCB, you can order the PCBway this link. The heat sink is not included in the schematic data. You can use the heat sink with the fan for LGA115x CPU Cooler.

I used this heat sink

I guess another heat sink is also good.

This PCB is designed by Kicad. This board image photo is shown the jumper wire. But, the PCB data is already fixed the error.

UPDATE 2024-12-29: I changed the OpAmp from TSB6111ILT to OPA187IDBVR. OPA187IDBVR is a low noise and low offset voltage OpAmp. It can be used for the high precision control.

Changelog

v0.1.2

  • PID Control Enhancement: Improved PID controller performance for better current regulation and stability.
  • Under Voltage Protection: Added under_voltage_limit configuration parameter. When the voltage drops below this threshold, the PID controller is reset to prevent inrush current during startup or low voltage conditions.
  • Overcurrent Protection: Implemented overcurrent protection using max_current_limit_ratio parameter. When the actual current exceeds the set current multiplied by this ratio, the PID controller is reset and output is set to zero to protect against excessive current flow.
  • Inrush Current Suppression: These protection mechanisms work together to suppress inrush current during startup and abnormal conditions, ensuring safer operation.

Note: After updating to v0.1.2, it is necessary to reconfigure the cfg.toml file to include the new parameters. Some PID parameters are changed, so please update them accordingly.

v0.1.1

  • NVS Configuration Persistence: Added functionality to save the last load current setting to NVS (Non-Volatile Storage) and restore it on the next startup. This allows the device to remember the previous current setting even after power cycles or resets.
  • ESP-IDF Update: Updated ESP-IDF from v5.2.1 to v5.4.2 for improved stability and latest features.
  • WiFi Reconnection Enhancement: Added automatic WiFi reconnection functionality to maintain network connectivity during temporary disconnections.
  • Voltage Measurement Correction: Fixed bus voltage resolution from 193.3125µV to 195.3125µV for more accurate voltage measurements.

LICENSE

This source code is licensed under MIT. Other Hardware Schematic documents are licensed under CC-BY-SA V4.0.

Parts

96
QtyValueFootprintReferences
1210KResistor_SMD:R_0603_1608MetricR201, R205, R206, R301, R302, R305, R402, R403, R404, R502, R503, R505
110.1uFCapacitor_SMD:C_0603_1608MetricC201, C202, C205, C301, C302, C404, C405, C408, C410, C501, C502
510uFCapacitor_SMD:C_0805_2012MetricC203, C206, C208, C401, C403
5GNDTestPoint:TestPoint_Pad_D1.0mmTP405, TP406, TP407, TP408, TP409
310K 1%Resistor_SMD:R_0603_1608MetricR204, R401, R410
31K 1%Resistor_SMD:R_0603_1608MetricR405, R411, R412
31uFCapacitor_SMD:C_0805_2012MetricC204, C402, C406
2100Resistor_SMD:R_0603_1608MetricR407, R504
210mLibrary:R_10mOHMR408, R409
2150RResistor_SMD:R_0603_1608MetricR303, R304
2Screw_Terminal_3PLibrary:TB112-2-2-3-E-1 Terminal BlockJ401, J402
2TSB611ILTPackage_TO_SOT_SMD:SOT-23-5U401, U404
1+12VTestPoint:TestPoint_Pad_D1.0mmTP203
1+3.3VTestPoint:TestPoint_Pad_D1.0mmTP201
11000pFCapacitor_SMD:C_0603_1608MetricC409
11KResistor_SMD:R_0603_1608MetricR202
11kResistor_SMD:R_0603_1608MetricR501
12.2uFCapacitor_SMD:C_0805_2012MetricC207
12K 1%Resistor_SMD:R_0603_1608MetricR406
12N7002KPackage_TO_SOT_SMD:SOT-23Q501
13.5x2.6 Tact SWLibrary:WS-TASV SMT Tact SwitchSW301
14.7uFCapacitor_SMD:C_0805_2012MetricC407
14PIN FANCTLConnector:FanPinHeader_1x04_P2.54mm_VerticalJ501
175K 1%Resistor_SMD:R_0603_1608MetricR203
1BOOTTestPoint:TestPoint_Pad_D1.0mmTP302
1CH224KLibrary:ESSOP-10_3.9x4.9mm_P1.00mmU202
1ESP32-S3-WROOM-1-N16R8Library:ESP32-S3-WROOM-1_EXPU301
1FingerTouchPadLibrary:FingerTouchPad_34x35mmJ301
1GNDLibrary:TestPoint_Pad_3.2x1.6mmTP-PAD401
1INA228Package_SO:VSSOP-10_3x3mm_P0.5mmU402
1IRF530Package_TO_SOT_THT:TO-220-3_Horizontal_TabUpQ401
1IRF7606PBFPackage_SO:MSOP-8_3x3mm_P0.65mmQ201
1LD1117S33TRPackage_TO_SOT_SMD:SOT-223-3_TabPin2U201
1LM35-NEBPackage_TO_SOT_THT:TO-220-3_Horizontal_TabDownU403
1MBR3060FCTPackage_TO_SOT_THT:TO-220-3_Horizontal_TabUpD401
1MH2029-601YInductor_SMD:L_0805_2012MetricFB201
1OP-VCCTestPoint:TestPoint_Pad_D1.0mmTP404
1PWMTestPoint:TestPoint_Pad_D1.0mmTP401
1RESETTestPoint:TestPoint_Pad_D1.0mmTP301
1SET-VrTestPoint:TestPoint_Pad_D1.0mmTP402
1SPX3819M5-LPackage_TO_SOT_SMD:SOT-23-5U203
1SSD1331_DISPLAYLibrary:OLED SSD1331 SPI DISPLAYU302
1SSM3J332RPackage_TO_SOT_SMD:SOT-23Q502
1SolderJumper_2_OpenJumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP401
1USB4105-GF-ALibrary:USB_C_5077CR-16-SMC2-BK-TRJ201
1VBUSTestPoint:TestPoint_Pad_D1.0mmTP202
1VfbTestPoint:TestPoint_Pad_D1.0mmTP403
1VgsTestPoint:TestPoint_Pad_D1.0mmTP410

The 88 most common of 96 parts.

Questions

How big is the Mosfetload PCB?

It measures 185 × 98 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Mosfetload use?

96 parts, built around the ESP32-S3-WROOM-1-N16R8, TSB611ILT, CH224K and LD1117S33TR(MS). 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 Mosfetload KiCad files?

From the hnz1102/electricload repository on GitHub, at the commit this page was made from: the board is hardware/mosfetload.kicad_pcb and its schematic hardware/esp32_cont.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Mosfetload design in my own project?

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

Similar boards

  • 2 layers122.2 × 122.8 mmDcpower, the printed circuit board in 3D

    Dcpower

    hnz1102/dcpower

    DC Power Unit for Breadboard based on ESP32-S3 microcontroller and AP33772S USB Power Delivery (PD) Sink Controller.

    115 parts1
  • 2 layers139 × 64 mmEEW display, the printed circuit board in 3D

    EEW display

    hnz1102/EEW-display

    ESP32-S3 firmware for a small earthquake-information display. It shows recent earthquakes and emergency earthquake warnings (緊急地震速報, EEW) from [P2P地震情報](https://www.p2pquake.net/), draws the epicenters on a Google map…

    47 parts
  • 2 layers30 × 43 mmCurrentmeter, the printed circuit board in 3D

    Currentmeter

    hnz1102/mini-current-meter

    Mini Current Meter using INA228A ultra-precise digital power monitor

    40 parts10
  • 2 layers40 × 60 mmWakepc, the printed circuit board in 3D

    Wakepc

    hnz1102/wakepcbox

    Wake on LAN Controller Box

    45 parts4
  • 2 layers93 × 50 mmSsh bridge for raspberrypi, the printed circuit board in 3D

    Ssh bridge for raspberrypi

    hnz1102/ssh-serial-bridge

    Firmware for the ESP32-S3 that bridges an SSH connection (over Wi-Fi) to UART and USB CDC serial ports. Written in Rust (esp-idf-hal / esp-idf-svc) with a C component (wolfSSH) for the SSH server.

    37 parts3
  • 2 layers46 × 54 mmMini power, the printed circuit board in 3D

    Mini power

    hnz1102/mini-power

    Mini-Power is a small, portable DC power supply unit designed to provide a convenient and reliable source of adjustable voltage for your electronic devices and breadboard experiments.

    52 parts3
  • 2 layers68.3 × 57.7 mmSdmux4, the printed circuit board in 3D

    Sdmux4

    hnz1102/sdcdmux-emmc

    SD CARD and eMMC Device Multiplexer with Infrared Remote Controller

    115 parts16MIT