OpenSprinkler › Forums › Hardware Questions › 2-Wire › Reply To: 2-Wire
I posted a reply a few days ago but it seems to have disappeared after I edited it to fix a spelling mistake. Luckily I kept a copy so here it is again:
@Ray The PWM to drive the solenoid had a fixed ON time of 10 usec and OFF time of between 90 usec and 0.125 usec. This results in a duty cycle of 10% to 99% and a frequency of 10 kHz to 99 kHz. The 10 bit A/D converter that was used to measure the current through the solenoid had a sampling period of about 6 usec. The 10 usec PWM fixed ON time was chosen to ensure that the sampling point was consistent for each PWM cycle and there was only one sample required per PWM cycle. The current control loop was simple and consisted of increasing or decreasing the PWM duty cycle by a fixed amount if the measured current was below or above the target value.
The most basic installation of a controller with multiple decoders would be for the case when the inputs to the controller are from a separate irrigation timer with standard 24 VAC solenoid outputs. I have been thinking of a simple method to program the decoder addresses for this case. One method would be to turn ON one of the irrigation timer outputs which would command the controller to send out the decoder ON command and specific address. At the desired decoder, some manual input would be required to tell the decoder that the specific address is intended for that decoder and to store that address permanently. A simple method would be a loop of wire on the decoder that gets cut to program it. Another method would be to use a magnetic sensor and a small magnet.
For the voltage waveform to send commands from the controller to the decoders, the original design used 1 msec and 2 msec pulse widths for logic 0 and 1. Another option would be to use an asynchronous method with fixed bit times similar to standard RS232 serial interface so that the interface would somewhat follow an existing standard.
One challenge of the hardware design is how to create a regulated low voltage (5V or 3.3V) from the 30V source for the decoder’s microcontroller, with high efficiency at low load current to minimize the total power consumption of the many decoders connected in parallel. My original design uses a discrete linear voltage regulator that is very low cost but not very efficient and would not be viable if additional loads were added such as an LED indicator for each decoder. Since that time, there are newer switching regulators that can operate at high input voltage and have very good efficiency at low and high load current. Although more expensive and complex, it is probably the preferred solution for system performance.
Another design challenge is surge protection to ensure that the decoders have some level of protection in case of nearby lightning strikes. I have experience in this area and a good target is for the decoder to be able to withstand 6000V 3000 amp 1.2/50 µs8/20 µs Combination Wave as defined by IEEE standard C62.41.2-2002. This level is similar to what is required for external power supplies connected to the AC mains.