Node-red not controling all relays

I have a flow controlling a few relays the firsts 4 works but the other ones are not working, I have checked the pins and conections and cat find the issue.

Hi Gremlyn and welcome to the forum.

How many is a few?

You may need to expand on how these relays are controlled.
From the GPIO pins I'm taking it?

As you said you have checked the pins and connections, I would suggest this:

With a multimeter:

  • Connect the - to the - supply and get the other one and first off check the 5v pin.
  • Have all relays turned on and check the voltage on the GPIO pins. It should be 3 volts.

All that being good:

  • Get a power supply and connect it to the relay board.
  • put +3v onto all the inputs to activate the relays.
  • report back what happens.

It is hard to know exactly what is going on.
But things fail.

Alas - as painful as it can be - you need to do something like what I suggested to establish if:
a - the GPIO pins are sending +3v when they are active (and)
b - if the +3v is received by the relay board: it can turn on the relays.

Welcome to the forum @Gremlyn

What hardware are you running on and how are you driving the relays from node-red?

Have you tried connecting inject nodes directly to whatever node is controlling the relays and using those to attempt to control them?

Thank you very much Trying_to_learn.

The flow is suppose to control 6 relays, the first 4 work has expected but the other two do not work, I changed the gpio several times but never got signal, if I change the sinal from the 4ch that is working and plug it to the other relay it works, so I reckon is something to do with the code, but they all look the same...

I cant seem to post my flow...says it exceeds the maximum is 32000 and I have 73000.

Hi Colin, correct I have tried but it doesnt work, strange that some works and the others dont.

You only need to post the nodes that are giving the problem. Configure inject nodes to drive two of the relays, one that works and one that doesn't. Then select the inject nodes and the output nodes and use the Export menu selection (or Ctrl-E) to export to clipboard and paste it here. Use the </> button at the top of the entry window when pasting it in.

In this case the Zona 1 works but the A1 doesnt...

[
    {
        "id": "035ed8451a2ac365",
        "type": "ui_switch",
        "z": "426cd33342aaa7f9",
        "name": "A1",
        "label": "A1",
        "tooltip": "",
        "group": "8f1cf4ac998f6bb7",
        "order": 4,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "",
        "topicType": "str",
        "style": "",
        "onvalue": "1",
        "onvalueType": "str",
        "onicon": "",
        "oncolor": "",
        "offvalue": "0",
        "offvalueType": "str",
        "officon": "",
        "offcolor": "",
        "animate": true,
        "className": "",
        "x": 150,
        "y": 640,
        "wires": [
            [
                "c6edd1fbbf98e089"
            ]
        ]
    },
    {
        "id": "c6edd1fbbf98e089",
        "type": "link out",
        "z": "426cd33342aaa7f9",
        "name": "",
        "links": [
            "68eb83e64d5dd1f4"
        ],
        "x": 320,
        "y": 636.6666259765625,
        "wires": []
    },
    {
        "id": "8f1cf4ac998f6bb7",
        "type": "ui_group",
        "name": "19c925d8.0060aa",
        "tab": "befd4bc3ad115bfe",
        "order": 5,
        "disp": false,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "befd4bc3ad115bfe",
        "type": "ui_tab",
        "name": "Rega",
        "icon": "dashboard",
        "order": 2,
        "disabled": false,
        "hidden": false
    }
]

Please read my post again and post what I asked for. Just inject nodes and relay nodes. That way you can prove whether it is a flow problem or an h/w pi config problem.

1 Like

Something like this Colin?
Pin 37 works but the 40 dont.

[
    {
        "id": "cfbfe5d88c5adee9",
        "type": "inject",
        "z": "e6af0ba3.0b1048",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1",
        "payloadType": "str",
        "x": 350,
        "y": 2800,
        "wires": [
            [
                "417766b24b23b4df"
            ]
        ]
    },
    {
        "id": "417766b24b23b4df",
        "type": "rpi-gpio out",
        "z": "e6af0ba3.0b1048",
        "name": "",
        "pin": "21",
        "set": "",
        "level": "0",
        "freq": "",
        "out": "out",
        "bcm": true,
        "x": 580,
        "y": 2800,
        "wires": []
    },
    {
        "id": "a5556ffe078cdf16",
        "type": "inject",
        "z": "e6af0ba3.0b1048",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1",
        "payloadType": "str",
        "x": 330,
        "y": 2680,
        "wires": [
            [
                "9195d0ba6ab8fc4b"
            ]
        ]
    },
    {
        "id": "9195d0ba6ab8fc4b",
        "type": "rpi-gpio out",
        "z": "e6af0ba3.0b1048",
        "name": "",
        "pin": "26",
        "set": true,
        "level": "1",
        "freq": "",
        "out": "out",
        "bcm": true,
        "x": 580,
        "y": 2740,
        "wires": []
    },
    {
        "id": "26361ea41f5d81cd",
        "type": "inject",
        "z": "e6af0ba3.0b1048",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "str",
        "x": 330,
        "y": 2720,
        "wires": [
            [
                "9195d0ba6ab8fc4b"
            ]
        ]
    },
    {
        "id": "d18aa808e2a23fc7",
        "type": "inject",
        "z": "e6af0ba3.0b1048",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "str",
        "x": 350,
        "y": 2840,
        "wires": [
            [
                "417766b24b23b4df"
            ]
        ]
    }
]```

What model of Pi are you running on? Those show as pins 26 and 21 for me.

Hi again Colin, just left work , regarding the Pi i have the Zero 2 W and the pins were soldered by myself so after one week of fighting with the code I remembered to check them and I realized that this was the issue I have done them properly and all is working has it should.
Sorry for wasting your time I'm very very rookie.
Thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.