OpenSprinkler › Forums › OpenSprinkler Unified Firmware › relay partially active…. › Reply To: relay partially active….
Can I check that the four GPIO relays operate correctly it is just that the relay pump GPIO has the LED illuminated? Also, does this only happen after the RPi board is reset and before OSPi has had a chance to run a watering cycle that uses the relay pump? If that is the case then the following may help you out.
When the Raspberry Pi is reset, the GPIO pins are set by default to be inputs rather than outputs. This is a safety measure so that the GPIOs do not start driving unexpectedly behaviour in attached hardware before the software has a chance to get in control. However, some of the GPIOs in input mode are “pulled” down so that they default to read 0V whereas others are “pulled” up so they default to read 3.3V. This is all very well defined behaviour set out in the RPi GPIO specification. Unfortunately not all relay boards deal with the pull up/down difference very well.
As it happens, GPIO11 is one that is pulled down to 0V and as a result a very small current can trickle through the LED on some Relay Boards. On my SainSmart relay board it is just enough current to dimly illuminate the LED but nowhere near enough to trigger the relay. So it operates the relay correctly but just a little disconcerting that the LED can sometimes imply an incorrect state. Since you are only using 4 GPIOs, you could switch to using GPIOs 5, 6, 7 and 8 as they are all pulled high and should not flow enough current to illuminate the LEDs following a reset.
Let me know if the above helps or not as there may be other things we can try (the following youtube gives a pretty detailed explanation of how the circuitry works but not for the faint-hearted relay video 8)