Picaxe controlled garden water sprinkler

David HK

New Member
I own a commercial garden water sprinkler and would like to make a replica controller using a PICAXE.

This is how the existing machine works:-

On/Off switch.

Switch to On, for programming press OK.

Press Time button. Red LED flashes, select hour. This is done using what seems to be a 24 position rotary switch. Turn the switch to the hour you are at – e.g. 15 (3pm). Press OK

Press Start Time. Next, Start Time LED flashes. Select from 1 to 24, turn switch accordingly to 15 (3 pm for example) Press OK.

Press Frequency. Next is the choice of 8, 12, 24, hours, and 2, 3, 7 days. Select whichever. Press OK.

Press Run Time. Next is the choice 1, 3, 5, 7, minutes with carious choices up to 180 minutes. Res LED flashes. Press OK.

And from this point on the machine will faithfully work for about one year on a standard 9 volt battery.

More technical detail.

The water valve unit is a latching type and at the required On time the electronics emit a momentary pulse which energises a solenoid thus releasing pressure on a diaphragm and allowing water to flow. On the connecting plug between the detachable electronic controller and the body of the valve - which includes the solenoid coil - I have discovered that the centre pin is at negative whilst the outer contact is at positive and the pulse voltage is at about 3 volts. Measured by a fast eye on an analogue meter.

Whilst water is flowing no power is supplied to the solenoid.

To switch off the water supply a second pulse is sent to the solenoid but this time the polarity arrangements are a reverse of the above.

The solenoid coil resistance is 34 Ohms.

After viewing this website for many years and obtaining much satisfaction from the good advice given, plus the success of projects especially those with problems that finally resolve themselves, I think I shall give it ago.

As for myself I am British, 62 going on 63 years, self taught in basic electronics, technically minded and live in Hong Kong. I have my own renewable energy system in my home using automatic sun tracking photo-voltaic cells. Electronics control and protect the battery storage system, with a suitable dump load arrangement. I also have a self made solar hot water system which has been in operation for about five years and has now paid for itself. I am keenly aware of your regular advice about power supplies for Picaxes, and interfacing with LCD’s, 7 segment displays, post a photograph, post your code and post a circuit. My programming experience goes back to Apple II Plus days and building the software and hardware to flash my Christmas tree lights.

I can follow basic electronic circuits and have experience drawing my own circuit boards using PCB Express.

After searching the Internet and studying all my circuit books the only thing I cannot fathom out is how to achieve polarity switching without the use of relays. I believe the change of polarity is something to do with push/pull from the solenoid.

If I manage to reach this goal I plan a later circuit using a 12 volt DC supply from my home renewable energy system and a solenoid that requires energizing whilst water is flowing. The reason for this is that my RE system produces too much energy for my needs and I keep looking for ways to use it.

To conclude, can I use a 08M for my proposed project? Displays are not required and LED indicators are fine.

David
 

cdngunner

Senior Member
Any info on the solenoid manufacturer?

I have worked in greenhouse automation and have never come across a solenoid as you describe it.

Ah now I see.......mostly used for battery operated systems.....google is my friend.

Fets, mosfets or something similar, I am not up on my electronics but it should be done easily enough.
 
Last edited:

David HK

New Member
The sprinkler brand is well known throughout Europe and the world. I am reluctant to mention it publicly in case I upset the moderators. Try the seventh letter of the alphabet.
Rest assured that the polarity switching is exactly as described,
I suspect much of the electronics and plastic casings are made in China under licence etc.

David
 

cdngunner

Senior Member
FYI about these latching valves

Latching solenoids are activated in the same manner as a traditional non-latching solenoid. The controller sends a positive pulse to the DC latching solenoid causing the solenoid plunger to “pull up” which drains the upper chamber of the valve. This causes the diaphragm to lift off the valve seat which allows the valve to open (turn on).This is where the similarities end.



In standard non-latching solenoids, in which the traditional controller must provide a constant power supply to the solenoid coil to hold the plunger up, the direct current (DC) latching solenoid plunger is held in place by the magnetic field generated by the magnet around the bottom of the solenoid cavity. When the irrigation program is finished, the battery-powered controller sends a very short negative pulse to the DC latching solenoid, causing the plunger to drop. This allows the upper chamber to fill with water, causing the diaphragm to seal against the valve seat and close the valve. These short pulses consume very little battery power, allowing a battery-powered controller to work for many, many cycles.
 

marks

Senior Member
Nah! get an 18m2 lol

For retic you can get dc solenoids and latching solenoids but are very expensive!


I was planning one day to do just that make a retic controller that operates from 12v dc,
instead of the normal 24vac.(using my existing solenoid coils.)

Here the most common retic solenoid is 24v ac but we can operate it from 12 vdc.
We need 12v dc to ensure pickup.
But the coil will get warm at this voltage.
Then we need to reduce voltage( lets say to its nomal operating current)
guessing lets say 8v dc(or we could just pulse it lol).
Good idea to workout dropaway voltage could be very low.

You'll really need to do some testing on the actual coils you 'll be using
hope this helps lol.
http://www.picaxeforum.co.uk/showthread.php?t=14968&highlight=retic
 
Last edited:

westaust55

Moderator
can I use a 08M for my proposed project? Displays are not required and LED indicators are fine.

David
Lets see:

1 input for going into program mode,
1 input for time button
1 input for start button
1 input for frequency button
1 input for the OK button
5 inputs for a 24 position rotary switch
1 output for RED LED
2 outputs for the latching solenoid control​


And from this point on the machine will faithfully work for about one year on a standard 9 volt battery.
So we also need a Real Time Clock chips for long term accuracy.
2 pins needed for i2c comms

The 08M has a total of 5 IO pins and 256 bytes of program space, but we seemingly need at least 15 pins and i2c capability and likely a lot more programming space.

The 18M2 has 15 IO pins (and 2048 bytes of program space) that could just squeeze the above requirements in if we reconfigure the SerialIn pin.

A better selection IMHO would be the 20X2 (with 4096 bytes of program space).

Other options might include varying the functionality to use a keypad in place of all the switches and an LCD display to show the settings while programming. This could give a more versatile reticulation controller rather than just duplicate the controller you describe (which is akin to one I had pre 1980 in terms of the rotary switch type scheme).
 
Last edited:

Dippy

Moderator
I agree with Westy ; go for the 20X2 and RTC.
The last you want is to run into pin-count or programme space issues simply for saving a quid.

As far as the output is concerned you could use a latching relay.
A suitable MOSFET switch would be fine as an alternative.
With careful use of Sleep/Hibernate and switching/code you could make an efficient low power device if you want to power by battery.
And careful selection of peripheral semis (including any regulation) of course.


I reckon Marks should change his name to Giggles as he "lol"s so much :)
 

geoff07

Senior Member
I have one of these gubbins in my garden as well and mine works off a PP3 i.e. 9 volts. It is as you describe.

To drive the solenoid I think you need an 'H' bridge as per driving motors forwards and in reverse.

This explains:

http://en.wikipedia.org/wiki/H_bridge

The chip you want is the L293D, this might help:

http://www.techsupplies.co.uk/epages/Store.sf/en_GB/?ObjectPath=/Shops/Store.TechSupplies/Products/AXE023

As an aside, bistable relays are also available (i.e.. no hold-on current) for £2.91:

http://www.ciseco.co.uk/content/?page_id=1646

As another aside, has anyone ever got their very expensive Garden moisture-detector thingy to work? It is a ceramic spike with an osmotic function and a diaphragm that operates a switch. Or not, in my case.

Finally, my experience is that the timer thing is fit-and-forget, so you don't need all those buttons, just pre-program a few cycles, forget actual clock time and maybe use some form of dawn sensing to set a counter. One button could then cycle between states and one led could tell you which state you are in. The 08M might do it but is short on code space. We need the 08M2 (when/if Microchip produce a suitable underlying chip).
 
Last edited:

westaust55

Moderator
While there is discussion on the reticulation controller running from 9Vdc battery, the typical controller here in Australia runs from mains power via a plug pack / wall wart usually at 24Vac and the 9V dc from the battery is purely to keep the core functions (cpu, timer and setting) operating and not being lost in the event of a mains failure.

The need for a time clock will depend whether in Hong Kong one is permitted to or even needs to water every day is another factor.
By comparison, in Australia due to declining rainfall (albeit that some states have recently have major flooding).there are regulations which dictate on what days and at what times one is permitted to water. In some states, use of sprinklers is banned completely.
For many plants, a good watering every second or third day may promote better root development than a lesser watering every day.

Thus there is no point in guessing what David requires in Hong Kong to suit the local conditions, plant types involved and regulations. We need more information from David himself.
 

geoff07

Senior Member
The commercial product that David is planning to emulate (I'm guessing here as we aren't using the trade name) provides programmes for the following:

00 no program,
01 3 mins of water 4 times a day,
02 3 mins water twice a day,
03 15 mins twice a day,
04 3 mins once a day,
05 5 mins once a day
06 30 mins once a day
07 60 mins once a day
08 5 mins every 48 hours
09 30 mins every 48 hours
10 60 mins every 48 hours
11 30 mins every 3 days
12 60 mins every 3 days
13 60 mins every week
14 120mins every 7 days

But I think any of these could be done without a clock, more easily if a reliable dawn/dusk sensor could be created, which shouldn't be too hard, especially with the approx constant day/night length in the tropics. It is unlikely that anyone would need many of these sequences, and in my case is always set on the same programme.

Perhaps surprisingly, the only power source (apart from water pressure which is used to maintain the on or off setting) is the PP3, hence the need for a valve that does not require a hold-on current. It is a very clever little gizmo.

Generally these devices are used for drip-feed watering, which is much more water-efficient than sprinklers.
 

David HK

New Member
Hello everybody,

Thank you all for taking a few minutes to read this thread and make a contribution.

I can expand on a few points. Hong Kong has no laws to control the use of sprinklers and water hoses at this point in time. Our water supply comes from the Pearl River estuary above the salinity line, and is pumped along large bore pipes to various treatment plants before being diverted into reservoirs. Each year the Pearl River becomes increasingly polluted so the headache of filtration and polishing costs the taxpayer more money.

In my backyard I have marble tile crazy paving sitting out area which is surrounded on three sides by a flower/shrub bed and a large mango tree. I also have a stainless steel trolley tack welded together to hold 48 pots of various orchids and small flowering shrubs. “The older you get the less work you want”. I get on my knees and hand scrub the back yard two or three times a year and the prospect of moving 49 individual pots to and fro involves a great deal of effort, hence the trolley which moves the entire lot in one go.

My Chinese wife is a dab hand with a hosepipe. She not only manages to water the plants each morning, but she successfully sprays water over the gardens of neighbours on three sides. Even the top of the mango tree is wet from time to time. I am forever scolding her for wasting water hence the installation of a proprietary water controller (Gardena).

Now we come to important things. All I need from my ‘controller’ is this.

An On/Off switch.
A frequency time of 6 am, option on Noon and another sprinkle at 6pm.
Duration of watering time – an option for 3, 5 or 7 minutes is sufficient.
Output control to solenoid driver.

I do not need a mass of other timing options and the majority of those I do have on the current machine I shall never use.

Timing to the exact hour of the day would be useful.
LCD display no problem. I have experience with these on standard PIC’s but not PicAxes.
Keyboard entry – no experience, but have read about it, LCD’s, solenoid interfacing in the PicAxe manuals.

I must pay tribute to West Aust for his time and thoughts and after reading his definition that is the way I had planned to go in Phase II. For reference this is using my 12 volt DC renewable energy system and a solenoid that is permanently energized during its On time. These solenoids are readily available in Hong Kong shops.

Having thought about all the comments, I think the best way to proceed is to opt for my Phase II plan mentioned in the above paragraph.

I should therefore be most grateful if readers could reflect once again on the size/type of PicAxe that would be suitable for this application.

David
 

geoff07

Senior Member
An 035 high power project board (with the mosfets to drive the solenoid), and 18M2, and an old quartz alarm clock should do it with minimum hardware effort. The clock is so you can remove the impulse gubbins from the clock to provide a 1Hz tick. That should allow you to tell the time with a little calculation, if you want that degree of precision. Otherwise just count pauses in the program.

The 18M2 has the speed, program space and I/O connections to do what you want.

My greenhouse is watered from a mains supply, controlled from a 12v solenoid, and timed by a little 12 controller I found on the internet, powered off a little gel battery and a solar panel, and has worked well for a long time.

If your 6am and 6pm bursts could be at dawn and dusk (roughly at around that time I expect) then they could be sensed optically, and you could simply count and divide the time between them to set noon (not on day 1 of course).
 
Top