The PiOT Relay Board For The Raspberry Pi

The ModMyPi PiOT Relay Board

The ModMyPi PiOT Relay Board

I’ve been playing with the new ModMyPi PiOT Relay Board over the last few days, and as you’ll guess from the name, it includes relays.

Relays allow you to switch (turn on/off) higher voltages than the device you’re using. I use the Raspberry Pi for example, which offers 5V at the very most. But what if I wanted to use my Pi to turn on/off a 20V motor or another device higher than its limit? That’s where relays come in.

But what kind of voltages can you safely tinker with? For amateurs like us, certain sources say up to 50V is fine, and ideally won’t cause us to be the guy laying down at a funeral.

I’m not really up for testing that out on my own body, but it did raise a good point – despite some products being rated at 240V or higher, you really REALLY don’t want to go there.

Let me explain in this post…

HEAVY DISCLAIMER: I am not an engineer. I’m not an electrician. I’m an uninteresting office boy with a craving for low-cost electronics. I’m learning just like the rest of you. If you fry/BBQ/kill yourself messing around with relays or any other electronics – I am not responsible. If in doubt, blame the Labour party.

The PiOT Relay Board

First, let me show you around my new toy this week – the PiOT relay board from ModMyPi.

This unconventionally shaped add-on board for the Pi is designed to take the hassle away from using these little clicking boxes of fun. The large shape and header position holds a Pi Zero very well, but for other Pis it’s a tad clunky. Where possible, I personally prefer the HAT format:

PiOT relay board front

The front of the PiOT relay board

Ignoring the layout, the PiOT relay board is quite a smart little chap.

The 4 relays are connected to the Pi through the clever use of a PIC micro-controller. The PIC is the brain behind all the annoying stuff you just don’t want to waste your precious time with as a weekend coding warrior – voltage dividers, transistors, diodes, wires, jumpers and more.

Relay board PIC

Look – a quick slick pic of a PIC!

You’ll also notice a 7-segment display at the front, and some buttons next to each relay. This is what you use to set the GPIO pin for each relay, and because of the clever PIC business, you don’t have to fumble about with jumper wires to do this.

It’s certainly a lot simpler than it looks. I was originally a bit tentative as I hadn’t used relays previously, and all the display/PIC/button business looked a bit beyond me – but it’s super simple once you’ve spent 3 minutes reading the guide.

Relay board control buttons

Menu control buttons next to each relay. These are not to be used once wires are connected!

Setup

This is another handy board that requires almost no setup. Most of that is covered by the pre-configured PIC controller, meaning all you have to do is plug your wires, tie the GPIOs to the relays using the buttons, and then simply set GPIOs high or low to switch the relays.

If you want fancy on-screen button controls, ModMyPi have made a Tkinter GUI for the board as well.

How A Relay Works

Seeing 3 terminals for each relay confused me, so let me explain it.

Firstly, all the relay is doing is ‘making or breaking’ your circuit. If you had a simple LED circuit, you’d chop the 5v line and chuck the 2 chopped ends into the relay. That’s all you’re doing here, so don’t let it confuse you.

Secondly, you’re only wiring into 2 of these terminals at any one time, and you always put one wire in the ‘COM’ (common) terminal.

You then have to decide where to put the other wire – in the NC (Normally Closed) or NO (Normally Open) terminal:

  • NO – Normally Open – this means when the relay is off, the circuit is broken and your device is off too. This feels like the safer option to me.
  • NC – Normally Closed – this means the connection is usually on/connected even when the relay is off, and is only broken when you turn the relay on.

Here you can see me using the NC terminals, which I quickly changed afterwards to NO – I didn’t want things to be turning on from boot without me saying so!

Figured I'd put the GND lines into a 2nd relay and tie it to the same GPIO, saves me insulating wires and generally doing it properly

Continue reading here: The Short Crust Raspberry Pi Case from Pi-Supply.com

Was this article helpful?

0 0