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.

The relay and the connector can stand up to 160V and a current of 2A. 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.45

   Add to cart


Manufacturer Product NumberRELAYLO1
Product nameYocto-Relay
USB connectormicro-B
Max switching power60W
Max voltage160V
Supported Operating SystemsWindows, Linux (Intel + ARM), Mac OS X, Android
Driversno driver needed
API / SDK / Libraries (USB+TCP)C++, Objective-C, C#, VB .NET, Delphi, Python, Java/Android
API / SDK / Libraries (TCP only)Javascript, Node.js, PHP, Java
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)YoctoBox-Short-Thick-Transp, Enclosure for Yoctopuce device (short, thick, transp)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)
Last Firmware24473 (05/20/2016)
Library for Javascript25534 (10/10/2016)
Library for PHP25534 (10/10/2016)
Library for Objective C25534 (10/10/2016)
Library for C++25534 (10/10/2016)
Library for C#25534 (10/10/2016)
Library for VisualBasic .NET25534 (10/10/2016)
Library for Delphi25534 (10/10/2016)
Library for Python25534 (10/10/2016)
Library for Java25534 (10/10/2016)
Library for Android25534 (10/10/2016)
Library for Command line25250 (08/23/2016)
Virtual Hub for Windows25601 (10/19/2016)
Virtual Hub for Linux, Intel + ARM25601 (10/19/2016)
Virtual Hub for Mac-OS-X25601 (10/19/2016)

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.