Skip to the content.

BK1788-Python — control the B&K Precision 1788B power supply from Python

Python GUI and library to control and monitor the B&K Precision 1788B (32 V / 6 A) programmable DC power supply via its TTL serial interface (IT-E131 adapter or a 5 V USB-TTL adapter). Live graphs for voltage, current and power, setpoints, output and remote mode, auto-reconnect.

License Python Interface Release

Quickstart

Windows, no Python needed: download BK1788B-Steuerung-windows.zip from Releases, unzip, run BK1788B-Steuerung.exe.

From source (Windows, Linux, macOS):

git clone https://github.com/feiglein74/BK1788-Python.git
cd BK1788-Python
pip install -r requirements.txt
python gui_app.py

As a library:

from bk1788b import BK1788B

psu = BK1788B(port='COM3', baudrate=4800)
if psu.connect():
    psu.set_remote_mode(True)      # required, otherwise set commands are rejected (0xB0)
    psu.set_voltage(12.0)
    psu.set_current(1.5)
    psu.set_output(True)
    print(psu.read_status())       # actual V/A, setpoints, CV/CC mode, temperature, fan
    psu.disconnect()

Key facts

Detailed documentation is in German (except the protocol reference, which is in English).


BK Precision 1788B - Python Steuerung mit GUI

Vollständige Python-Anwendung zur Steuerung und Überwachung des BK Precision 1788B Netzteils (0-32V, 0-6A) über RS-232/TTL.

Features

Hardware-Anforderungen

⚠️ WICHTIG: Das BK1788B verwendet TTL-Pegel (0-5V), NICHT RS-232 (±12V)!

Empfohlene Adapter

Pinbelegung DB9

USB-TTL Adapter          BK 1788B (DB9)
-----------------        --------------
TX (MOSI)       ──────>  Pin 2 (RX)
RX (MISO)       <──────  Pin 3 (TX)
GND             ──────   Pin 5 (GND)

Kommunikationsparameter

⚠️ Baudrate am Netzteil prüfen: MENU > BAUDRATE

Installation

Windows ohne Python: BK1788B-Steuerung-windows.zip unter Releases herunterladen, entpacken, BK1788B-Steuerung.exe starten.

Aus dem Quellcode:

1. Repository klonen oder Dateien herunterladen

cd BK1788-Python

2. Virtuelle Umgebung erstellen (empfohlen)

python -m venv venv

3. Virtuelle Umgebung aktivieren

Windows:

venv\Scripts\activate

Linux/Mac:

source venv/bin/activate

4. Abhängigkeiten installieren

pip install -r requirements.txt

Verwendung

GUI-Anwendung starten

python gui_app.py

Basis-Modul (nur Kommunikation)

from bk1788b import BK1788B

# Netzteil initialisieren
psu = BK1788B(port='COM3', baudrate=4800)

# Verbinden
if psu.connect():
    # Remote-Modus aktivieren
    psu.set_remote_mode(True)

    # Spannung setzen (12.5V)
    psu.set_voltage(12.5)

    # Strombegrenzung setzen (1.5A)
    psu.set_current(1.5)

    # Ausgang einschalten
    psu.set_output(True)

    # Status lesen
    status = psu.read_status()
    print(f"Spannung: {status['actual_voltage']:.3f}V")
    print(f"Strom: {status['actual_current']:.3f}A")
    print(f"Modus: {status['mode']}")

    # Ausgang ausschalten
    psu.set_output(False)

    # Trennen
    psu.disconnect()

GUI-Bedienung

Verbindungsbereich

  1. COM-Port eingeben (z.B. COM3)
  2. Baudrate wählen (Standard: 4800)
  3. Verbinden klicken

Steuerung

Anzeige

Live-Graphen

Dateistruktur

BK1788-Python/
├── bk1788b.py                          # Basis-Kommunikationsmodul
├── gui_app.py                          # Hauptanwendung mit GUI
├── unlock_netzteil.py                  # Remote-Modus abschalten (Frontpanel entsperren)
├── __version__.py                      # Versionsnummer
├── BK1788B.spec                        # PyInstaller-Build (Windows-EXE)
├── requirements.txt                    # Python-Abhängigkeiten
├── BK1788B_Protocol_Documentation.md   # Vollständige Protokolldokumentation (englisch)
├── KOMMUNIKATION_BESONDERHEITEN.md     # Fallstricke der seriellen Kommunikation
├── REPARATUR_MESSPLAN.md               # Mess-/Diagnoseplan „hängt in CC, 0 V“
├── CHANGELOG.md                        # Änderungshistorie
├── README.md                           # Diese Datei
└── CLAUDE.md                           # Entwickler-Dokumentation

Hersteller-Dokumentation (nicht im Repo enthalten)

Das offizielle Instruction Manual und der Schaltplan sind urheberrechtlich geschützt (© B&K Precision) und werden hier nicht mitgeliefert (per .gitignore ausgeschlossen). Bezugsquellen:

Dokument Bezugsquelle
Instruction Manual 1788B Offizielle B&K-Precision-Website → Produktseite 1788B → Downloads
Schaltplan 1785B/1788 EEVblog-Repair-Thread zum 1785B/1788 (von B&K an Kunden herausgegeben)

Reparatur-/Messhinweise auf Basis des Schaltplans (eigene Analyse) stehen in REPARATUR_MESSPLAN.md.

Technische Details

Protokoll

Wichtige Kommandos

Monitoring

Fehlerbehebung

Problem: Keine Verbindung

Lösung:

Lösung:

Problem: Checksummen-Fehler

Lösung:

Sicherheitshinweise

⚠️ Vor Verwendung beachten:

Lizenz

MIT. Das Projekt basiert auf Protokoll-Analyse und Field-Testing am BK1788B. B&K Precision ist eine Marke der B&K Precision Corporation; dieses Projekt ist nicht mit dem Hersteller verbunden.

Support

Credits

Entwickelt basierend auf Protokoll-Analyse und Field-Testing mit Bus Pirate 6XL.

Version: siehe CHANGELOG.md Status: Getestet und funktionsfähig