- This topic has 7 replies, 3 voices, and was last updated 7 years ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Relais are inverse
Depending on what relay you use: if you use off-the-shelf relay module, sometimes they are ‘active low’, so the logic is reversed.
Thanks for this answer. This is correct. I use this off-the-shelf relay modul.
Is it possible to change this in the source code on the OSPI?
Each relay has two contact pins, one is normally open (NO) one is normally closed (NC). Why not just use the other contact pin, which counteracts the reversed logic.
Thanks for your help, Ray.
I just decided to use transistors 2n3904 as shown in this picture
I connected a 74HC595N to a raspberry pi and I had the same problem, by default all relais are on. To solve the problem
I edit OpenSprinkler.cpp on the OpenSprinkler-firmware directory and in the function “OpenSprinkler::apply_all_station_bits()” at line 1079 add a “~” like this: “digitalWrite(pin_sr_data, (~sbits & ((byte)1<<(7-s))) ? HIGH : LOW );” and recompile the firmware.
Thanks for this great point! I just have a question. How should I compile it for raspberry pi?
Would it also work if I copy all the content from https://github.com/OpenSprinkler/OpenSprinkler-Firmware to my own github account and change the OpenSprinkler.cpp there?
I think so, but I gitclone directly to my raspberry pi according to this instructions “https://openthings.freshdesk.com/support/solutions/articles/5000631599-installing-and-updating-the-unified-firmware”, modify the “OpenSprinkler.cpp” on the “OpenSprinkler-Firmware” directory on the raspberry pi and rebuild with “sudo ./build.sh ospi”
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Relais are inverse