Google Chat:---
+86-0755-88291180
sales@spotpear.com
dragon_manager@163.com
tech-support@spotpear.com
zhoujie@spotpear.com
WhatsApp:13246739196
WhatsApp:13424403025
| Parameter | Description |
|---|---|
| Model | ESP32-C6-Relay-1CH-U |
| Microcontroller | ESP32-C6 |
| Wireless communication | 2.4 GHz Wi-Fi 6, Bluetooth 5 (LE) |
| USB interface | Interface type: USB Type-C Supply voltage: 5 V Functions: device power, USB communication, and firmware download |
| Isolated RS485 | Interface type: terminal block Direction control: transmit and receive direction switched automatically via MCU UART hardware flow control Interface protection: TVS, surge, and ESD protection Matching resistor: 120 Ω matching resistor reserved, disconnected by default, can be connected with a jumper cap |
| Relay | Allowed load: 250 V AC or 30 V DC, current not exceeding 10 A Number of relay channels: 1 Contact type: normally open (NO) Isolation type: optocoupler isolation |
| Indicator LEDs | PWR: lights red when the supply voltage is detected Relay: lights when the normally open contact is closed RS485: lights green when sending data and blue when receiving data |
| Terminal power supply | Supply range: DC 5–36 V |
| DC-DC power module | Output voltage: 3.3 V Maximum output current of the module: 3 A Load requirement: loads connected to SH1.0 must account for the power consumed by the on-board circuits |
| Antenna connector | External SMA antenna |
| Enclosure | Rail-mount protective enclosure |
| Dimensions | 91.6 × 23.3 × 58.7 mm |



Read Electrical Safety Precautions for Power and Relays before wiring. Connect the device power to the upper power terminal, and connect the load circuit to the COM and NO terminals at the bottom.


The ESP32-C6-Relay-1CH-U supports Arduino IDE and ESP-IDF development.
Arduino IDE can be used to open, compile, and flash the Arduino examples; for the procedure, see Working with Arduino.
ESP-IDF is Espressif's development framework. For the project configuration, build, and flash method of the relay control example, see Working with ESP-IDF.
The USB Type-C supply voltage is 5 V. DC 5–36 V applies only to the power terminal block. When using the terminal block, confirm that VCC and GND connect to the positive and negative supply respectively.
Install the included SMA antenna. Power the device through USB Type-C or the upper power terminal. For the terminal locations, see Interfaces.
Extension_Enable in WS_Information.h to 1 by default. The example sends to the expansion module at address 0x01, with serial parameters of 9600 baud and 8N1.ESP32-C6-Relay-1CH-U as described in Bluetooth Control steps. Send the two-byte command to the writable characteristic in nRF Connect, and the C6 forwards it to the expansion module over RS485.| Command | Function |
|---|---|
06 01 | Toggle the CH1 relay of the expansion module |
06 09 | Energize all relays of the expansion module |
06 0A | De-energize all relays of the expansion module |
Controlling CH2–CH8 individually requires adding the corresponding command handling to the example. The figures below use the S3 to demonstrate the nRF Connect write operations; when connecting, select the Bluetooth advertising name of the C6.
Open the write interface of the writable characteristic, select the hexadecimal byte mode, and enter 0601.

Click "SEND" to send 06 01, and check whether the CH1 relay state of the expansion module toggles.

After sending 06 0A, check whether all relays of the expansion module are de-energized.

This chapter contains the following sections. Read them as needed.
New to Arduino ESP32 development and looking for a quick start? We have prepared a comprehensive Getting Started Tutorial for you.
Note: This tutorial uses the ESP32-S3-Zero as a reference example, and all hardware code is based on its pinout. Before you start, we recommend checking the pinout of your development board to ensure the pin configuration is correct.
Refer to the Install and Configure the Arduino IDE tutorial to download and install the Arduino IDE and add ESP32 support.
Board installation requirements for the ESP32-C6-Relay-1CH-U
| Board package | Installation requirement | Version |
|---|---|---|
| esp32 by Espressif Systems | Install from the Boards Manager | 4.0.0 |
examples/arduino/libraries into the libraries directory of your Arduino sketchbook.Library installation requirements for the ESP32-C6-Relay-1CH-U
| Library | Description | Bundled version | Installation requirement |
|---|---|---|---|
| ArduinoJson | Parse and generate JSON messages | 7.2.1 | Use the version bundled with the repository |
| PubSubClient | Subscribe to and publish MQTT messages | 2.8 | Use the version bundled with the repository |

Open the .ino file with the same name in the selected example directory under examples/arduino/examples, and modify WS_Information.h as required by the example.
ESP32-C6-Relay-1CH-U example programs
| Example | Basic example description | Configuration before use |
|---|---|---|
MAIN_WIFI_AP | RS485, Bluetooth, and AP web page control | Use the hotspot configured in the example |
MAIN_WIFI_STA | RS485, Bluetooth, and STA web page control | Set the router Wi-Fi SSID and password |
MAIN_WIFI_MQTT | RS485, Bluetooth, and MQTT control | Set the Wi-Fi and MQTT parameters |
MAIN_ALL | RS485, Bluetooth, STA web page, and MQTT control | Set the Wi-Fi and MQTT parameters |
Disconnect the relay load power before flashing, and connect the device with a USB data cable.
Configure the settings as shown in the table below under the "Tools" menu in the Arduino IDE.
| Arduino IDE option | Example repository configuration |
|---|---|
| Board | "ESP32C6 Dev Module" |
| Port | Select the COM port assigned to the device by your computer |
| USB CDC On Boot | "Disabled" |
| Flash Size | "16MB (128Mb)" |
| Partition Scheme | "16M Flash (3MB APP/9.9MB FATFS)" |

Program Description
Notes
MAIN_WIFI_AP.ino. To access the web page, the computer or phone must connect to the device hotspot.Connect an RS485 device to the ESP32-C6-Relay-1CH-U, and send the hexadecimal commands in the table below to control the on-board relay.
| Command | Function |
|---|---|
06 05 00 01 55 00 A2 ED | Toggle the CH1 relay |
06 05 00 FF FF 00 BD BD | Energize the CH1 relay |
06 05 00 FF 00 00 FC 4D | De-energize the CH1 relay |
Hardware connection. With the power off, select a USB-to-RS485 converter. Connect the converter's A+ and B- to the device's A+ and B- respectively, and then power the device.
Software operation.
9600 baud rate, 8 data bits, no parity, and 1 stop bit (8N1).
After sending the corresponding command, watch the Relay indicator LED on the panel.

Connect the device with a Bluetooth debugging tool on your phone (such as nRF Connect). Send one character in text mode, or one byte in hexadecimal mode.
| ASCII | Hex | Function |
|---|---|---|
1 | 0x31 | Toggle the CH1 relay |
9 | 0x39 | Energize the CH1 relay |
0 | 0x30 | De-energize the CH1 relay |
Software Operation
The following images show the general nRF Connect operations. When scanning, select the advertising name of this product, ESP32-C6-Relay-1CH-U. The current IP address of the device is subject to the actual reading.
Scan for and connect to the device, and open the service with UUID 4fafc201-1fb5-459e-8fcc-c5c9c331914b.

Read the characteristic with UUID beb5484a-36e1-4688-b7f5-ea07361b26a8 to obtain the device IP.

Open the write characteristic with UUID beb5483e-36e1-4688-b7f5-ea07361b26a8. Enter 31 in hexadecimal mode.

Click "SEND" and watch the Relay indicator LED. Use 39 to energize the relay and 30 to de-energize it.

For the two-byte commands of the external relay, see RS485 Relay Channel Expansion.
AP mode
Connect to the ESP32-C6-Relay-1CH-U hotspot; the default password is waveshare. If APSSID or APPSK has been changed, use the customized name and password.

Open http://192.168.4.1/ in a browser. On the "Relay Control" page, click "Flipped State" to toggle the relay, or use "Relay On" to energize it or "Relay Off" to de-energize it.

Check the on-board clock on the "RTC Event" page. After setting the date, time, CH1 action, and repeat mode, click "New Event" to add a scheduled task.

This chapter contains the following sections. Read them as needed.
New to ESP32 ESP-IDF development and looking to get started quickly? We have prepared a general Getting Started Tutorial for you.
Please Note: This tutorial uses the ESP32-S3-Zero as a teaching example, and all hardware code is based on its pinout. Before you start, it is recommended that you check the pinout of your development board to ensure the pin configuration is correct.
The following guide uses Windows as an example, demonstrating development using VS Code + the ESP-IDF extension. macOS and Linux users should refer to the official documentation.
The screenshots in this section use ESP-IDF V5.5.2 as an example. When installing, please select the ESP-IDF version that matches your board's example.
Download the installation manager from the ESP-IDF Installation Manager page. This is Espressif's latest cross-platform installer. The following steps demonstrate how to use its offline installation feature.
Click the Offline Installer tab on the page, then select Windows as the operating system and the ESP-IDF version you need (the version shown in the screenshot is for reference only — choose the version that fits your actual needs).

After confirming your selection, click the download button. The browser will automatically download two files: the ESP-IDF Offline Package (.zst) and the ESP-IDF Installer (.exe).

Please wait for both files to finish downloading.
Once the download is complete, double-click to run the ESP-IDF Installer (eim-gui-windows-x64.exe).
The installer will automatically detect if the offline package exists in the same directory. Click Install from archive.

Next, select the installation path. We recommend using the default path. If you need to customize it, ensure the path does not contain Chinese characters or spaces. Click Start installation to proceed.

When you see the following screen, the ESP-IDF installation is successful.

We recommend installing the drivers as well. Click Finish installation, then select Install driver.

Download and install Visual Studio Code.
During installation, it is recommended to check Add "Open with Code" action to Windows Explorer file context menu to facilitate opening project folders quickly.
In VS Code, click the Extensions icon in the Activity Bar on the side (or use the shortcut Ctrl + Shift + X) to open the Extensions view.
Enter ESP-IDF in the search box, locate the ESP-IDF extension, and click Install.

For ESP-IDF extension versions ≥ 2.0, the extension will automatically detect and recognize the ESP-IDF environment installed in the previous steps, requiring no manual configuration.
This example is installed with ESP-IDF v6.1.0; select that version.
Get the repository from ESP32-C6-Relay-1CH-U Example Programs. The ESP-IDF project is located in examples/esp-idf/ESP32-C6-Relay-1CH-U, and the same project supports the following two modes.
| Mode | Basic example description |
|---|---|
| Wi-Fi AP + Web | Default mode. The device creates a Wi-Fi hotspot; a computer or phone joins the hotspot and then controls the relay. |
| Wi-Fi STA + Web | The device connects to a 2.4 GHz router, and a computer or phone on the same LAN controls the relay. |
Hardware Connection
Project Configuration
Enter the project directory in the ESP-IDF terminal. Select the target chip during the initial configuration.
idf.py set-target esp32c6
When using the default AP mode, you can compile directly. To connect to a router or change the hotspot parameters, run idf.py menuconfig and select the network mode under "Component config" > "ESP32-CX-Relay-1CH-U demo configuration" > "Demo mode".
Build, flash, and open the serial log. Replace PORT with the actual port of the device.
idf.py build
idf.py -p PORT flash monitor
AP Mode
Select ESP32-C6-Relay-1CH-U in the Wi-Fi list of the computer or phone. The default hotspot password of the GitHub ESP-IDF example is 12345678.

Open http://192.168.4.1/ in a browser and go to the "Overview" page of Relay Studio.
STA Mode
STA IP= in the serial log. Connect the computer or phone to the same LAN, and open the IP address shown in the log in a browser.Relay Control

Check the RTC time of the device. Click "Schedules" on the left, and then click "Add Schedule".

Select the execution date and time, the relay action, and the repeat rule. For the first verification, choose an execution time later than the current RTC time and set the task to run only once.
After saving, confirm in the list that the task has been added. When the set time arrives, check whether the CH1 output status and the Relay indicator LED match the configured action.
Tasks run according to the device RTC time, and up to 10 tasks can be added. The tasks are cleared after the device restarts.
With the power off, connect the A+ and B- of the USB-to-RS485 converter to the corresponding terminals of the device. After connecting, power the device, set the serial tool to a 9600 baud rate, 8 data bits, no parity, and 1 stop bit (8N1), and send the commands in hexadecimal.
| Operation | Hexadecimal frame |
|---|---|
| Toggle the relay | 06 05 00 01 55 00 A2 ED |
| Energize the relay | 06 05 00 FF FF 00 BD BD |
| De-energize the relay | 06 05 00 FF 00 00 FC 4D |
Watch the Relay indicator LED on the panel after sending. The example echoes the received data back over RS485 unchanged.
You can flash the test firmware to verify the on-board device functions.
0x00 for the merged firmware. For the flashing method of separate images, see ESP-IDF Build and Flash.Before flashing or erasing, disconnect the relay load power. Connect the device through USB Type-C and select ESP32-C6 in the flashing tool. Erasing the Flash clears the existing firmware and configuration.
The following steps apply to the firmware provided on this page.
Download and extract Espressif's official Flash Download Tool (Download)
Run Flash Download Tool and select the options that match the development board's MCU and download interface. The screenshot below uses ESP32-S3 and USB as an example; use the options required by the product's hardware design.

Parameter settings

Wait for flashing to complete (this may take some time; please be patient)
Press the reset button and verify the result

Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Email: services01@spotpear.com