Skip to content

AtifUsmani/dp50v5a-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DP50V5A-API

Turn a DP50V5A / DPS5005 programmable power supply into a network-connected instrument using an ESP32.

This project provides:

  • REST API
  • Web Interface
  • mDNS support (http://psu.local)
  • Logging
  • Preset Control
  • OVP / OCP / OPP Control
  • Front Panel Lock Control
  • Raw Register Access

No modification of the original RuiDeng firmware is required.

Image 1 Image 2 Image 3 Image 4


Features

PSU Control

  • Set Voltage
  • Set Current
  • Set Voltage + Current
  • Output On / Off
  • Preset Recall

Monitoring

  • Output Voltage
  • Output Current
  • Output Power
  • Input Voltage
  • CV / CC Status
  • Protection Status

Protection

  • OVP
  • OCP
  • OPP

Device Management

  • Brightness Control
  • Front Panel Lock / Unlock
  • mDNS (psu.local)

Logging

  • Start Logging
  • Stop Logging
  • Clear Logs
  • Export CSV

Advanced

  • Raw Register Read
  • Raw Register Write

Why?

Existing solutions typically require replacing the original RuiDeng firmware.

This project keeps the factory firmware intact and adds a network API using an ESP32.

No ST-Link. No firmware replacement. No risk of bricking the PSU.

Hardware Setup

Required Components

  • DP50V5A or DPS5005
  • ESP32
  • 3 jumper wires

Accessing the UART Interface

The DP50V5A does not officially expose its UART interface externally. The UART pads are located on the display board inside the enclosure.

Disassembly

  1. Remove power from the DP50V5A.
  2. Release the four plastic retaining clips on the enclosure.
  3. Slide the module out of the case.
  4. Pull off the rotary encoder knob.
  5. Remove the front faceplate.

UART Pins

With the faceplate removed, locate the four pads directly above the rotary encoder.

They are labeled:

V  R  T  G

Pin definitions:

Label Function
V +V
R RX
T TX
G GND

ESP32 Wiring

Connect the UART interface to the ESP32 as follows:

DP50V5A ESP32
T (TX) GPIO16 (RX2)
R (RX) GPIO17 (TX2)
G (GND) GND

Wiring Diagram

ESP32                     DP50V5A

GPIO17 (TX)  -----------> RX

GPIO16 (RX)  <----------- TX

GND          ----------- GND

Firmware Defaults

HardwareSerial PSU(2);

PSU.begin(
    9600,
    SERIAL_8N1,
    16, // RX
    17  // TX
);

UART configuration:

9600 baud
8 data bits
No parity
1 stop bit

Reassembly

  1. Solder wires to the UART pads.
  2. Route the wires out of the enclosure.
  3. Reinstall the faceplate.
  4. Reinstall the rotary encoder knob.
  5. Slide the module back into the enclosure until all four retaining clips engage.

Notes

  • The ESP32 and DP50V5A must share a common ground.
  • Communication uses Modbus RTU over UART.
  • The original RuiDeng firmware remains completely stock.
  • No ST-Link, SWD access, or firmware replacement is required.

Quick Start

  1. Clone repository
git clone https://github.com/AtifUsmani/dp50v5a-api.git
  1. Configure WiFi credentials

  2. Build and flash firmware

pio run
pio run -t upload
  1. Upload web interface
pio run -t uploadfs
  1. Open:
http://psu.local

or

http://<ESP32-IP>

Architecture

DP50V5A
    │
    │ UART (9600 baud)
    │
    ▼
ESP32
    │
    │ HTTP REST API
    │
    ▼
Web UI / Scripts / Home Assistant / Docker Apps

Example API Usage

Read status:

curl http://psu.local/api/status

Set voltage:

curl "http://psu.local/api/voltage?value=12"

Set current:

curl "http://psu.local/api/current?value=2"

Enable output:

curl "http://psu.local/api/output?state=1"

Set voltage and current:

curl "http://psu.local/api/setvi?voltage=12&current=2"

API Documentation

Full API Documentation


Protocol Documentation

The protocol documentation used during development can be found in:

  • docs/DPS5005_CNC_Communication_Protocol_V1.2.pdf

The project uses Modbus RTU over UART and includes reverse-engineered register mappings.


Design Notes

The DP50V5A communication interface is sensitive to concurrent UART access.

All PSU communication is serialized through a mutex to prevent:

  • Corrupted Modbus packets
  • Timeouts
  • PSU lockups
  • Concurrent read/write collisions

This architecture was developed through extensive testing on real hardware.


License

MIT License

About

REST API and web interface for DP50V5A/DPS5005 power supplies using ESP32

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages