Close
0%
0%

WiFi control of a XY-SK120 bench power supply

I got tired of using the tiny buttons and knob so I put my XY-SK120 under PC control

Similar projects worth following
A journey towards getting a PC controlled bench power supply in several steps

I bought this bench power supply that can be powered by an old laptop brick and assembled it.

Although everything can be controlled from the front panel it's fiddly and turning the knob for large changes of parameters gets old quickly. So I bought an add-on WiFi control module that goes into the case. But I found that the factory supplied firmware is horrible because it relies on connecting to a server in the cloud to control the module. This was unacceptable.

So I researched and found the toolchain that would let me build the firmware I needed. Fortunately the module uses standard Modbus protocol to talk to the power supply circuit. I was able to build new firmware and replace the factory firmware.

  • Building the XY-WFPOW firmware

    Ken Yap • 09/12/2026 at 12:17 • 0 comments

    Getting ahead of myself here by showing that I have succeeded in monitoring the power supply from a web browser on my PC.

    So after a lot of procrastination I decided to build the firmware for the XY-WFPOW controller that connects to the XY-SK120 by serial interface to control it. As mentioned in the previous log, this is a tiny module that's larger than life-size in the photo. Instead of the XY-WFPOW Github project I found previously, I found a more complete one at Sinilink modules Github project. Now comparing the XY-SK120 and the XY5008, the latter is a more powerful controller that handles higher voltage and current. What I'm counting on is that the Modbus commands of the XY5008 are usable for the XY-SK150, perhaps a few might be unimplemented.

    So I took the YAML file that specifies the features to be included in the firmware for the XY-5008 and modified as below:

    --- sinilink-modbus.yaml.orig   2026-09-10 10:39:49.504872773 +1000
    +++ xy_sk120-modbus.yaml        2026-09-10 21:00:06.541073980 +1000
    @@ -1,18 +1,18 @@
     substitutions:
       # Change this model to fit your particular one.
       # You can find it in Home Assistant as the device diagnostic "Model Name".
    -  model: "XY5008"
    -  device_name: "xy5008-controller"
    -  device_friendly_name: "sinilink-XY5008"
    +  model: "XY_SK120"
    +  device_name: "xy-sk120-controller"
    +  device_friendly_name: "XY-SK120"
       device_description: "Power Supply"
       
       # Model specific settings (Don't change these!)
    -  XY5008_voltage_maximum: "50"
    -  XY5008_voltage_accuracy: "2"
    -  XY5008_voltage_multiplier: "0.01"
    -  XY5008_current_maximum: "8"
    -  XY5008_current_accuracy: "3"
    -  XY5008_current_multiplier: "0.001"
    +  XY_SK120_voltage_maximum: "36"
    +  XY_SK120_voltage_accuracy: "2"
    +  XY_SK120_voltage_multiplier: "0.01"
    +  XY_SK120_current_maximum: "6"
    +  XY_SK120_current_accuracy: "3"
    +  XY_SK120_current_multiplier: "0.001"
     
     globals:
        - id:   vin_undervoltage_theshold
    @@ -26,7 +26,7 @@
       comment: $device_description
       name_add_mac_suffix: false
       project:
    -    name: "sinilink.xy5008-controller"
    +    name: "sinilink.xy-sk120-controller"
         version: "1.0.0"
     
     esp8266:
    @@ -61,6 +61,7 @@
     
     # Configure WiFi
     wifi:
    +  min_auth_mode: WPA2
       networks:
       - ssid: !secret wifi_ssid1
         password: !secret wifi_password1
    @@ -70,7 +71,7 @@
     
       # Enable fallback hotspot (captive portal) in case wifi connection fails
       ap:
    -    ssid: "XY5008 Fallback Hotspot"
    +    ssid: "XY-SK120 Fallback Hotspot"
         password: ""
     
     text_sensor:

    Mostly name changes, but note the additional line min_auth_mode: WPA2. This is the default for new builds as WPA is weak. Explicitly stating WPA2 avoids a warning during the build. Of course you should also insert your hotspot SSID and login password in the networks: section.

    The steps of building the firmware are:

    1. Edit the YAML file.
    2. Check the configuration with the config command. Fix until no more errors.
    3. Build the download image with the compile command.
    4. Flash the firmware with the run or flash command.

    Because the same command line parameters are passed to the Docker commands, I made a shell script with several links where the name indicates which action is wanted.

    #/bin/sh
    case $0 in
    *config)
            action=config
            ;;
    *compile)
            action=compile
            ;;
    *flash)
            flash='--device=/dev/ttyUSB0 --privileged'
            ;&
    *run)
            action=run
            ;;
    *clean)
            action=clean
            ;;
    *)
            exit 1
            ;;
    esac
    echo Command: docker run -v "${PWD}":/config  -v /home/data/software/uC/esp/esphome:/cache $flash -it esphome/esphome "$action" xy_sk120-modbus.yaml
    exec docker run -v "${PWD}":/config  -v /home/data/software/uC/esp/esphome:/cache $flash $baud -it esphome/esphome "$action" xy_sk120-modbus.yaml

    As you can see the flash action is actually the same as the run action except that a USB to TTL converter is specified. This is only needed for the initial download.

    I had a CH341 USB to TTL dongle for the flashing. However looking at the connectors on the XY-WFPOW module I could see a size issue. The tiny JST connector couldn't take the large Molex pins. There is a row of connector...

    Read more »

  • Getting started with ESPHome

    Ken Yap • 09/12/2026 at 11:12 • 0 comments

    Actually I was led to ESPHome from my other project for a benchtop power supply. I ordered this WiFi module for controlling the power supply. Sure, it's possible to adjust the supply using the knob and buttons but tedious. So I wanted to be able to control it from my computer.

    The module seems to be made by the same manufacturer that made the amplifier for #Playing music remotely with bluetooth. It uses the same phone app: sinilink. However the reviews for the app were very uncomplimentary. There were more 1-star ratings than 5-star ratings. In other words, a piece of s***. I only used the app for setting up the Bluetooth interface so the app didn't bother me.

    Fortunately the MODBUS commands for the power supply are documented, and the WiFi module is just a conduit for the serial commands. There is a ESPHome-Sinilink-XY-WFPOW Github project which interfaces the module to ESPHome.

    So what is ESPHome? In one sentence, it's a framework for building a software system for an IoT system. Sensors and output devices that are based on the ESP family of WiFi enabled MCUs, and some others, notably the RP2040, are supported. You generate firmware for MCU modules by specifying components with a YAML file, and the development software pieces the components together and builds the firmware image. Another great feature is being able to update the firmware Over The Air. This is important when the gadget has been deployed and it's not easy to take it back to the workbench to reprogram the firmware. You can explore the website for more details.

    So I would need to build new firmware to flash into the XY-WFPOW. You can see the pin connector holes at the top of the module in the photo. I'm guessing I need a USB to serial adaptor which I have.

    This extended introduction is just to give the background to the impetus to learn ESPHome. I can foresee that ESPHome will be useful for making ESP module based gadgets even if they work standalone and are not connected to the IoT. For setting up an ESPHome development environment there are various methods.

    First method

    This was by pip install esphome. This downloaded all the required Python modules to $HOME/.local. I used the wizard to construct a YAML specification for the ESP32-WROOM board I have, to get familiar with the process.

    Unfortunately when I tried to compile the project, it failed trying to load uv, which is a package manager, into the Python platformio environment. I did a search for the fix, but many replies to previous questions said give up, use the ESPHome docker image.

    I'm a little biased against container environments such as snap, flatpak, and virtualised machines using VirtualBox, even though I use them when I have to, because of the extra layer of complexity. But in this case I think the problems stem from the Python software ecosystem. It's just got over the transition from Python-2 to Python-3. They are still tinkering and adding features such that at the time of writing the version is up to 3.14 and a lot of Python software require a recent release. They still manage to break backward compatibility, for example, in a recent KiCad problem. So much for stability. And it doesn't help that Linux distros add their own quirks and problems. So reluctantly I opted for:

    Second method

    This involves downloading the docker image for ESPHome. You then run commands from the container to build the firmware and even flash the image, as docker can be given permissions on the host USB ports.

    The first compile took a lot of time to download all the supporting Python modules. It generated images for the firmware, including any content for the data partition. One feature of many ESP modules is they come with data partitions in which one can even put a small filesystem. Low-end MCUs generally have small data partitions, if they do. I discovered that a lot of files owned by root were left behind in my project, due to the privilege I gave it to access the USB port. I think I will just...

    Read more »

  • Assembling the power supply

    Ken Yap • 09/12/2026 at 11:09 • 0 comments

    I ordered a XY-SK120 buck-boost converter with digital controller with LCD screen from Aliexpress. With it I can dial up any desired voltage and use current limiting to forestall damage when first powering up projects. It has many other features. From the specs it's quite an impressive piece of electronics for its small size. Input can be 6-36 VDC and output 0-36 VDC at up to 6 A and it handles up to 120W.

    I chose the cased version. It's more than just the bare converter board with banana sockets in an enclosure. At the back is a cooling fan and a power input panel that takes various sources, including terminal block, barrel socket, some kind of Molex socket, and even USB-3 PD input. A cursory inspection shows that diodes isolate the inputs from each other. These extras account for the higher price.

    The fly in the ointment is poor documentation. It would be nice to know how to operate the UI without trial and error. Not even a slip of paper in the box. But a bit of hunting found an instruction manual online. From the modification date, less than 3 months ago, the firmware is still being improved, and in the future it might be possible to update it using the serial interface.

    Normally one would use a SMPS or an old laptop power brick for the input. I decided to put to use an old school power supply board possibly from an LA30 Decwriter that the board for #Flashing LEDs from old printer electronics came from. In the board pictured below, only one set of bridge rectifiers and one large capacitor are in use. There are actually two independent power supplies on the board. The low voltage one supplies digital logic via a 5 V regulator, one of the large TO-3 cases. I won't be using that half. The high voltage one supplies the electromechanics. The capacitor is a whopping 10000 µF rated for 50 V so lots of margin. Nominal voltage level was probably around 30 V. A 24 VAC appliance transformer that I was given feeds the board.

    For the enclosure I used an old Ryobi timer saved from e-waste. It seems to have been an appendage to unknown industrial equipment. The inside was gutted to fit the PS PCB.

    That such a small controller can provide 6 A is a testament to how much the power density of electronics has increased over the years. (But some reviews mention that the cooling fan may be inadequate at high power levels.) The current is more than the old bulky linear power supply can supply. The fuse on the rectifier board is rated at 2.5 A. The transformer is rated at 1.5 A. (Although at lower output voltage, more current can be supplied, as the converter is switching mode.) Anyway this is enough for my needs for the near future.

    Oops, I forgot to order 4 mm banana plug cables. Next round then. Can't buy everything in the shops all at once. 😉

    Well that takes another tuit off my round tuit list.

    Update 2025-08-25, replaced the feed PSU

    Unfortunately a couple of weeks ago the converter went off in the middle of the night while powering a project.

    Cut to the chase, I replaced the feed PSU with an old laptop brick capable of supplying 85 W @ 19 V so the last two pictures are no longer relevant. And now it's more efficient.

    But this isn't newsworthy except for the steps I took to find the problem. It's an old school step-down transformer feeding a bridge rectifier followed by a whopping big electrolytic capacitor. The voltage on the secondary seemed normal at about 23 VAC. But after the rectifier the voltage under load was 2.5 VDC. No wonder the converter didn't work.

    But what was the faulty part, the connections, the transformer, the rectifier, the capacitor, or the converter? I tried disconnecting components one at a time and found that removing the converter brought the voltage up to about 29 V. Damn, did I have a busted converter? Then I thought to monitor the voltage on the capacitor for a few seconds after powering up. The voltage rose gradually over seconds, not almost instantly. This meant that...

    Read more »

View all 3 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates