Difference between revisions of "ICStation USBRelay"

From sigrok
Jump to navigation Jump to search
(Initial device page)
 
(Change status to supported)
 
(10 intermediate revisions by the same user not shown)
Line 2: Line 2:
| image              = [[File:ICStation_ICSE012A-mugshot.png|180px]]
| image              = [[File:ICStation_ICSE012A-mugshot.png|180px]]
| name                = ICStation USBRelay
| name                = ICStation USBRelay
| status              = in progress
| status              = supported
| source_code_dir    = icstation-usbrelay
| source_code_dir    = icstation-usbrelay
| channels            = 2, 4 or 8
| channels            = 2, 4 or 8
| ratings            = 10A@250VAC, 10A@30VDC, 12A@125VAC, 12A@28VDC
| ratings            = 10A @ 250VAC/30VDC, 12A @ 125VAC/28VDC
| connectivity        = USB/Serial
| connectivity        = USB/Serial
}}
}}
Line 12: Line 12:


See [[ICStation_USBRelay/Info | Info]] for USB details.
See [[ICStation_USBRelay/Info | Info]] for USB details.
'''WARNING:''' When reconnecting to the device (e.g. with sigrok-cli or SmuView) the connect will fail and the "query device"-command (0x50) will be interpreted as a bit mask and will turn on relays 1-4, 6 and 8. You have to power cycle the device to be able to reconnect!


== Photos ==
== Photos ==
Line 19: Line 21:
File:ICStation_ICSE012A-back.jpg|<small>ICStation ICSE012A back</small>
File:ICStation_ICSE012A-back.jpg|<small>ICStation ICSE012A back</small>
</gallery>
</gallery>
== Hardware ==
* '''STM 8S003F3P6 microcontroller''': [https://www.st.com/resource/en/datasheet/stm8s003f3.pdf datasheet]
* '''Prolific PL-2303HX USB to UART Bridge''': [http://www.prolific.com.tw/UserFiles/files/ds_pl2303HXD_v1_4_4.pdf datasheet]
* '''ULN2803AG relay driver''': [https://www.ti.com/lit/gpn/uln2803a datasheet]


== Protocol ==
== Protocol ==
The relay boards have a very simple and limited protocol.
'''Note:''' Once the device is connected and has entered the command mode (0x51), every following byte will be interpreted as a bit mask for switching relays. There is no way to leave the command mode!
{| border="0" width="95%" style="font-size: smaller;" class="alternategrey sigroktable"
|-
! style="width: 10em;" | Byte
!Command
|-
| valign="top" style="white-space=nowrap;" | '''0x50'''
| '''Query the device model.'''
Response:
{| border="0" width="100%" style="margin: 0;" class="alternategrey"
|-
| style="width: 3em;" | '''0xAB'''
| style="width: 6em;" | ICSE012A
| 4 relay version
|-
| '''0xAD'''
| ICSE013A
| 2 relay version
|-
| '''0xAC'''
| ICSE014A
| 8 relay version
|}
|-
| valign="top" style="white-space=nowrap;" | '''0x51''' ''0xnn 0xnn ...''
| '''Start command mode.'''
Every following byte will be interpreted as a bit mask for switching the relays. '''0''' will turn a relay on, '''1''' will turn a relay off.
'''Note:''' You cannot leave the command mode!
Examples for switching mask bytes (ICSE014A, 8 relays):
{| border="0" width="100%" style="margin: 0;" class="alternategrey"
|-
| style="width: 5em;" | '''0b00000001'''
| Turn off relay #1 and turn on relays #2 - #8
|-
| '''0b00000000'''
| Turn on all relays (#1 - #8)
|-
| '''0b10101010'''
| Turn off relay #1, #3, #5, #7 and turn on relays #2, #4, #6, #8
|}
|}


== Example use ==
== Example use ==
Line 27: Line 87:


<small>
<small>
   $ '''./sigrok-cli -d icstation-usbrelay:conn=/dev/ttyUSB0 --show'''
   $ '''sigrok-cli -d icstation-usbrelay:conn=/dev/ttyUSB0 --show'''
   Driver functions:
   Driver functions:
       Multiplexer
       Multiplexer
Line 56: Line 116:
[[Category:Device]]
[[Category:Device]]
[[Category:Multiplexer]]
[[Category:Multiplexer]]
[[Category:In progress]]
[[Category:Supported]]

Latest revision as of 19:10, 19 February 2023

ICStation USBRelay
ICStation ICSE012A-mugshot.png
Status supported
Source code icstation-usbrelay
Channels 2, 4 or 8
Ratings 10A @ 250VAC/30VDC, 12A @ 125VAC/28VDC
Connectivity USB/Serial

The ICStation USBRelay is a USB relay card with up to 8 relays. Models with 2 (ICSE013A), 4 (ICSE012A) and 8 (ICSE014A) relays exist.

See Info for USB details.

WARNING: When reconnecting to the device (e.g. with sigrok-cli or SmuView) the connect will fail and the "query device"-command (0x50) will be interpreted as a bit mask and will turn on relays 1-4, 6 and 8. You have to power cycle the device to be able to reconnect!

Photos

Hardware

Protocol

The relay boards have a very simple and limited protocol.

Note: Once the device is connected and has entered the command mode (0x51), every following byte will be interpreted as a bit mask for switching relays. There is no way to leave the command mode!

Byte Command
0x50 Query the device model.

Response:

0xAB ICSE012A 4 relay version
0xAD ICSE013A 2 relay version
0xAC ICSE014A 8 relay version
0x51 0xnn 0xnn ... Start command mode.

Every following byte will be interpreted as a bit mask for switching the relays. 0 will turn a relay on, 1 will turn a relay off.

Note: You cannot leave the command mode!

Examples for switching mask bytes (ICSE014A, 8 relays):

0b00000001 Turn off relay #1 and turn on relays #2 - #8
0b00000000 Turn on all relays (#1 - #8)
0b10101010 Turn off relay #1, #3, #5, #7 and turn on relays #2, #4, #6, #8

Example use

Detect the device and display its properties.

 $ sigrok-cli -d icstation-usbrelay:conn=/dev/ttyUSB0 --show
 Driver functions:
     Multiplexer
 Scan options:
     conn
     serialcomm
 icstation-usbrelay - ICStation ICSE012A
 Channel groups:
     R1: channel
     R2: channel
     R3: channel
     R4: channel
 Supported configuration options across all channel groups:
     enabled: on, off

Manipulate the state of relays.

 $ sigrok-cli -d icstation-usbrelay:conn=/dev/ttyUSB0 --config channel_group=R1:enabled=off --config channel_group=R2:enabled=on --set

Resources