USB Relay Module for Windows, Linux, Raspberry Pi

by Zihatec in Circuits > Electronics

17230 Views, 25 Favorites, 0 Comments

USB Relay Module for Windows, Linux, Raspberry Pi

IO-top-quadratisch.jpg
IO_seite.jpg
USB_Modul_io_2.jpg
23_finish.jpg

USB is a very well documentated and reliable interface. Nearly every computer system today is equipped with one or more USB host connectors. Sometimes you need some inputs and outputs for tasks surrounding your PC or you have a cool idea for an automation with your Raspberry Pi or other micro computer. In all these cases an USB relay module will help you.
SimpliBox IO is an universal USB IO module with the following features:

  • HID USB device – no drivers needed
  • 2 relay outputs 240V / 2A (NO, NC and COM)
  • 2 opto isolated inputs 5...24VDC
  • Status LEDs for any input and output
  • Open source firmware available
  • Sample code for Python (for example for Raspberry Pi) available
  • Sample code for C++ for Windows & Linux PC available
  • No additional power supply needed
  • Comes in kit form (THT parts only)
  • Fits perfect in an optional 3 module cab rail enclosureHow it works:

SimpliBox don't needs USB drivers because of HID technology. It's very easy to combine it with various hosts, different operating systems (Linux, Windows...) and platforms (PC, Laptops, Raspberry Pi, Beagle Bone...)

It based on an ATMEL ATTINY45 microcontroller which runs a firmware with V-USB stack. We have only 5 free IO pins, but we need 6 pins for 2 outputs, 2 inputs and 2 USB GPIOs. The solution is the internal ADC. We measure the voltage of an internal voltage divider. Single resistors are bypassed by the phototransistors of the optocoupler. This is the simple solution for our problem with the pin count.


Please take a look to our website for more information.

Tools & Materials

Simplibox_kit_big.jpg

Materials:

We provide a diy kit on our website. But you will find there the circuit diagram and software - so its also possible to built this by yourself on a breadboard. We provide also an optional 3 module din rail enclosure for the kit.

Tools:

  • a regulated soldering iron (25..40W) with small tip
  • a wet sponge to clean the tip
  • thin solder wire
  • a diagonal cutter for wires
  • Needle nose pliers
  • small Philips head screwdriver

Solder the IC Sockets

1_Fassungen.jpg

Prepare and Mount the Terminals

2_Klemmen.jpg
3_Klemmen_gelötet.jpg

Find the terminal blocks, they're blue or grey and come in 3-pin and 2-pin shapes. We'll need to slide two 2-pin and one 3-pin blocks together.
Place the terminal blocks into the plate Make sure you place them so that the open ends are facing out as shown.

Continue to solder all terminal blocks.

LED Assembly

4_LED_1PIN_geloetet.jpg
5_LED_Rückseite.jpg

Assemble the 4 leds. The cathode pin (shorter pin) should be place to the outside. Solder only one pin of each LED first. Now you can align all four LEDs to the correct position. Solder now the second pin of every LED.

Assemble and Solder All Resistors

6_68Ohm bestückt.jpg
7_1500Ohm bestückt.jpg
8_1KOhm bestückt.jpg
8_10KOhm bestückt.jpg
9_3K3 bestückt.jpg
10_6K8Ohm bestückt.jpg

We start with the three 68 Ohm resistors. Then we add the 1,5K resistor. The next are the six 1K resitors.

In the last step we add the 3 resistors with 10k, 3,3k and 6,8k.

Assemble and Solder the 1N4148 Diodes

11_1N4148 Dioden bestückt.jpg

Its very important to place the 5 diodes in the right direction to the pcb! The cathode is marked with an black loop.

Assemble and Solder the Z-Diodes

12_3V3 ZDiode bestückt.jpg

Its very important to place the 2 Z-diodes in the right direction to the pcb! The cathode is marked with an black loop.

Assemble and Solder the BC548 Transistors

14_USB-Buchse bestückt.jpg

Assemble and Solder the USB-B-socket

13_BC547 bestückt.jpg

Assemble the 10µH Ferrite

15_Induktivität bestückt.jpg

Assemble and Solder the Both Capacitors

16_Elko bestückt.jpg

Assemble the Both Relays

17_Relais bestückt.jpg

Place the Both Circuits to the IC Sockets

19_Mikrocontroller eingesetzt.jpg

Test Your Work!

SimpliboxIO USB IO module and the RaspberryPi

You will find several example programs for host computers on our webside.

This video demonstrate the usage of two sample programs for the Raspberry Pi

Option: Mount the Pcb in a Din Rail Enclosure

20_Leiterplatte montiert.jpg
21_gehäuse schliessen.jpg
22_Schnapper einsetzen.jpg
23_finish.jpg

First use the two self-tapping screws to mount the pcb into the lower part of the enclosure. Click the upper shell to the lower shell. Then mount the both holders for the din rail.