A cross-platform suite of applications for controlling the aTorch DL24P electronic load and analyzing battery test data with professional visualization.
This project includes two applications:
- Test Bench - Real-time device control and data acquisition
- Test Viewer - Offline analysis and comparison of saved test data
Both applications are designed for battery testing, characterization, and quality control with publication-quality plots and comprehensive data export.
Device Control:
- USB HID connection (no serial adapter needed)
- Real-time plotting with auto-scaling
- Live monitoring of voltage, current, power, temperature, capacity, and energy
- Four load modes: Constant Current (CC), Constant Power (CP), Constant Voltage (CV), Constant Resistance (CR)
Test Panels:
- Battery Capacity - Discharge tests with voltage cutoff and time limits
- Battery Load - Load curve characterization (current/power/resistance sweep)
- Battery Charger - Charger output characterization
- Charger Load - AC adapter load testing
- Power Bank Capacity - Power bank capacity and efficiency testing
Data Management:
- SQLite database for permanent storage
- Auto-save to JSON with test metadata
- Export to CSV, JSON, or Excel
- Database management tools (statistics, purge)
- Session state persistence across restarts
Battery Presets:
- 30+ camera battery presets (Canon, Nikon, Lumix, Leica, etc.)
- Household battery presets (Eneloop, 18650, etc.)
- User-defined custom presets
- Manufactured date tracking
Automation:
- Configurable test profiles
- Voltage cutoff detection
- Time-based tests
- Progress tracking with capacity estimation
- Alert notifications
Analysis Features:
- Multi-file comparison with checkbox selection
- Publication-quality matplotlib + seaborn plots
- Independent rendering per test type
- Color-coded datasets with legend
- X-axis selection (Time, Current, Power, Load R, Capacity, Energy)
- Y-axis auto-scaling with nice multiples (1, 2, 5, 10)
Data Organization:
- Automatic file discovery and categorization
- Filter by test type (Battery Capacity, Battery Load, etc.)
- Sort by date, manufacturer, name, capacity
- Display manufactured date and test conditions
- JSON and raw data viewers
File Management:
- Auto-reload when files change
- Preserve checkbox states across refreshes
- Date timestamps for test grouping
- Delete tests directly from viewer
Coming soon
- Python 3.10+
- Operating System: Windows, macOS, or Linux
- Hardware: aTorch DL24P electronic load (VID=0x0483, PID=0x5750)
- Power connector: Forspzde SV5.5-5, #10 M5, 12-10 AWG (fork pitch ~7mm, terminal width ~2mm per tab)
- Each blade is equivalent to a 2.8mm spade terminal
- Note: SV5.5-5 is a cable cross-section rating, not a lug dimension — verify actual lug dimensions before ordering
- Power connector: Forspzde SV5.5-5, #10 M5, 12-10 AWG (fork pitch ~7mm, terminal width ~2mm per tab)
-
Clone the repository:
git clone https://github.com/nevetssf/aTorch-DL24P.git cd aTorch-DL24P -
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Run the main application:
python -m load_test_bench.mainmacOS: First-Time Setup After Power Cycle
After power-cycling the DL24P, macOS requires a one-time initialization step before the app can communicate with the device. This is because macOS's HID driver uses SET_REPORT control transfers, while the DL24P firmware needs interrupt OUT transfers for its initialization sequence.
# Install libusb (one-time)
brew install libusb
pip install pyusb
# Run after each device power cycle (requires sudo for USB endpoint access)
sudo DYLD_LIBRARY_PATH=/opt/homebrew/lib .venv/bin/python usb_prepare.pyThis sends the SET_IDLE HID class request and initialization sequence that Windows sends automatically during USB enumeration. You only need to run this once after power-cycling the device — the device retains its initialized state across USB disconnects.
USB Connection Note (Apple Silicon Macs): The DL24P may not be detected when plugged directly into a Thunderbolt port. Connect it through a USB hub or dock's USB-A port instead — the hub handles the USB 2.0 speed negotiation the device requires.
Quick Start:
- Connect your DL24P via USB (through a hub on Apple Silicon Macs — see note above)
- On macOS, run
usb_prepare.pyif the device was power-cycled (see above) - Select "USB HID" connection type and click "Connect"
- Choose a test panel (Battery Capacity, Battery Load, etc.)
- Configure test parameters
- Click "Start Test"
- Data is automatically saved to
~/.atorch/tests.dband JSON files
Battery Capacity Test:
- Select a battery preset or enter specs manually
- Set discharge current (CC mode)
- Set voltage cutoff (e.g., 3.0V for Li-Ion)
- Optionally enable time limit
- Click "Start Test"
- Test stops automatically at cutoff voltage
Battery Load Test:
- Configure load sweep (current, power, or resistance)
- Set starting value, increment, and steps
- Set dwell time per step
- Click "Start Test"
- Creates a load curve showing voltage vs. load
Run the viewer:
python -m load_test_bench.viewerQuick Start:
- Application auto-loads test files from
~/.atorch/test_data/ - Switch between test type tabs (Battery Capacity, Battery Load, etc.)
- Check boxes to select datasets for comparison
- Choose X-axis parameter (Time, Current, Power, etc.)
- Toggle Y-axis parameters (Voltage, Current, etc.)
- Click color buttons to change dataset colors
- View raw JSON or delete tests using buttons
Create standalone executables for distribution:
python build.py
# Creates: dist/Load Test Bench.exepython build.py
# Creates: dist/Load Test Bench.appThe build script automatically:
- Bundles all dependencies
- Includes battery presets and resources
- Creates platform-specific icons
- Generates single-file executables
All user data is stored in the platform data directory:
- macOS:
~/Library/Application Support/Load Test Bench/ - Windows:
%APPDATA%\Load Test Bench\ - Linux:
~/.local/share/Load Test Bench/
Contents:
tests.db- SQLite database (permanent storage)test_data/- Auto-saved JSON test resultssessions/- Panel state files (restored on restart)presets/- User-saved presets (battery, test, etc.)
load-test-bench/
├── load_test_bench/
│ ├── protocol/ # Device communication (USB HID, serial)
│ ├── gui/ # Test Bench GUI panels
│ ├── viewer/ # Test Viewer application
│ ├── data/ # Database and export
│ ├── automation/ # Test profiles and runner
│ └── alerts/ # Notifications
├── tests/ # Unit tests (118 tests)
├── resources/ # Battery presets, icons
│ ├── battery_capacity/ # Camera and household battery presets
│ ├── power_bank/ # Power bank presets
│ └── icons/ # Application icons
├── build.py # PyInstaller build script
└── run_load_test_bench.py # Launcher for frozen builds
Run the test suite:
pytest # Run all tests
pytest -v # Verbose output
pytest tests/test_protocol.py # Specific test fileTest Coverage: 118 tests across 6 test files:
- Protocol encoding/decoding
- Database operations
- Test profiles and serialization
- Alert conditions
- CSV/JSON export
- PX100 protocol (legacy)
This application is fully cross-platform:
- GUI: PySide6 (Qt) - native look and feel on all platforms
- Plots: pyqtgraph, matplotlib, seaborn - cross-platform rendering
- USB Communication: hidapi - Windows/macOS/Linux support
- Database: SQLite - built into Python
- File Paths: pathlib - platform-independent
Tested on:
- macOS (Darwin 25.2.0)
- Windows 10/11
- Linux (Ubuntu 22.04+)
See TODO.md for items being worked on.
Current Limitations:
- macOS power-cycle initialization: After power-cycling the DL24P, run
usb_prepare.pyonce before using the app (see Quick Start above). This is not needed on Windows, where the OS sends the required HID class requests automatically during USB enumeration. - Bluetooth/serial connection not fully functional (use USB HID instead)
- Device timing readout may need calibration
- Some device commands may not work over USB HID (e.g., Reset Counters)
- CLAUDE.md - Development guide and architecture documentation
- TODO.md - Roadmap and known issues
- Protocol Documentation: https://www.improwis.com/projects/sw_dl24/
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file for details
- GUI Framework: PySide6 (Qt for Python)
- Real-time Plotting: pyqtgraph
- Publication Plots: matplotlib + seaborn
- USB HID Support: hidapi
- Serial Communication: pyserial
- Data Analysis: pandas + numpy
- Protocol Documentation: Improwis DL24 Project
For issues, questions, or feature requests, please open an issue on GitHub: https://github.com/nevetssf/aTorch-DL24P/issues
Built with ❤️ for battery enthusiasts, engineers, and makers