# Node-red not controling all relays

**URL:** <https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210>\
**Category:** General\
**Created:** [12 February 2022 11:09 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210 "2022-02-12T11:09:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gremlyn](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Gremlyn](https://discourse.nodered.org/u/Gremlyn)\
**Post date:** [12 February 2022 11:09 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/1 "2022-02-12T11:09:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [12 February 2022 11:21 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/2 "2022-02-12T11:21:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 February 2022 11:27 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/3 "2022-02-12T11:27:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Gremlyn](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Gremlyn](https://discourse.nodered.org/u/Gremlyn)\
**Post date:** [12 February 2022 11:32 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/4 "2022-02-12T11:32:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gremlyn](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Gremlyn](https://discourse.nodered.org/u/Gremlyn)\
**Post date:** [12 February 2022 11:33 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/5 "2022-02-12T11:33:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 February 2022 11:44 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/6 "2022-02-12T11:44:49Z")

</div>

> [@Gremlyn](#):
>
> I cant seem to post my flow...says it exceeds the maximum is 32000 and I have 73000.

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.

---

<div class="post-metadata">

**Author:** ![Gremlyn](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Gremlyn](https://discourse.nodered.org/u/Gremlyn)\
**Post date:** [12 February 2022 11:54 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/7 "2022-02-12T11:54:56Z")

</div>

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

```auto
[
    {
        "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
    }
]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 February 2022 11:56 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/8 "2022-02-12T11:56:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gremlyn](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Gremlyn](https://discourse.nodered.org/u/Gremlyn)\
**Post date:** [12 February 2022 12:05 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/9 "2022-02-12T12:05:57Z")

</div>

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

````auto
[
    {
        "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"
            ]
        ]
    }
]```
````

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 February 2022 13:33 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/10 "2022-02-12T13:33:02Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/9/09edd3ea75aa70ffd1617320b75c1eaf945f9a0a.png)

---

<div class="post-metadata">

**Author:** ![Gremlyn](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Gremlyn](https://discourse.nodered.org/u/Gremlyn)\
**Post date:** [12 February 2022 17:14 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/11 "2022-02-12T17:14:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 February 2022 17:15 UTC](https://discourse.nodered.org/t/node-red-not-controling-all-relays/58210/12 "2022-02-26T17:15:32Z")

</div>

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