nickhills
Posts: 10
Joined: Sat Apr 06, 2013 9:03 am

PiFace outputs to Drive 8 relays

Sat Apr 06, 2013 9:33 am

I would like to add a relay board which has 8x SPDT relays with a +5v trigger.

Given that the PiFace is open collector, can anyone suggest how to make these outputs drive my relay board?

Its been a while since I did any electronics :)

bazooka
Posts: 9
Joined: Mon Apr 08, 2013 1:55 am

Re: PiFace outputs to Drive 8 relays

Mon Apr 08, 2013 2:00 am

I have the same problem :cry:

agidi
Posts: 16
Joined: Wed Apr 03, 2013 2:52 am

Re: PiFace outputs to Drive 8 relays

Mon Apr 08, 2013 11:26 pm

Did you guys solve this?

Need to sense light and activate relays too.

bazooka
Posts: 9
Joined: Mon Apr 08, 2013 1:55 am

Re: PiFace outputs to Drive 8 relays

Tue Apr 09, 2013 12:53 am

Any help in how to put one of this working with PIFACE????

Will it fry my PIFACE our RASPBERRY PI???


Image

Image

nickhills
Posts: 10
Joined: Sat Apr 06, 2013 9:03 am

Re: PiFace outputs to Drive 8 relays

Tue Apr 09, 2013 6:14 am

The board you have posted activates when the pins are taken to gnd, so I think that board will work with the piface without any modifications. (You may need to power it seperatly if you want to run all 8 relays at once-I assume there is an aditional power connector)

The relays I have all need +5v to energise, but I have come round to the idea of getting a board like the one above for ease of use. :)

nickhills
Posts: 10
Joined: Sat Apr 06, 2013 9:03 am

Re: PiFace outputs to Drive 8 relays

Tue Apr 09, 2013 6:16 am

Update:

Just ordered one, will let you know how it goes! :)

bazooka
Posts: 9
Joined: Mon Apr 08, 2013 1:55 am

Re: PiFace outputs to Drive 8 relays

Tue Apr 09, 2013 5:27 pm

ok I will be waiting, because I'm giving my first steps in electronics and do not want to do any rubbish

User avatar
[email protected]
Posts: 1982
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: PiFace outputs to Drive 8 relays

Wed Apr 10, 2013 9:21 am

nickhills wrote:I would like to add a relay board which has 8x SPDT relays with a +5v trigger.

Given that the PiFace is open collector, can anyone suggest how to make these outputs drive my relay board?

Its been a while since I did any electronics :)
If you want to drive 8 relays off the Pi... Then get a board designed for the Pi that will drive 8 relays! There are far too many ebay boards that are designed for 5v systems (e.g. Arduino) that I've seen people spend more money on making work with the Pi than if they'd just built their own from scratch!

You can use the PiFace directy, BUT there is not enough current in the 5v supply to drive more than the 2 relays it has - so you need an external 5v power supply for the PiFace and 6 more relays.

Alternatively just make your own - ULN2803, 8 relays, separate 5v supply (or 12v if you want to use 12v relays) and off you go.

-Gordon
--
Gordons projects: https://projects.drogon.net/

nickhills
Posts: 10
Joined: Sat Apr 06, 2013 9:03 am

Re: PiFace outputs to Drive 8 relays

Wed Apr 10, 2013 11:56 am

Gordon whilst I fully appreciate your suggestion, and I broadly understand your last sentence, I wouldn't have a clue where to start with building my own.
Its been over 10 years since I have done any electronics, (but its slowly starting to come back :)

I bought the PI-Face to see if i could drive some outputs via some Python, and eventually via http, and having proved this much to myself, the next challenge was to drive larger loads, and different systems, and relays seemed to be the simple solution.

I very much like the idea of keeping my "Loads" and my "Logic" on separate boards, and a pre-built board was just the ticket, so when i realised the board bazooka posted had opto-isolators i was even more convinced that this was the way to go for me.

I am keen to learn more about I2c and the GPIO on these little systems, but so far i am only a few days into my new hobby. I would love to be able to take your comment about the ULN2803 and turn this into a working project, but even if i had this working on a breadboard, my desire would be to get this working on a PCB, and that presents another set of challenges and difficulties.

It would be great if someone could build a compatibility list of modules with one another, because it can be a bit overwhelming as a noob :)

bazooka
Posts: 9
Joined: Mon Apr 08, 2013 1:55 am

Re: PiFace outputs to Drive 8 relays

Mon Apr 15, 2013 6:36 pm

Here is a picture of the board with pins and jumpers

Image

nickhills
Posts: 10
Joined: Sat Apr 06, 2013 9:03 am

Re: PiFace outputs to Drive 8 relays

Mon Apr 15, 2013 7:10 pm

Hi guys,

I have mine too, and it works perfectly.

Triggers on Low, so can be interfaced directly with the PiFace outputs. - I'm using the additional power supply (remove the jumper, and send 5v on pins 1&3) instead of relying on the Pi-face.

I have a video i can post if anyone wants to see!

User avatar
[email protected]
Posts: 1982
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: PiFace outputs to Drive 8 relays

Mon Apr 15, 2013 7:15 pm

nickhills wrote:Hi guys,

I have mine too, and it works perfectly.

Triggers on Low, so can be interfaced directly with the PiFace outputs. - I'm using the additional power supply (remove the jumper, and send 5v on pins 1&3) instead of relying on the Pi-face.

I have a video i can post if anyone wants to see!
You're using a £20 interface board to drive a cheap relay board off ebay - rather than use a relay board designed to work directly on the Pi... That's great, but ...

Here's one that'll connect directly to the Pi, and let you connect a 2nd, 3rd, 4th, etc. in series too:

http://www.skpang.co.uk/catalog/4ch-rel ... -1200.html

Although I suppose it's no cheaper than a PiFace and a cheap one off ebay...

-Gordon
--
Gordons projects: https://projects.drogon.net/

bazooka
Posts: 9
Joined: Mon Apr 08, 2013 1:55 am

Re: PiFace outputs to Drive 8 relays

Mon Apr 15, 2013 10:33 pm

nickhills wrote:Hi guys,

I have mine too, and it works perfectly.

Triggers on Low, so can be interfaced directly with the PiFace outputs. - I'm using the additional power supply (remove the jumper, and send 5v on pins 1&3) instead of relying on the Pi-face.

I have a video i can post if anyone wants to see!
Can you put the video to see how you made connections?


bazooka
Posts: 9
Joined: Mon Apr 08, 2013 1:55 am

Re: PiFace outputs to Drive 8 relays

Mon Apr 15, 2013 11:04 pm


Do you have 2 separate power supplies (1 for PI another for PIFACE) our just 1 5V 2A for both?

In the PIFACE do you change any jumper???

On the 8 relay board you have 10 pins

gnd, in1 to in8 and Vcc

which one do you connect on PIFACE, gnd or Vcc?

nickhills
Posts: 10
Joined: Sat Apr 06, 2013 9:03 am

Re: PiFace outputs to Drive 8 relays

Mon Apr 15, 2013 11:23 pm

Right now I have two power supplies, but in the video they were running from the same PSU.

Power was supplied to the +5v and Gnd Connector on the PiFace (i don't use the micro USB at all)
and to pins GND & JDVCC of the jumper header - I removed the jumper completely. (the VCC pin is NOT connected)

On the 10 pin header, I connected VCC to the +5v PiFace output terminal (number 9 - the red striped side of my ribbon cable), and the INx pins to the PiFace outputs.
I do NOT connect GND on the 10 pin header to anything.

The reason for this, is that when the jumper is in place, you can use all 10 header pins to supply VCC and GND and 8 Inputs to the relay board. Since I want to completely isolate the two circuits, I use the separate VCC and GND Pins that the 3 pin header provides.

This means that the PI is optically isolated from both the +5V driving supply from the second PSU, and of course any larger loads you may wish to run though the relays.

bazooka
Posts: 9
Joined: Mon Apr 08, 2013 1:55 am

Re: PiFace outputs to Drive 8 relays

Mon Apr 15, 2013 11:42 pm

Thank you for your patience. You're a very nice guy. Now I am sure that I will not burn anything. Thanks again.

H00PD0GG
Posts: 6
Joined: Wed Apr 10, 2013 1:00 pm

Re: PiFace outputs to Drive 8 relays

Thu Apr 18, 2013 10:12 am

Aha, hello all on this post, i have 4 of these relay boards (as stock for various projects i would like to achieve)
Ive made a board consisting of a 3v3 voltage reg circuit and a 5v0 voltage reg circuit, one MCP23017 and one MPR121 capacitive touch sensor, here is a photo https://www.dropbox.com/s/0d399qhg5l6o7 ... %20HDR.jpg now the reason i am posting this is because from what i can work out is that this relay board needs a gnd to activate each relay however i dont think the MCP23017 really works like this, i have tried using a python code from skpang (ledchaser.py) now as soon as i run this script all relay channels are closed, i think this is done as soon as the code starts and all GPIO's are set to be outputs, this makes all GPIO's gnd until made high (+5v) within the code. Ive been thinking about this and wonder what is the best way to if you like reverse this so that all relays are open until triggered with the GPIO +5v, does anybody know of a chip what would be suitable whereby it receives a +5v and outputs a gnd. Am i correct in thinking this is the way to go? Or have i missed something completely?
Thankyou in advance
Chris

Loonhaunt
Posts: 55
Joined: Sat Nov 16, 2013 5:13 am

Re: PiFace outputs to Drive 8 relays

Fri Nov 29, 2013 12:59 pm

nickhills wrote:Right now I have two power supplies, but in the video they were running from the same PSU.

Power was supplied to the +5v and Gnd Connector on the PiFace (i don't use the micro USB at all)
and to pins GND & JDVCC of the jumper header - I removed the jumper completely. (the VCC pin is NOT connected)

On the 10 pin header, I connected VCC to the +5v PiFace output terminal (number 9 - the red striped side of my ribbon cable), and the INx pins to the PiFace outputs.
I do NOT connect GND on the 10 pin header to anything.

The reason for this, is that when the jumper is in place, you can use all 10 header pins to supply VCC and GND and 8 Inputs to the relay board. Since I want to completely isolate the two circuits, I use the separate VCC and GND Pins that the 3 pin header provides.

This means that the PI is optically isolated from both the +5V driving supply from the second PSU, and of course any larger loads you may wish to run though the relays.
Hello,

You wouldn't happen to have made a sketch of this project showing inter connects? Great video I however wasn't able to see much of the cabling on my rig here.

Dave

Loonhaunt
Posts: 55
Joined: Sat Nov 16, 2013 5:13 am

Re: PiFace outputs to Drive 8 relays

Thu Dec 05, 2013 7:40 pm

Nick,

Did you use python code?

DB

nickhills
Posts: 10
Joined: Sat Apr 06, 2013 9:03 am

Re: PiFace outputs to Drive 8 relays

Mon Dec 09, 2013 9:30 am

Yes, its all Python.

I have posted a bit of an update on my blog here:
http://nickhills.com/wp/2013/12/raspber ... ontroller/

This shows how I have evolved the project into my Christmas Lights Controller.

Return to “HATs and other add-ons”