6 Way relay

BV4531 - Serial interface

BV4531U Serial interface with USB (uses CH340)

BV4532 I2C interface

The device comes with the above options, each option I2C and Serial mutually exclusive so a BV4531 will only have the serial interface enabled and the BV4532 will only have the I2C interface enabled.

The library contain all resources including the Adruino library


The library is intended for use with I2C.

There is also a simple program within the library that will turn on the relays one after the other. The library has only been tested with the UNO and is provided as an example of how to use the device.

There is no library available for serial device as it is simply a matter of sending text to the serial port, a library for this would be too trivial. However see the USB serial example for some ideas.

ESP8266 Running MicroPython

The I2C library for this is in the resources. This device will normally need pull up resistors

Raspberry Pi

An I2C library is included for the RPi, in fact the RPi and ESP8266 share much of the same code.


The serial examples are in the USB folder and can of course be used with any serial device. The relays are vey easy to drive with simple serial commands. All commands are prefixed with esc. In the example the receiver looks for the prompt '>' and uses one function 'transfer' to read and write.

As an example for the puts or print could be used:

print('o\r') // turns on all of the relays

print('r3,1\r') // truns on relay three

This will work better if after a command the input from the UART is read up until the '>' prompt, then the program would know to send the next command if any.