Difference between revisions of "USB Relay PRO"
From Diustou Wiki
Yousimaier17 (talk | contribs) |
Yousimaier17 (talk | contribs) |
||
Line 39: | Line 39: | ||
== Product Specifications == | == Product Specifications == | ||
− | *[[File:USB Relay PRO_3.png| | + | *[[File:USB Relay PRO_3.png|800px]] |
== User Manual == | == User Manual == |
Revision as of 14:34, 22 February 2025
Contents
Product Overview
- The USB relay module integrates a high-performance USB-to-serial converter chip and a robust microcontroller. This design enables users to easily control the on/off state of the relays by sending serial commands from a computer via serial port debugging software. The module is ideal for applications requiring reliable and convenient relay control, such as automation systems, laboratory equipment testing, and DIY projects.
Product Specifications
User Manual
Communication Protocol for Switch Control
- Data 1 — Start Flag (Default: 0xA0)
- Data 2 — Switch Address Code (0x01 represents the first switch channel)
- Data 3 — Operation Data (0x00 indicates OFF, 0x01 indicates ON)
- Data 4 — Checksum (Calculated as Data1 + Data2 + Data3)
- Default baud rate:
- USB: Baud rate adaptive
- UART: 115200bps
Command Instructions
USB Relay PRO (TC, 1, CB, Opto)
- Switch Control Command Instructions (sent in HEX format):
- Open the first USB switch: A0 01 01 A2;
- Close the first USB switch: A0 01 00 A1;
- Open all USB switches: A0 0F 01 B0;
- Close all USB switches: A0 0F 00 AF;
- Query Switch Status (sent in HEX format):
- Status of the first channel: A0 01 02 A3;
- Query all relay statuses: A0 0F 02 B1;
USB Relay PRO (TC, 2, CB, Opto)
- Switch Control Command Instructions (sent in HEX format):
- Open the first USB switch: A0 01 01 A2;
- Close the first USB switch: A0 01 00 A1;
- Open the second USB switch: A0 02 01 A3;
- Close the second USB switch: A0 02 00 A2;
- Open all USB switches: A0 0F 01 B0;
- Close all USB switches: A0 0F 00 AF;
- Query Switch Status (sent in HEX format):
- Status of the first channel: A0 01 02 A3;
- Status of the second channel: A0 02 02 A4;
- Query all relay statuses: A0 0F 02 B1;
USB Relay PRO (TC, 3, CB, Opto)
- Switch Control Command Instructions (sent in HEX format):
- Open the first USB switch: A0 01 01 A2;
- Close the first USB switch: A0 01 00 A1;
- Open the second USB switch: A0 02 01 A3;
- Close the second USB switch: A0 02 00 A2;
- Open the third USB switch: A0 03 01 A4;
- Close the third USB switch: A0 03 00 A3;
- Open all USB switches: A0 0F 01 B0;
- Close all USB switches: A0 0F 00 AF;
- Query Switch Status (sent in HEX format):
- Status of the first channel: A0 01 02 A3;
- Status of the second channel: A0 02 02 A4;
- Status of the third channel: A0 03 02 A5;
- Query all relay statuses: A0 0F 02 B1;
USB Relay PRO (TC, 4, CB, Opto)
- Switch Control Command Instructions (sent in HEX format):
- Open the first USB switch: A0 01 01 A2;
- Close the first USB switch: A0 01 00 A1;
- Open the second USB switch: A0 02 01 A3;
- Close the second USB switch: A0 02 00 A2;
- Open the third USB switch: A0 03 01 A4;
- Close the third USB switch: A0 03 00 A3;
- Open the fourth USB switch: A0 04 01 A5;
- Close the fourth USB switch: A0 04 00 A4;
- Open all USB switches: A0 0F 01 B0;
- Close all USB switches: A0 0F 00 AF;
- Query Switch Status (sent in HEX format):
- Status of the first channel: A0 01 02 A3;
- Status of the second channel: A0 02 02 A4;
- Status of the third channel: A0 03 02 A5;
- Status of the fourth channel: A0 04 02 A6;
- Query all relay statuses: A0 0F 02 B1;
USB Relay PRO (TC, 8, CB, Opto)
- Switch Control Command Instructions (sent in HEX format):
- Open the first USB switch: A0 01 01 A2;
- Close the first USB switch: A0 01 00 A1;
- Open the second USB switch: A0 02 01 A3;
- Close the second USB switch: A0 02 00 A2;
- Open the third USB switch: A0 03 01 A4;
- Close the third USB switch: A0 03 00 A3;
- Open the fourth USB switch: A0 04 01 A5;
- Close the fourth USB switch: A0 04 00 A4;
- Open the fifth USB switch: A0 05 01 A6;
- Close the fifth USB switch: A0 05 00 A5;
- Open the sixth USB switch: A0 06 01 A7;
- Close the sixth USB switch: A0 06 00 A6;
- Open the seventh USB switch: A0 07 01 A8;
- Close the seventh USB switch: A0 07 00 A7;
- Open the eighth USB switch: A0 08 01 A9;
- Close the eighth USB switch: A0 08 00 A8;
- Open all USB switches: A0 0F 01 B0;
- Close all USB switches: A0 0F 00 AF;
- Query Switch Status (sent in HEX format):
- Status of the first channel: A0 01 02 A3;
- Status of the second channel: A0 02 02 A4;
- Status of the third channel: A0 03 02 A5;
- Status of the fourth channel: A0 04 02 A6;
- Query all relay statuses: A0 0F 02 B1;
Usage Instructions
Relay Control
- Connect the USB relay module to your computer and install the driver for the CH340 USB-to-serial chip.
- Open serial port debugging software such as STC-ISP or SSCOM32, select a baud rate, and send commands in hexadecimal (hex) format to control the relays. For example, sending `A0 01 01 A2` will turn on the relay, while sending `A0 01 00 A1` will turn it off. You can choose between manual and automatic sending methods. The following examples are based on the SSCOM32 serial port debugging software:
- Manual Sending:
- Set Parameters: Choose a baud rate and check the "Hex Send" option.
- Send Commands:
- Enter the command `A0 01 01 A2` to turn on the relay.
- Enter the command `A0 01 00 A1` to turn off the relay.
- Execute: After entering the command, click "Send" to manually open or close the relay.
- Automatic Sending:
- Set Parameters: Again, choose a baud rate, click on "Extend" in the SSCOM32 interface, input the commands `A0 01 01 A2` and `A0 01 00 A1`, and check the "Hex Send" option.
- Configure Automatic Loop**: Input the interval time for automatic loop sending and check the "Automatic Loop Send" option to automatically cycle through opening and closing the relay.
Querying Relay Status
- For a three-channel relay module, assuming channels 1 and 2 are open while others are closed, querying the status of each channel will return the following responses:
Query Channel 1 Send (Hex): A0 01 02 A3 Receive (ASCII): CH1:ON Receive (Hex): 43 48 31 3A 4F 4E 0D 0A
Query Channel 2 Send (Hex): A0 02 02 A4 Receive (ASCII): CH2:ON Receive (Hex): 43 48 32 3A 4F 4E 0D 0A
Query Channel 3 Send (Hex): A0 03 02 A5 Receive (ASCII): CH3:OFF Receive (Hex): 43 48 33 3A 4F 46 46 0D 0A
Query All Relays Send (Hex): A0 0F 02 B1 Receive (ASCII): CH1:ON CH2:ON CH3:OFF Receive (Hex): 43 48 31 3A 4F 4E 0D 0A 43 48 32 3A 4F 4E 0D 0A 43 48 33 3A 4F 46 46 0D 0A
Software
- sscom32
- CH340/CH341 Diver(Supports 32/64-bit Windows 11/10/8.1/8/7/Vista/XP.)
FAQ
|