The Yocto-Relay device contains two USB-driven miniature unipolar relay switches. You can drive by software each relay input to one of two individual outputs (computer-driven switch). To make it easier to test your project, four leds positioned on the front side of the connector show the output currently active for each relay.

This product is designed to stand up to 55V and a current of 2A, but no more than 60W. Be aware that using a relay to drive inductive loads (motors, transformers) may lead to accelerated aging of the relay. Please refer to the documentation for hints on reducing this type of problems.

This device can be connected directly to an Ethernet network using a YoctoHub-Ethernet, to a WiFi network using a YoctoHub-Wireless-g, it can even be connected to a GSM network thanks to the YoctoHub-GSM.

Yocto-Relay Yocto-Relay

USB cables and enclosure to be ordered separately.

CHF 34.36

   Add to cart


Part Number:RELAYLO1
Product name:Yocto-Relay
USB connectormicro-B
Max switching power60W
Max withholding voltage400V DC
Max working voltage60V DC
USB bus insulation0.25kV
Normal operating temperature5...40░C
Extended operating temperature-30...85░C
Supported Operating SystemsWindows (PC + IoT), Linux (Intel + ARM), macOS, Android
Driversno driver needed
API / SDK / Libraries (USB+TCP)C++, Objective-C, C#, VB.NET, UWP, Delphi, Python, Java, Android
API / SDK / Libraries (TCP only)Javascript, Node.js, PHP
Suggested enclosureYoctoBox-Short-Thick-Black
Made inSwitzerland

Related articles and application examples

 Josephine, the USB coffee machine (part II)  Using the Raspberry Pi as home automation gateway  Email controlled home  Relay and inductive loads  Yocto-Boom  USB water rockets 
 A network humidifier in an afternoon  Yoctopuce relays and their secrets  SRF06: a cheap range finder  Splash photography  Scanning bar codes  A flying plane counter 

Accessories and related products

YoctoBox-Short-Thick-Black, Enclosure for Yoctopuce device (short, thick, black)Micro-USB-Hub, Micro USB hub with solder pads, for DIY useFix-2.5mm, screws and spacersUSB-A-MicroB-30, A to micro-B USB data cable, 30cm


User manual (HTML)
User manual (PDF)
3D file (STEP)
RoHS Certificate (PDF)
Last Firmware24473 (05/20/2016)
Library for Javascript30760 (05/02/2018)
Library for PHP30760 (05/02/2018)
Library for Objective C30760 (05/02/2018)
Library for C++30760 (05/02/2018)
Library for C#30760 (05/02/2018)
Library for VisualBasic .NET30760 (05/02/2018)
Library for Delphi30760 (05/02/2018)
Library for Python30760 (05/02/2018)
Library for Java30760 (05/02/2018)
Library for Android30760 (05/02/2018)
Library for Command line30781 (05/03/2018)
Virtual Hub for Windows30566 (04/10/2018)
Virtual Hub for Linux, Intel + ARM30566 (04/10/2018)
Virtual Hub for Mac-OS-X30566 (04/10/2018)

Add a comment 11 comments

1 - pulcherior Monday,december 01,2014 1H20


My goal is to be able to programatically control external hard disk (power on/off).
The drive has 1 usb cable and a power adapter.
Is this possible? If so, what type will be appropriate, Yocto-Relay or Yocto-PowerRelay?


2 - martinm (Yocto-Team)Monday,december 01,2014 8H25

If you only want to be able to cut the disk power, a Yocto-PowerRelay will be fine*. However you'll have to check in the disk documentation if you are allowed to keep it connected to USB when not powered.
(*) since your power adapter is probably an inductive load, protecting the relay with a TVS diode might be a good idea, check the Yocto-PowerRelay doc for more info about use with inductive loads.

3 - youngsub Thursday,november 19,2015 16H51

I tried using Python and it works perfect. But when I tried with C++ code, relay works only first time and after that it does not work without any error message.

4 - mvuilleu (Yocto-Team)Thursday,november 19,2015 17H51

Feel free to contact support@yoctopuce.com and send us your code so that we can help you to fix it.
The C++ lib should definitely work as well as the Python version...

5 - youngsub Thursday,november 19,2015 23H18

I compiled cpp sample code downloaded from this site using Visual Studio 2012 and ran "VisualStudio.exe any 1 A[or B]" on command line.

6 - martinm (Yocto-Team)Friday,november 20,2015 5H41

Actually, you are supposed to type:

VisualStudio.exe any A[or B]


VisualStudio.exe any 1 A[or B]

7 - youngsub Friday,november 20,2015 17H25

You are right.
Now it works. Thank you.
It is different from the way Python program is implemented.
In such case I need to make some change in the code since I have dual relay and I want to use both independently.
I think I can make change in the code to support that.
Thank you for your help.
It is amazing product anyway.
Awesome design and complete package of software support.

8 - yellow_jacket Tuesday,march 29,2016 22H21

I'm retired but used to write a small amount of C++ at work where I had access to a compiler. Now I have no compiler but I would like to control the relay with my computer via USB. But rather than simple switching, I would like to have code to randomly switch back and forth with operator set limits on time. Could you provide this code since I can't compile anymore?

9 - seb (Yocto-Team)Wednesday,march 30,2016 7H37

@yellow_jacket : There is free C++ compiler on each platform: on Linux you can use gcc, on OS X
you can use Xcode and on Windows there is a free version of Visual Studio (Visual Studio Community).

10 - webjoy Monday,july 04,2016 15H11

Is it possible to catch the relay state, if it changes with


11 - martinm (Yocto-Team)Monday,july 04,2016 15H14

@webjoy: yes with relay.get_State(). You can even set a callback on state change with relay.registerValueCallback().

Yoctopuce, get your stuff connected.