OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Cannot identify GPIO pins for stations
- This topic has 19 replies, 10 voices, and was last updated 8 years, 1 month ago by roydon.
-
AuthorPosts
-
April 21, 2015 at 12:45 am #36971
roydonParticipantI tested v1.4 OSPi on a PI v1 and Pi 2 (model B) and only 1 IO pin (pin13) on the RPi board seems to react to the stations turning on/off. When station 1 is on, then pin13 changes voltage, but nothing happens on ANY other pins when stations 2/3/4/5 activate. Does any one else have this issue, and if so, what am I missing ? I would have expected each station to cause a different IO pin to change voltage, but so far only station 1 seems to affect any of the IO pins (again, station 1 drives pin13). Any help would be MUCH appreciated !!
April 21, 2015 at 7:28 am #36974
RayKeymasterOSPi uses a shift register to drive the solenoids, not direct GPIO pins. The shift register itself uses 4 GPIO pins.
April 21, 2015 at 10:24 am #36986
MichaelParticipantCould you list those? I’m interested in which GPIO pins I can use for different applications.
April 21, 2015 at 10:28 am #36988
SamerKeymasterThis is documented in the user manual: http://rayshobby.net/docs/ospi14_manual.pdf
April 22, 2015 at 12:40 am #36999
roydonParticipantOK, I was hoping to use a regular relay board instead of the OSPi add-on (as I can’t get the OSPi add-on in South Africa). If the app uses a shift register, then I’ll have to just control the GPIO directly via some scripts rather than using the OpenSprinkler software. Great job in designing such an awesome tool, but in my case I’ll have to find another way. Thanks for replying on this forum so rapidly !
April 22, 2015 at 3:07 pm #37014
Joshua LeasureParticipantThe sprinklers_pi script supports using the RPi’s pins directly by changing the Output option.
April 22, 2015 at 11:17 pm #37031
roydonParticipantAwesome, I’ll give this a go then !
April 23, 2015 at 10:48 am #37037
Dan in CAParticipantThe Python Interval program has a plugin specifically for using relay boards.
https://github.com/KanyonKris/sprinkler-weather/wiki/relay_board-Documentation
Dan
April 25, 2015 at 1:24 pm #37103
roydonParticipantI’m losing a bit of faith in using a PI as a sprinkler controller. I tried the sprinklers_pi application that was pre-installed on the OSPi SD card, but no matter what I set the GPIO settings to (direct positive or negative) I couldn’t get ANY of the GPIO pins to react at all when I activated a sprinkler. In fact, I set the application to Direct Negative (meaning all the GPIO pins should have been ON when no zones were active), and not a single GPIO pin was active (I tested all with a LED). If anyone has got sprinklers_pi to work, please let me know how, as from what I see thus far, it does nothing.
April 25, 2015 at 8:01 pm #37111
RayKeymasterWell, I honestly have no idea. I know for sure the sprinklers_pi program works with OSPi’s shift register. I have never tested it with direct GPIO outputs. The source code is all there, so perhaps you can add some debugging code to help find out what’s happening. By the way, make sure you are running the program with root permission — GPIO operations require root permission.
April 26, 2015 at 1:42 am #37119
Dale MarchParticipantYou can see in the attached PNG how to use the serial shift register. This diagram is for a 16 ch relay card. just use half for 8 relay card.
Dale
Attachments:
April 27, 2015 at 10:39 am #37140
roydonParticipantDoes anyone know if there is a way to get the interval application to use the GPIO directly rather than using a shift register ? Given that there isn’t any issue using 8 GPIO pins on the Pi (as there is no shortage of GPIO) I’d like to see if I can get that working rather than trying to integrate a shift register into the wiring of my relay board (which is an off-the-shelf 8 relay board off Amazon).
April 27, 2015 at 10:48 am #37141
KanyonKrisParticipantAs Dan in CA said, there is a plugin for the interval program to directly turn GPIO pins on and off.
https://github.com/KanyonKris/relay_board/wiki
I have a small collection of relay boards, active high and low and they all work with the RasPi. Some are better than others, see the link for more info. I have driven a relay board with both ospi.py and sprinkler_pi.
You say you tested GPIOs with an LED, I hope you used a current limiting resistor. The RasPi GPIOs are somewhat fragile and easy to burn out. The opto-isolated relay boards I have used have all worked fine.
April 27, 2015 at 1:06 pm #37147
roydonParticipantKris (and Dan), I am clearly guilty of seeing Dan’s original post and not really absorbing what he was saying. I’ll have a look and definitely give it a go ASAP. Thanks !
April 27, 2015 at 2:27 pm #37149
roydonParticipantKris/Dan, you guys are legends. My LED is working like a dream using the plugin with direct GPIO control happening for each sprinkler station. Thanks to you I also had to work out how to update my version of OSPi, which was seamless as well. The plugin manager worked perfectly and I now have the exact system I was hoping for. Thanks guys (+ Ray from OpenSprinkler) and keep up the awesome work !
July 10, 2015 at 12:59 am #39175
jayParticipantI’m trying to do the same project. Do you mind sharing how you wired your pi to 8 channel relay. I have seen may diagrams and none of them work for me. I was doing a direct connection from by to relay. I think I have to use an external power for the relay since my pi is not strong enough to power my relay. Because the relay would just flutter while booting. I’ll tackle the software side later on I just need to get my relay working properly
July 27, 2016 at 10:34 am #43571
kimbhootParticipantCan roydon or anybody share their secret to get this to work? Working on a similar setup and could use some help as some of these are foreign to me. I have loaded the sd card image with ospi and it’s up and running. Have a pi Model B and a 4 port relay. All connected and just need a way to enable/activate the GPIO pins from opensprinkler.
Thanks and much appreciated.
July 27, 2016 at 2:23 pm #43575
roydonParticipantThere is a plugin called ‘relay board’. Enable that, and then open sprinkler simply turns the IO pins on and off. Each IO pin can be used with each relay on the board, so that’s your sprinkler control (I’m assuming you know how a relay works, and how a relay can be used to connect the 12v power supply that drives each valve).
August 3, 2016 at 11:36 pm #43641
RayKeymasterIf you are using the official OpenSprinkler firmware, it now supports GPIO stations. You can configure any station to be a GPIO station, and turning on/off that station will simply toggle the specified GPIO pin on/off. This makes it easy to use the software with a relay board.
August 3, 2016 at 11:45 pm #43643
roydonParticipantAh, Ray’s post did make me remember something. When I originally loaded OSPI onto my Pi, I did not have an opensprinkler adapter board, I was trying to use the PI IO directly to control the relays on my separate relay board. At that time OSPI was not able to support this, it only worked with the opensprinkler board itself (as it’s logic was to use the IO pins on a sort of bitwise method that then controlled the opensprinkler board). As a result, I had to install SIP (developed by Dan-in-CA) from github. I stand open to correction but SIP was 1 of the front-end applications that ran on top of open sprinkler. That worked perfectly for me once I’d installed that along with the ‘relay board’ plugin.
If OSPI can now support GPIO control on the PI motherboard directly then that’s great !
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Cannot identify GPIO pins for stations