OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Help with OpenSprinkler PI
- This topic is empty.
-
AuthorPosts
-
April 14, 2013 at 4:59 pm #22390
bstienstMemberI’ve got the OpenSprinkler PI. I was able to connect it all up and I’ve downloaded all the demos but I’m unable to get any of the sprinkler outputs to work.
I see that there is 24V AC between the common and one of the 24VAC inputs, but I never see any of the outputs go to 24VAC ( common -> output) when they turn on.
I’ve been able to get the RTC to work with the Raspberry PI rev B, but not any of the sprinkler zones outputs
Do you have any debugging tips?
April 14, 2013 at 5:27 pm #23497
RayKeymasterWith Pi Rev B, you need to change one pin number in the Python scripts. This is explain in the README.txt of the demo folder. For example:
https://github.com/rayshobby/opensprinkler/blob/master/OpenSprinkler%20Pi/software/demos/manual_buttons/README.txtBut even without changing this, the self-test program should still work. Were you not able to get any output voltage even running the ospi_selftest?
April 14, 2013 at 5:32 pm #23498
bstienstMemberI tried the self test program and I could not get any outputs to change.
FYI I changed the python scripts as shown, but I’m not able to get any of the programs to cause an output change.
April 14, 2013 at 6:02 pm #23499
RayKeymasterEvery board has been tested with a Pi before shipping, so the only thing I could think of is perhaps the shift register is not getting signal from the RPi correctly. Not sure what caused this, but that’s the most likely cause. The RPi sends signal to shift register through 4 pins: NOE (output enable, active low, usually pulled high, but is set to low when a program is running), LAT (latch), CLK (clock), and DAT (data). In particular the NOE pin should be set low when a program is running, otherwise the output will be disabled and hence no voltage.
Could you post a high-resolution picture of your setup?
April 14, 2013 at 7:08 pm #23500
bstienstMemberIt must be the as you described. There seems to be some difficulty getting the signal to latch in the shift register. Is there an easy place to monitor this process? My hands are not that steady to monitor the surface mounted chips.
I have been able to get an output to 24VAC, but its usually not the expected one and I usually cannot get it to turn off when I do get it turned on. So that seems to add to your theory about signal difficulties.
On a positive note, I did get the RTC clock working reliably:
$ sudo hwclock -r
Sun 14 Apr 2013 18:58:44 UTC -0.425368 secondsso at least the I2C bus is working correctly.
I attached 2 pictures. One with it all together and one with them separated. I turned it off when separating them.
April 14, 2013 at 8:07 pm #23501
RayKeymasterDo you have an oscilloscope? If so, you can connect it to any of the signal lines with ground (for example, CLK and GND) to monitor the signal.
If not, here is a hack that allows you to observe the signals: unplug the 8-pin cable from the OpenSprinkler Pi, and insert an LED (ideally with a current limiting resistor but I assume ok without) between a signal line with GND (for example, CLK and GND). Then you need to modify the code to insert delays (at least 1 second) between each toggling of the CLK line. This will allow you to watch the signals sent from RPi.
April 14, 2013 at 8:11 pm #23502
RayKeymasterBy the way, I didn’t find your attached pictures. Could you post them again?
April 14, 2013 at 9:27 pm #23503
bstienstMemberNo oscilloscope. I’m a software guy with just a multimeter. I don’t think I have any LEDs.
Your forum only takes files smaller that 256k. I missed that error message before. Here are the images as “high” res as I’m allowed.
[attachment=1:j5sn8hx4]Alltogether.jpg[/attachment:j5sn8hx4]
[attachment=0:j5sn8hx4]Seperated.jpg[/attachment:j5sn8hx4]
April 14, 2013 at 9:37 pm #23504
RayKeymasterOk, I can’t see anything obviously wrong from the pictures. Probably the best solution is for you to send it back to me, so I can take a look at the board and send a replacement if it’s defective. Please email me at [email protected] to arrange for this. Thanks.
April 15, 2013 at 2:25 pm #23505
bstienstMemberBefore I return it, I’m going to verify all the Pins on the Raspberry are doing what they are suppose to. Give me a few days to do this.
You have given me enough information on what should be happening and where to monitor the pins.
I appreciate the assistance.
I’ll let you know the outcome.
April 19, 2013 at 2:06 am #23506
bstienstMemberWell I got another Rasberry Pi from a friend, and I get the same results.
I tested each the pins with a MultiMeter using this script to toggle the output:
#!/usr/bin/env python
import time
import os
import RPi.GPIO as GPIO
import atexit
# GPIO PIN DEFINES
pin_sr_clk = 4
pin_sr_noe = 17
pin_sr_dat = 21 # NOTE: if you have a RPi rev.2, need to change this to 27
pin_sr_lat = 22
def run():
GPIO.cleanup()
# setup GPIO pins to interface with shift register
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin_sr_clk, GPIO.OUT)
GPIO.setup(pin_sr_noe, GPIO.OUT)
GPIO.setup(pin_sr_dat, GPIO.OUT)
GPIO.setup(pin_sr_lat, GPIO.OUT)
# TEST NOE = PIN 17
# while True:
# print "NOE(17) set to 0"
# GPIO.output(pin_sr_noe, False)
# time.sleep(2)
# print "NOE(17) set to 1"
# GPIO.output(pin_sr_noe, True)
# time.sleep(2)
# TEST CLK = PIN 4
# while True:
# print "CLK(4) set to 0"
# GPIO.output(pin_sr_clk, False)
# time.sleep(2)
# print "CLK(4) set to 1"
# GPIO.output(pin_sr_clk, True)
# time.sleep(2)
# TEST DAT = PIN 21
while True:
print "DAT(21) set to 0"
GPIO.output(pin_sr_dat, False)
time.sleep(2)
print "DAT(21) set to 1"
GPIO.output(pin_sr_dat, True)
time.sleep(2)
# TEST LAT = PIN 22
# while True:
# print "LAT(22) set to 0"
# GPIO.output(pin_sr_lat, False)
# time.sleep(2)
# print "LAT(22) set to 1"
# GPIO.output(pin_sr_lat, True)
# time.sleep(2)
def progexit():
GPIO.cleanup()
if __name__ == '__main__':
atexit.register(progexit)
run()
by uncommenting approriate section to see if the pin changes from 1 -> 0 ->1 and they all work as expected. I know its a bit crud, but effective.
I did not have to use 27 but I had to use 21 to get the DAT pin to work. I’m pretty sure I have a rev B board, so I’m a bit confused about that.
April 19, 2013 at 2:13 am #23507
RayKeymasterI think there are only Model A ($25) / B ($35), and rev. 1 / 2, there is no rev. B. Most RPis available on the market now are Model B rev. 2. I don’t know where you can get Model A in the US. I believe the difference between rev. 1 and 2 is that rev. 2 has two screw holes on board which rev. 1 doesn’t have.
April 19, 2013 at 2:34 am #23508
bstienstMemberAh yes. The one I borrowed is a Rev 1 with no holes thats why it needed 21. That all makes sense now.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Help with OpenSprinkler PI