Featured Video Play Icon

Did you ever dream about controlling your lights, fridge or radio using a microcontroller? This can be done easily with the Dwenguino I/O board with which you can control 8 different devices (< 250 VAC). Moreover, if you connect 4 I/O boards in series you can increase this up to 24 different devices.


The Dwenguino I/O board connects to the Dwenguino using its expansion connector and has the following functionality:

  • eight buffered outputs (5 A, 250 VAC or 30 VDC) each with status LED and connector for save connection. warning: working with high VAC requires discipline and proper safety measures (see how to connect)
  • eight additional digital input pins
  • additional power input
  • easy connection with the Dwenguino board through the expansion connector
  • in order to further expand the number of IO, up to four Dwengo I/O boards can be cascaded
  • address selection with a DIP switch

Please note that the I/O board uses the I2C bus on pins 14 and 15. Consequently, you should not connect anything else on these pins when using the I/O board.

IO board

Getting started

We start by initialising the required libraries:

#include <Wire.h>
#include <LiquidCrystal.h>
#include <Dwenguino.h>
#include <DwenguinoIOBoard.h>

After initialising the libraries we can instantiate an IOBoard object which has an address (0-3) as an argument. The address can be set on the IO Board by setting the jumper ADDRESS. Please also note that JP1-1 and JP1-2 must be set.

IOBoard io(0);  // create an IOBoard object with address 0 (see jumper ADDRESS on Dwengo IO Board)

In the setup function we have to initialise both, the Dwenguino board and the IO Board:

void setup() {
  // put your setup code here, to run once:

After which we can use the IO Board in the loop function. In this example we use the setOutputs function to switch on and off the relays. The argument is an eight bit number, each bit refers to one of the eight relays. With the readInputs function, the additional inputs provided by the IO Board can be read.

void loop() {
  // put your main code here, to run repeatedly:
  dwenguinoLCD.print("IO status = ");

The example code can also be found in Arduino IDE File > Examples > Dwenguino > IOBoard

How to connect

Firstly, whenever you want to control a high voltage device (120 VAC or 220 VAC) with the Dwengo I/O Board you need to be extremely careful! The Dwengo I/O board should be placed in an insulated box (plastic or wood) and one should never make touch one of the electric contacts during operation.

Secondly, the Dwengo I/O board contains 8 relays which work as a programmable switch for your device (light bulb, coffee machine, Rube Goldberg machine,...). Such a (one phased) machine comes typically with two (neutral and phase line) or three wires (neutral, phase line and earth). Find out which wire the phase line is and cut that wire in two. One end goes into screw one of a relay, the other end goes into the other screw. Screw tightly!

relay circuit

Thirdly, the I/O Board has to be powered with a 12 V DC power supply. Use the power input connector. There is no need to supply the connected Dwenguino board. The Dwenguino board can be powered through the I/O Board.

Lastly, check all the connections and put everything in a well insulated box. Make sure there are no wires making contact with each other or other electrical contacts! The other end of the phase line, the neutral and (if present) the earth can be connected to the appropriate plug for your country. If you feel confident, plug it in!

Schematics and design files

Dwengo I/O Board by Dwengo vzw is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Please read the license before using this material

Click to download the schematics and design files

Related Post