Forum Replies Created
-
AuthorPosts
-
RayKeymasterFirst, make sure on the homepage you see GMT-8. If not, that means your time zone change is not correctly saved.
If that’s correct, then it might be that your router is blocking the NTP sync port 123 for some reason. OpenSprinkler uses the NTP server at 204.9.54.119 by default. If you have a linux machine, try to run the following command:
nmap -p 123 -sT 204.9.54.119
and see if it reports the port is open. If not, you may have to change corresponding settings on your router to see if you can unblock the port.
RayKeymasterVery nice work. Glad that OSPi inspired you to design your own board. A few quick comments:
– The COM (common) port just needs one pin. The reason I have two (which are connected together) is to re-use the 2p terminal block so to reduce the total number of different parts. You can get rid of one to save some space.
– Regarding PCF8591, you can easily replace it with an ADC chip of much smaller package, such as MCP3021, which provides one ADC channel and takes almost no space.
– If you want to add a rain sensor port with minimal impact to the board size, you may want to take a look at the microcontroller-based OpenSprinkler:
http://rayshobby.net/wordpress/wp-content/uploads/2013/06/os20_component_diagram-1024×599.jpg
where the rain sensor port is the blue-colors screw terminal located in the interior of the PCB.
RayKeymasterYes, if the LCD is based on i2C, then you can use it with OSPi. On OSPi 1.2, there are i2C pin headers on the right hand side of the PCB. You can use them to extend the funciontliaty of the board.
RayKeymasterFrankly I don’t think the problem is with triacs. With relays you could damage your transformer in the same way. In fact, triacs at least have internal limit on the maximum current (e.g. 800mA), while relays have literally no limit on the allowed current, so you can potentially run a much higher current through it, causing ever worse damage. Also, if you can daisy chain relays you can also daisy chain triacs. In practice, unless if we are talking about power-line devices, for low-voltage devices I would always prefer traics: they are more much compact, cheaper, and have faster switching speed.
The issue you have encountered is rather unusual. As I said, typically when the transformer is overloaded, the voltage will drop rapidly, causing the controller to reset and release all valves. Actually, now I think about it: are you powering RPi through OSPi, or do you power RPi through a USB cable? In the latter case, when the transformer is overloaded, RPi will still keep the triac open (since it’s powered separately), and I can imagine this would damage the transformer.
For flexibility, I can’t put a hardware limit to restrict the number of open stations. Many users have a master station, which should be turned on concurrently with other stations. Also, some users use OpenSprinkler to control not only sprinkler valves, but also landscape lighting. They certainly don’t want lighting to be serialized. So I can’t put a hardware limit for one station at a time. This has to be implemented as a software limit. OSPi’s interval_program is currently designed to run stations sequentially only. But it may have a bug that causes more than 1 stations to open at the same time. I will communicate with Dan about the issue.
RayKeymasterWell, 300mA is not sufficient to run more than 1 valve. Each valve draws about 180mA to 200mA current (and also the inrush current can go as high as 500mA to 600mA). Plus if you are powering RPi from OSPi (using the 3-pin cable), that will require another 100 to 150mA current. So with 300mA transformer, it’s barely enough to drive one valve plus RPi. As the OSPi user manual describes, the transformer should be rated at least 500mA.
RayKeymasterIn manual mode, ‘all selected valves’ will surely all turn on, because in manual mode you click on / select each valve to turn it on. So I assume ‘all selected valves’ mean you’ve manually selected all valves, and that should turn on all valves.
In any case, what kind of transformer do you have? Normally if the transformer is overloaded (say because it can’t drive more than 1 valve), the voltage will drop instantly, causing the controller to restart, and hence release the valves. The only issue I can think of is if you have a persistent shorting somewhere, and hence the transformer will be damaged. I think it’s important to perform further investigation before arriving at a conclusion.
RayKeymasterFirst of all, in the example you gave can be implemented with 3 programs:
program 1: 3 minutes, stations 1, 5
program 2: 6 minutes, stations 2, 4
program 3: 9 minutes, stations 3, 6
this is logically easier (and matches what I mean by consolidating the stations according to equal water time), but if you want to optimize, you can implemented it with just 2 programs:
program 1: 6 minutes, stations 2, 3, 4, 6
program 2: 3 minutes, stations 1, 3, 5, 6As I said, in most case the water time can be consolidated into a small number of groups. The more stations you have, the more likely you can consolidate. I know this is different from other sprinkler timers, but there are cases where you can argue this programming pattern is easier to set and modify than having to set one water time for each individual station.
The storage size is actually more than you thought: the start / end time and interval time each take 2 bytes (granularity of minutes), and water time takes 2 bytes (granularity of seconds). OpenSprinkler 2 supports up to 48 stations, so including the other necessary bytes each program would take a total of 105 bytes. This is quite a bit more than what the current program data structure takes, which is 17 bytes per program.
That being said, Samer and I have talked about how to have a front end that can handle different water time per program, and back end to compress it to more efficient storage. So I will think about this option.
RayKeymasterAs many relays as the number of stations.
RayKeymasterLet me explain the rationale behind having each program use the same water time for the selected stations. Since this is different from how a lot of other sprinkler controllers work, I understand it can be confusing. The main reason is that OpenSprinkler is designed to support potentially a large number of stations. The highest number I’ve seen is that one user bought one main controller plug four expansion boards, for a total of 40 stations. If each program allows a different water time for each station, this will potentially require a large amount of space to store the program data. While it won’t be an issue for OSPi (since there is plenty of space on the SD card), but on the microcontroller-based OpenSprinkler, the program data are stored in EEPROM, which has limited space. This is while most other controllers are limited to only 3 or 4 programs in total. I believe it’s due to the storage constraint.
In practice, there are seldom cases where you can’t consolidate the water time into a small number of uniform groups. For example, you can probably split all your stations into 2 or 3 groups, where each group uses the same amount of water time. As the user manual clearly explains, if you set each program to have the same start/ending and interval settings (while different water times), it will work as if it was one single program. This is overall a more efficient way to use storage.
Certainly you can change it to the other way by modifying the source code. The downside is that you will have significantly less number of programs. Hope this explains the design decision.
July 20, 2013 at 2:36 am in reply to: Can we have an option in the UI to open multiple valves? #24890
RayKeymasterPlease specify which product you are referring to, microcontroller-based OpenSprinkler, or OpenSprinkler Pi? On microcontroller-based OpenSprinkler, you can set the controller to run in concurrent mode (i.e. uncheck the ‘sequential’ option). This allows you to open valves simultaneously.
RayKeymasterSorry guys, just had time to read the thread here, and I can help answer some of the questions:
– The control of shift register is a one-way communication: the microccontroller or RPi sends command and the shift register changes state. Your program usually has a variable that stores the current state of the shift register (for example, in OpenSprinkler firmware, it’s an array called station_bits). Since the microccontroller is single-threaded, the firmware variable and the actual state of the shift register should always match. The only exception is when there are signal interference, which may cause a bit flip on the shift register. This is why the OpenSprinkler firmware refreshes shift register every second to ensure it matches the firmware variable. Now, on RPi, since you can potentially run multiple processes / threads that simultaneously write to shift register, you need to be careful to avoid concurrent writing.
– Contrary to what was mentioned in this thread earlier: when updating the 74HC595 shift register, the stations will NOT all reset, that’s why you don’t see all valves close first, and then one of them re-opens. This is because the 74HC595 shift register has a storage buffer and an output buffer. When a new byte comes in, it gets stored in the storage buffer first, and then latched to the output buffer. The ‘latching’ step is controlled by a low-to-high rise on the latching pin. Before the latching pin is pulled from low to high, you can update the storage buffer as many times as you want, and these will not be reflected in the output buffer. The shift register will ‘dump’ the storage buffer to output buffer on the low-to-high rise of the latching pin. Hope I’ve explained this clearly.
Not all shift registers have the latching pin. For example, 74HC164 does not. So whatever you are writing to the shift register gets reflected on the output immediately.
– I wrote the microcontroller-based OpenSprinkler firmware, but if you want to know more about the RPi-based version, Dan is the best person to ask. On the microcontroller, everything is serialized, and when the controller is switched from program mode to manual control mode, all stations will reset first. So there is no question of a manual control ‘interrupting’ a program — all stations would have been closed before the manual control mode is turned on.
RayKeymasterOK, I followed some posts and disabled the ‘common words’ threshold, and rebuilt the search index. Seems at least it doesn’t complain ‘too common words’ any more.
RayKeymasterFor reading rain sensor, one GPIO pin is sufficient (since most rain sensors return a digital signal, i.e. closed or open, instead of an analog signal). This is essentially the same as reading a button (pressed or released), so if you just search for how to use RPi to read a pushbutton that should work for rain sensor as well. The standard way is to use a pull-up resistor (e.g 10K), one pin goes to +3.3V, the other pin goes to one wire of the rain sensor, and the other wire of the rain sensor goes to ground.
RayKeymasterFrankly, I hate it myself. I will do some digging around to see how to make it suck less, but if anyone has set up phpBB and knows how to make the search functionality better, let me know. Thanks!
RayKeymasterBy the way, if the station name is messed up and you need to reset the station name without resetting the controller, you can use direct HTTP command, for example:
http://x.x.x.x/cs?pw=opendoor&s0=abc
will reset the first station name to abc.
RayKeymasterI see, I forgot to test the apostrophe (single quotation mark). The issue is that since the station name is provided as a javascript array of strings, and I am using apostrophe for defining a string, if you include it in your station name, that will create Javascript error, such as this one:
var snames=;
(Uncaught syntax error…)
the abc,`def’ string has a apostrophe at the end itself, so that will cause ambiguity with the apostrophe used to define a string.
So yes, for now try to avoid using single quotation mark.
RayKeymasterThese characters work fine in the microcontroller-based OpenSprinkler. Just tested and it’s displayed correctly. I recall including code that converts special characters with their HTML code back and forth. For example, ‘space’ will be stored as ‘%20’ any so on. It’s possible that the OSPi’s interval program skipped this. I will do some testing later to check.
RayKeymasterI think the subscribe feature is already enabled. At least on my side, there is a ‘Subscribe to topic’ check box at the bottom of every thread. Let me know if you can’t find it.
RayKeymasterIf your firmware version shows 1.8.2, then yes it doesn’t have concurrent running mode. If your firmware shows 1.8.3 then it should have the ‘sequential’ option.
RayKeymaster@virtus wrote:
The RF route is extreme overkill for most applications.
I understand, but personally I hate running long wires. I think RF is a more elegant solution, plus one transmitter can be programmed to talk to multiple devices. On the other hand, hard-wired solutions are more robust for sure.
RayKeymasterI second mrburns42’s reply. Yes, you only need to replace the triac for the station that you are modifying.
For connecting to relays, you can either interface with a relay directly, and make sure you have a flyback diode installed as suggested by mrburns42. Or you can use a relay board (which typically includes a flyback diode per channel). In fact, if you use a relay board that is of ‘active high’ type (i.e. a logic high activates the relay), you can just solder a wire from the corresponding shift register output to the relay channel pin, and you don’t even need to replace triac.
As a side note, on OpenSprinkler (not the Pi) v2.0 (assembled SMT version), I’ve designed PCB holes to fit the flyback diodes. These are hidden under the SMT triac. So if someone wants to interface with DC devices, they can remove the triac, and then solder a transistor together with flyback diode.
RayKeymasterYou can but it will require modifications.
1. OpenSprinkler Pi can run on 12V DC. Make sure that when you connect the DC wires to the terminal block, the pin closer to the power switch is ground, so the negative wire should go to that pin. Don’t worry if you accidentally reversed the polarity — there is a rectifier diode that protects the circuit.
2. The more tricky part is the solenoid drivers — because OpenSprinkler Pi is designed to work with AC valves, it uses triacs (ac transistors) to control valves. If you directly plug in DC valves, you will find that they can only be turned on, and once on they can never be turned off. That’s because of the way triacs work. So you will need to either replace the triacs by transistors or MOSFETs, in order to directly interface with DC valves, or you can also use an external relay board. This blog post provides some details about using relay board:
http://rayshobby.net/?p=4717
RayKeymasterNot yet. I think someone has suggested this in the forum, and I’ve put it to the list of possible features for the future firmware update.
RayKeymaster@rhc: if I understand correctly, you can activate sprinklers in manual mode, but in program mode it does not run, is this correct?
There are several potential reasons that could cause this:
– First, check the controller’s homepage and make sure it is not disabled because ‘Operation’ is set to off, or because ‘Rain delay’ is on.
– Next, check your programs and make sure they are not disabled (each program can be individually set to enabled or disabled).
– Keep in mind that due to the way program matches are detected, if you restarted the controller during a program run, or switched it from run-once or manual mode back to program mode during a program run, that program will not run again. This is because a program is only scheduled when the current time passes through the program’s start time.
– Also, check the LCD status when a program is supposed to be running, do you see any .oO animation on the station that’s supposed to be on? If not, then the program has not been scheduled, possibly due to the reason above.
RayKeymasterYour 9V valves are most likely based on latching solenoids, which means 1) they work only with DC power; 2) the circuit needs to be able to reverse the polarity of voltage applied to the valve in order to both open and close it. You can take a look at similar valves that I blogged about before:
http://rayshobby.net/blog/?p=18
http://rayshobby.net/blog/?p=12
OpenSprinkler Pi cannot be easily modified to control these valves. Instead, I have an upcoming product OpenSprinkler Bee that’s designed to work with these valves:
http://rayshobby.net/
(scroll down to check the picture of OpenSprinkler Bee, and you can also sign up to receive notification when it’s available). -
AuthorPosts