How to change default state off Raspi pins at start node red service

Hi ,

Pretty new on Node Red, I want to make a water irrigation for my garden with 2 watervalves and 1 waterflow control for security. (later on some moisture sensors and so on)
First of all the 2 watervalves are planned to be activatet from 5 volt relays on a pi zero.

When node red starts it put my pin's state connectet to the relays low , which results in triggering the relays and opens the water flow(because the relays are low level triggered).

This results in a åben watervalve when reboot RaspOS or start node red service.
Very bad i my situation, water shall not flow just at starting node red.

I'm looking for a solution:
• Why is node red somehow take control over the pins state ?
• Is it possible to design the node red flow to put the pins high at start node red?

I I prefer not to change the relays or modify them with soldering because of possible more errors.
I want to learn more about the behavior of node red instead.

MORE INFO:
Pins connectet 11 and 36 state of both pins are:
1 AND IN when node red is not running

Pins connectet 11 and 36, state of both pins are:
0 and OUT when node red is running.I guess the flow is running as well.

I read the pins with "gpio readall" command
Pin numbers are physical pin numbers.

I will be grateful for some help here :slight_smile:

Is it node red doing it or are you seeing what happens before node red gets going? Stop node red from starting on boot in order to check that.

If it is definitely node-red then show us how you have configured the pins in node-red. In other words how have you configured the GPIO nodes that control those pins?

Buy other relays that are active high or add an inverter transistor.

Hej Colin Thanks for your reply , it is node red doing it for sure i,am nearly 100 % sure: gpio readall pins at booting Pi shows all pins in high state , dubbel checked it with toggling between node-red-start and node-red-stop (stops the NR service) and these 2 pins go high again when node red service stops.

PIN READING WITH NODE RED SERVICE STOPPED , :

PIN READING WHEN NR SERVICE STARTET PIN 11 AND 36 CHANGED STATE TO LOW:

I note that physical pin 11 in your first image is high (1) and in IN mode while in the second image it is low (0) and in OUT mode....

Just as a start 2 inject nodes, one with payload 0 and one with pay load 1
2 gpio nodes with digital output and afcours the pin in question.
INJECT NODE PIN 11:
image

RPI GPIO NODE:

Hi zenofmud , Correct and this happens when node red starts , thats my question , Why is node red doing this? these pins are connectet to a relay that low triggers. :slight_smile:

In the image you have posted you have told it to initialise the pin low. If you want it initialised high then change that.

1 Like

Great , I changed the initialised pin to 1 and that solved the problem, Thanks a lot Colin ! :slight_smile:

1 Like

Thx Edje but i do not wan't to change the hardware at first. I want to know what is going on in Node Red first.

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