OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Use OSPI with watermation decoders (rs485 interface)
Tagged: OSPI watermat
- This topic has 4 replies, 2 voices, and was last updated 6 years, 6 months ago by Anonymous.
-
AuthorPosts
-
May 25, 2018 at 10:20 am #50215
AnonymousInactiveHi, I have a watermation based system where several decoders are distributed along the field. Only 2 wires run through all the decoders which are responsible for decoding the signals that travel on these 2 wires along with the 24VAC required to drive the solenoids.
I have a decoder translator that receives a set of rs485 serial codes that make all sort of things (open and close stations, kill all stations, and so on). This translator is currently driven by an arduino UNO with a rs485 shield where I have a simple program that starts watering on specific times and open stations one by one for 15 mins.
I want to convert this setup to a OSPI able to send the same serial commands to the translator. Currently I manage to install the ospi firmware to an orange pi zero I have available. The easiest way is to maintain the arduino setup and convert all the station in ospi to gpio mode (then I will have to change the arduino sketch to send proper rs485 commands when specific digital input change, and connect all the used gpio of pi to digital inputs of arduino using optocouplers, or level converters). This is the easiest way but not the best one… It would be great if I manage to send serial commands (on rs485 , using a usb->rs485 converter) directly from the orange pi.
Can anyone give me some hints on how to do this? (I am a little bit lost among all the code of the unified implementation)
Any help is welcome.
Thanks
RMMay 26, 2018 at 6:06 pm #50235
AnonymousInactiveAnother solution I consider is : arduino may be able to read the shiftregister RPI sends to the 74HC595.
probably I have to wait for a low rise on latchpin, then use shiftIn function on arduino with data pin and clock pin. Is that a valid solution?
Tested it without success until now.May 30, 2018 at 3:07 pm #50313
RayKeymasterI assume this is referring to the 2-wire system. I have never used a 2-wire system and I don’t know what’s the encoding scheme. If the encoding scheme is public, or can be reverse engineered, it should be possible to modify OpenSprinkler to control those.
May 30, 2018 at 4:32 pm #50332
AnonymousInactiveHi Ray. Thanks for your reply.
There are several 2 wire systems and each brand has its specific way of controlling remotely the valves.
This system in particular is based on a well know and probably the most common 2wire system: watermation or Tonick Watering. The essence of all 2-wire systems is the ability to use solely 2 wires, through which we feed the 24VAC for power supplying of the valves. In addition, there is a switching controlling system that cuts the initial part of each sinusoidal wave of the 24VAC to send a digital command that is understood by the decoders spread along the areas to be irrigated (it is more or less like the X10 system used in domotics for houses). No matter the basics of the 2wire system, there is always a controller able to “talk” with the 2-wire system, that usually receives a set of rs485 serial commands (which I have for my controller and have successfully implemented on an Arduino platform).
Since all the 2-wire systems I know use the same principle, a controller (also know as translatior) that receives serial commands from a programmer, that in turn feeds the valves with a manipulated 24VAC supply, I think it would be interesting to introduce such method in the OpenSprinkler system (where the user would introduce the set of commands to control the translator).
For example, my system is connected using serial rs485 and commands are like (arduino example to turn off all valves):void powerOffAll() {
byte cmd = 0x02;
byte bc = 0x00;
byte len = 0x01;
byte chk;chk = cmd + bc + len;
digitalWrite(EN, HIGH);//Enable data transmit
Serial.write(cmd);
Serial.write(bc);
Serial.write(len);
Serial.write(chk);
}May 31, 2018 at 5:09 am #50348
AnonymousInactiveMore info here:
http://www.tonick.co.uk/products/adaptor-2wire-decoders-bt2/
This is the translator required to interface any irrigation controller to any 2-wire system.
With this, along with the field decoders that one can buy anywhere, we can make an irrigation system with a single pair of wires, up to 127 stations, with the possibility to be reconfigured or redesigned anytime you want (it only requires to connect a new decoder in parallel with the 2 wires and that’s it). -
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Use OSPI with watermation decoders (rs485 interface)