I invented a relay board with USB interface again

July 25, 2025

WCH (Nanjing QinHeng Corp.) has recently launched a CH55x family of microcontrollers based on an 8-bit C51 core with a USB interface, and I/Os. The boards all come with different I/Os configuration depending on the selected part number.

This tiny, low-cost USB board has 1x USB type-B port, onboard power led, LED (P3.0). One advantage peculiar to the board is that its microcontroller unit (MCU) supports USB to TTL conversion of the shell without the aid of an external converter as compared to some other development boards.

Below are some of the specifications of the CH551G:

  • MCU – WCH CH551 8-bit C51 micro-controllerSpeed
  • 24 MhzMemory
  • 10Kb of ROM and 512b of xRAMUSB
  • 1x USB type-A port (USB 2.0 + 1.0)
  • GPIO – 18
  • Others
    • On-board power led
    • 3x Timer
    • 2x PWM
    • 1x SPI M/S
    • 6x Touch
    • 1x HS UART
    • Power – 5V through USB or I/O pin

Why I invented this board again

I planned to hire a freelance to finish my side project, but it's stick to a specific hardware and it's only available in my country. There is no way to control the board with only remote desktop. It needs to push a button, slide a switch and hold the flash button when entering bootloader.

Ofcourse I can't send that kit to his country, the delivery price costs an arm and leg and not affordable to my budget that time. I stopped hiring him and checked on E-commerce platforms and there were some boards could fit my needs, i.e control over usb, has an application to control... but.

Yeah, the price, it fits with a extravagant dinner with my wife as well. How could it possible? It's just a USB port, an MCU with USB interface inside and 4 relays, the hardware cost's only 25.000 VND ~ 1 USB.

But they sell it with a price 140.000 VND. Another disavantage is that they doesn't public the software, which should be downloaded easily. Relay On command - price on shop

I decided to create my own thing, goals here is that: the cost is less than 25.000 VND, CH551 is a good choice for starting a project. I have hundred chips from last projects, so I want to make use of it.

Addition feature for the existing on the market

  • Power isolation from relays and USB port.
  • I can control with my application.
  • The price is affordable, and it's cheaper than most options on the market.

Another purpose is to make up my repository, I need to have some side project, just for case I seek a new job in the future.

Hardware design

I choose EasyEDA, which is an online platform for desinging PCB. It doesn't need to find the right footprint, 3D library... Everything is all-in-one place, when finishing a design I could send it to order a PCB with one click. It's a good choice for saving time.

This is the schematic, I had designed for 2 days and it works fine now for me.

Bill of Meterials:

  • CH551G
  • TLP291 - opto for signal isolation from MCU to trigger the relay.
  • HK4100F - relay 5VDC with NC/NO/CM pins.
  • B0505S - isolation power supply.
  • Two leds: PWR and Relay On.
  • USB-B - I use USB type B for easily connection.

Schematic

How to control this board

I use the existing tool from the internet, it just sends two raw USB packet to EndPoint0 and use one byte to control the output of a relay.

Relay On command

Relay On command

Project on gitHub

This is the repository link on gitHub I hope you can Star and subsribe to my project.

Conclusion

I don't post the detail design in this post, it could be another article since I'm too tired for a long working day now.

The cost for this board around 35.000 VND for me, I already add the PCB cost to the final price. It's affordable for me rather than buy the board on an online e-commerce with no support and no tool for controlling it.