SIP
what is the function of pin_relay? - Printable Version

+- SIP (https://nosack.com/sipforum)
+-- Forum: SIP (Sustainable Irrigation Platform) (https://nosack.com/sipforum/forumdisplay.php?fid=1)
+--- Forum: Installation and set up questions (https://nosack.com/sipforum/forumdisplay.php?fid=2)
+--- Thread: what is the function of pin_relay? (/showthread.php?tid=255)



what is the function of pin_relay? - paul - 2021 Aug 31

Hi Dan,


In the file gpio_pins.py, there is a pin_relay assignment for raspberry-pi:


        pin_relay = gv.pin_map[10]


What is the purpose of this pin?


It is set up as an output pin, but I have no clue other than that:


        GPIO.setup(pin_relay, GPIO.OUT)


The latest incarnation of ospi hardware (v1.51) has this pin.  See attached.

Also in the schematic above, there is a second rain sensor input, labeled SR2.

Let's say like SR1, it also accepts binary input states (hi or low), but let's say its mode of operation can be either active low or active high (NC or NO).

What is the proper way to incorporate it in the SIP program?

1. Create a new plugin, or
2. Modify sip.py to include an "OR" gate that combine SR1 and SR2

Paul


RE: what is the function of pin_relay? - dan - 2021 Aug 31

Early versions of ospi hardware had a small relay onboard. The relay pin was for controlling that.

As far as adding incorporating a second rain sensor; a plugin could be used but modifying the core SIP code would be simpler. However if you modify the core program you would need to re-implement your changes after any software update.

Dan