question

hallstein avatar image
hallstein asked

RPI relays active high or low

With SetupHelper and GuiMods the Raspberry Pi with Venus OS can make use of up to 6 relays. They are all set up to be active on low current. Many relay boards to buy are fixed to be active on high current, only some can be configured as both low or high.
Is there a simple way to edit this function (file edit with SSH) to make use of a active high relay board connected to the RPi ? And make the change survive a FW update. Or is the best way out to find relay boards that is jumper configurable.

Venus OSRaspberry PiRelay
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

6 Answers
Kevin Windrem avatar image
Kevin Windrem answered ·

The trouble with trying to change the active state of the relay outputs is that during a reboot, the GPIO outputs will go to their default state. If you've inverted the normal behavior of a GPIO output somewhere in the process, the relays will close during boot until an overlay is loaded or whatever mechanism is used to change their active and inactive states.

I highly recommend you use a relay board that uses a high on the GPIO output to activate the relay.

BTW, it's my RpiGpioSetup that sets up the GPIO pins for the 6 relays. GuiMods does have a relay overview page that controls whatever relays are present in the system.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

hallstein avatar image hallstein commented ·
Thanks, that makes perfect sense ! I have now bought a customisable 6channel relay and will case it together with the Raspberry Pi. Relays are set to activate on high current and works perfect from the relay menu screen. (Already using Venus OS 2.85 and Your fantastic SetupHelper / GuiMods etc.) My old active low relays will then be archived :-)
0 Likes 0 ·
diromobil avatar image
diromobil answered ·

Hello.

I'm a newbie and I would also like to have

my small control panel

(toggle switch for refrigerator, water pump, lighting, etc.),

which is now 20 years old, against the 7″ screen

and insert everything into the VenusOS Soft with Raspberry.

In the "SetupHelper" with Venus OS 2.85,

6 relays should be displayed and operable in the GUI.

ASK:

Which relay do you use? These ones?

3V Relais

And how is the connection to the Rasp Board?


raspberry-pi-3b-pinout.jpg

I am happy about your help.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image
Kevin Windrem answered ·

You should be able to connect any relays you want to the GPIO pins. The ones you linked to should work fine, just make sure they are set to independent for the signal input.


Refer to the gpio_list file for the pins on the header that correspond to relays 1 - 6 on the GUI. GPIO really output pins are active HIGH.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

diromobil avatar image
diromobil answered ·

Thank you Kevin.

I found the gpio_list file with the pinout in the meantime.


# Relay 1 Pin 40 / GPIO 21

# Relay 2 Pin 11 / GPIO 17

# Relay 3 Pin 13 / GPIO 27

# Relay 4 Pin 15 / GPIO 22

# Relay 5 Pin 16 / GPIO 23

# Relay 6 Pin 18 / GPIO 24

21 out relay_1

17 out relay_2

27 out relay_3

22 out relay_4

23 out relay_5

24 out relay_6


May I ask you to take a look at the drawing and see if I'm not making a mistake by connecting it like this.

relais-belegung-1.jpg


introduction-to-raspberry-pi-3-b-plus-2.png

Sorry, my knowledge is at the beginning and the possibility of providing the Raspberry with the wrong connections and thus destroying it is great.

Thanks in advance.


P.S.: The file SetupHelper "venus-data.tgz" is unpacked onto the USB stick or transferred as .tgz?






2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image
Kevin Windrem answered ·

I'm not sure how much 3.3 volt power the PI can supply so I would use a separate supply to power your relay boards. Theres a jumper on the board to isolate the input from the on-board power supply, That jumper should be in the isolate position (jumper removed). (The RPI will supply the trigger voltage.

You would connect the relay negative power pins to the RPI ground. The relay power pin would be connected to a separate 3.3 volt supply NOT the RPI 3.3 volt pin on the header. The negative side of the supply would connect to the relay negative terminal.


Do not unpack the SetupHelper venus-data.tgz file. Put it on the USB memory stick or SD card as is. If you unpack first as automatically happens on Mac OS Safari it will not be recognized. Safari can be set to disable automatic unpacking: uncheck Open "safe" files after downloading.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

diromobil avatar image
diromobil answered ·

I'm currently building the facility.

I was able to upload the SetupHelper file.

Does the file have to be called up and installed again in the GUI?

I haven't really researched the advantages and scope of SetupHelper yet.

Thank you very much for the valuable information and your tireless commitment to this cause.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image Kevin Windrem commented ·

SetupHelper is required to install RpiGpioSetup and any of my other packages.

It is also the easiest way to install other packages. Once it is installed, a PackageManager menu will appear in Settings and you can add packages from there.

Refer to the ReadMe in the SetupHelper Git Hub repo for details.

0 Likes 0 ·

Related Resources

Victron Venus OS Open Source intro page

Venus OS GitHub (please do not post to this)

Additional resources still need to be added for this topic

Raspberry Pi running Victron’s Venus firmware - Blog Post

Venus OS Large image: Signal K and Node-RED - Install

raspberrypi install venus image


Additional resources still need to be added for this topic