Help! GPio, 8 relays...

Moderator: leecollings

sallytech0103
Posts: 2
Joined: Monday 28 December 2015 9:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Help! GPio, 8 relays...

Post by sallytech0103 »

I had a same problem in my project. I resolved it from this discussion thanks.

Some information about relays.

Image
guantolento
Posts: 129
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: LastBeta
Location: Italy BG
Contact:

Re: Help! GPio, 8 relays...

Post by guantolento »

good evening,
just a question. i can take the 8 ch reley board and install at about 20 mt to rpi2? i connect with an alarm cable 10x0.22+2x0.50.
what do you think about ?
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
guantolento
Posts: 129
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: LastBeta
Location: Italy BG
Contact:

Re: Help! GPio, 8 relays...

Post by guantolento »

sallytech0103 wrote:I had a same problem in my project. I resolved it from this discussion thanks.

Some information about relays.

Image
how you resolve the problem ? with hardware or software ????
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
hill2button
Posts: 7
Joined: Friday 17 February 2017 22:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Belgium
Contact:

Re: Help! GPio, 8 relays...

Post by hill2button »

Hi all,

I'm a bit lost. I have a similar relay to the one described above. I have read all posts but still I can't figure it out.

My domoticz setup file (the end) looks like this:

esac

:
#Run export GPIO Raspberry
/usr/bin/gpio export 17 out
sudo sh -c 'echo 17 > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpio17/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio17/active_low'


I am trying to get gpio 17 to work. Now, doing this works, the direction is correct in Domoticz. However, it clicks the relay on-off at bootup, which is not what I want... I have the feeling it has something to do with the boot sequence. Or, may it first provides 5V to the relay, with a dead gpio pin, and moments later puts the gpio pin in the high state?

Also, I wonder, is

/usr/bin/gpio export 17 out
sudo sh -c 'echo 17 > /sys/class/gpio/export'

the same command? Is this double?

Thanks for the help!
hill2button
Posts: 7
Joined: Friday 17 February 2017 22:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Belgium
Contact:

Re: Help! GPio, 8 relays...

Post by hill2button »

I needed to return one item of my last order, so I decided to include this relay in the return.

If anyone has a suggestion on a active-high relay: shoot! Now that I know what to look for it seems I can only find active-low relays...
RayAmsterdam
Posts: 115
Joined: Sunday 11 January 2015 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Help! GPio, 8 relays...

Post by RayAmsterdam »

I posted the solution earlier in this topic: viewtopic.php?f=32&t=6050&p=39401#p39401
hill2button
Posts: 7
Joined: Friday 17 February 2017 22:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Belgium
Contact:

Re: Help! GPio, 8 relays...

Post by hill2button »

RayAmsterdam wrote:I posted the solution earlier in this topic: viewtopic.php?f=32&t=6050&p=39401#p39401
I appreciate that, but I cannot solder. I'm looking for an out-of-the-box solution. But it seems active-high 5V relays are hard to find...
Lebo2d9
Posts: 139
Joined: Tuesday 06 September 2016 20:39
Target OS: Raspberry Pi / ODroid
Domoticz version: L stab
Location: Belgium
Contact:

Re: Help! GPio, 8 relays...

Post by Lebo2d9 »

Hi,

Did someone ever tested the relay interfacing with a 74HC240 in between? 8 port invering buffer.

Kind regards
Domoicz on RPI3 (wifi) directly connected 3x ds18b20 for CV temp, Evohome (9 zone), 1 remote 220V switch based on ESP-12. RFXtrx433E, 16x AMST-606, 5 Somfy RTS motors
Domoticz on RPI3(wifi) as slave for terraruim control
More to come
gohan
Posts: 36
Joined: Monday 13 February 2017 23:42
Target OS: Windows
Domoticz version:
Contact:

Re: Help! GPio, 8 relays...

Post by gohan »

How did you guys made the active_low to work? I can't find a way as setting it either way makes no changes. I gave the GPIO esported correctly and they don't turn on at boot, so that part is fine.
trackerj
Posts: 6
Joined: Tuesday 06 December 2016 8:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Help! GPio, 8 relays...

Post by trackerj »

hill2button wrote:
RayAmsterdam wrote:I posted the solution earlier in this topic: http://www.domoticz.com/forum/viewtopic ... 401#p39401
I appreciate that, but I cannot solder. I'm looking for an out-of-the-box solution. But it seems active-high 5V relays are hard to find...
For a simple out-of-the-box solution, you have also this board, 8xRelays, proper driver, can be drive by RaspberryPi without problems directly (version without ESP8266 module installed using the nEXT bus connector) or thru network using the onboard ESP8266 module:
https://www.tindie.com/products/nEXT_EV ... utomation/

You have also plenty of videos, tutorials and related docs.
mjdb
Posts: 71
Joined: Thursday 12 January 2017 13:38
Target OS: Raspberry Pi / ODroid
Domoticz version: all beta
Location: NL - Pijnacker
Contact:

Re: Help! GPio, 8 relays...

Post by mjdb »

For what it is worth...

To use Domoticz with relays you could also use an Arduino with a relay-card.
It can work stand-alone and independent of Domoticz, but you can send On/Off commands and monitor the status from Domoticz.

I made a 4 relay switch viewtopic.php?f=56&t=17656

When you leave out the "hardware" part, you can use the electronics and the program for your relay-project.
Box1DecentWires.jpg
Box1DecentWires.jpg (44.83 KiB) Viewed 5257 times
You can change the program very easy from 4 to 8 relays.
Box2WithDecentWires.jpg
Box2WithDecentWires.jpg (38.97 KiB) Viewed 5256 times
- - - - - - - - - - -
2 x Domoticz on Raspberry Pi; 2 x RFXtrx433; Aeotec Z-Stick
KlikAanKlikUit ICS-2000 as Relay
Aeotec MultiSensors 6; Danfoss Z Thermostats 014G0013; Kaku Switches, Z-wave Switches
toni1234567
Posts: 1
Joined: Saturday 06 May 2017 10:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Help! GPio, 8 relays...

Post by toni1234567 »

RayAmsterdam wrote:This board isn't designed to be used with the pi. It needs ground to switch the relay on. The pi is grounded when off and 3,3v when on. That is why it acts reversed.
Here is what I did:
I removed the led and the lower resistor. I soldered in a bridge and a 100 Ohm resistor as in the first picture. You have to do this for all 8 relays! I put the jumper between ground and vcc (second picture). 5v from the pi is connected to jd-vcc. The vcc pin on the left pinrow is unused (I cut it away).
IMG_20150407_212948~2.jpg
IMG_20150407_212948~3.jpg
IMG_20150407_212948~4.jpg

Thanks for your information it works....!!!

The resistor is not 100 ohms is 1k.
I rescued de original led solderind led+original resistor(1k) like you.
Regards.
BarryT
Posts: 365
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: Help! GPio, 8 relays...

Post by BarryT »

macieiks wrote: Friday 10 July 2015 11:35 BarryT, Any update with that? I run these relays too and I would like to invert values. Could you give us an example how to manage to do that?
Sorry for the late reply... Didnt see the replies at all :(
I'm using gpio (sysfs) on all my raspberrys, and using the rc.local file to import the values >

Code: Select all

sudo sh -c 'echo 16 > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpio16/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio16/active_low'

sudo sh -c 'echo 20 > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpio20/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio20/active_low'

sudo sh -c 'echo 21 > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpio21/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio21/active_low'

sudo sh -c 'echo 12 > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpio12/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio12/active_low'

sudo sh -c 'echo 26 > /sys/class/gpio/export'
sudo sh -c 'echo high > /sys/class/gpio/gpio26/direction'
sudo sh -c 'echo 1 > /sys/class/gpio/gpio26/active_low'
hope this will helped you out!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests