Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC based irrigation system

Status
Not open for further replies.

gregmcc

Member
I'm thinking of building a PIC based (16f628) irrigation system that would switch on and off certain zones for different time periods - pretty much like the commercial ones you get.

My question is that it sounds simple enough - I just have a pic running with a RTC and the software allows you to program certain zones which will switch on and off values. Has anyone built something like this before? Is it as simple as it sounds :)

The commercial ones look pretty nice but they are expensive here. Surely its better to build one?

Any comments?
 
I've done RTCC on an 16F877 in the past, also the dragonfly kit (see my site) has a 16F886 clock in assembler in the back of the manual.
The 16F628A should be fine for your project. May I suggest a 32.768 kHz crystal as it makes for a great timebase, more than fast enough for a sprinkler system and it'll draw very little current.
If you connect the 32kHz crystal to TIMER1's instead (like the dragonfly) you can put the PIC to sleep and it can be programmed to automatically wake up every 2 seconds to do its thing.
 
a crystal will be more acurate over time than a RC network that after a few days will start to go fast or slow especially if outdoors with all that temperature changing
 
you may include external sensor for your project to give a butter ( real ) control. Sensors such as LDR, Soil Humedity and even Temperature sensor.
 
Thanks Bill - its given me a good few ideas. My clock is almost working
:)

For the moment I just want to turn on and off values - maybe I"ll add external sensors at a later stage. Nice idea though.
 
We get hot winds. It does not work to spray water into a 50 miles per hour wend. I have a very simple wend detector. It is a tin can on a broomstick. When the wind blows the can bumps against the pole and closes the circuit signaling that we should not water now but later when the wind is lower.
 
I tried building one of these, but I got bogged down in the details instead of just getting it done simply. That's my problem I guess, I keep adding stuff and adding stuff and then it's turned into a monster

I'd built a prototype; it worked well and I learned a few things, and then sent off to have some boards fabricated. They came back quickly and looked awesome. I built one, programmed it, and it worked great... on the bench

In the field, I had problems with power. The sprinkler valves wanted 12-24 VAC, and the controller wanted 5 VDC. I tried building linear regulator with a rectifier to go from the ~18vac my transformer put out to the 5vdc the controller wanted, but it kept over heating, even with a generous heat sink because the controller took a rather generous amount of current at times (getting back to the over-complicatedness). So I tried to build a smps to step down the voltage. That didn't last too long, I hadn't protected the switcher well enough and transients from the valves killed it. I built another smps, better protected and heavier duty. This worked well, the events were running, the valves opening and closing on demand, etc.

Then the rains came. I knew water ingress would be a problem, and I tried to plan for it, but didn't do enough. The controller's keypad was built as a capacitive touch sensor, so I didn't need to drill any holes for it, however, the LCD display needed a portal. I very carefully cut a rectangle in my enclosure a little smaller than the lcd... then I carefully ground down the sides until the lcd just fit. After it was fit into its hole, I sealed both sides with outdoor rated latex caulk.

None of that mattered to the rain. One brief shower while I was away ruined it all. Rain filled the display and shorted it out, luckily not permanently. Rain also got into the controller board somehow, which was suspended inside the box on standoffs and shorted it out.

This year I plan to house the controller indoors. It will have it's own 5v power supply, and live in my crawlspace.

Here's the pcb ... it's got more bells and whistles than most could shake a stick at, yet it can't protect itself from water ingress! I don't have any pictures of the controller put together as my camera crapped out while I was working on it.
https://projects.dimension-x.net/pictures/sprinkler/pcb5_cmp_aft_sm.jpg
 
justDIY: Very nice PCB, I'm working on a relay board to control a 24VAC furnace. What is common to all furnace relays are snubbers on the contacts. I wonder if that would help in a sprinkler design?

gregmcc: How many sprinklers are you trying to control? Do you want different programs for days of the week?
 
justDIY said:
Then the rains came.

This year I plan to house the controller indoors. It will have it's own 5v power supply, and live in my crawlspace.
In my business I do the odd irrigation job and, though you can buy outdoor timers, I always buy indoor timers because (1) they're cheap, (2) no locks required to keep people out, (3) it's dry indoors :p, (4) easy access to power (they run off a small wall-wart).

The cheapy 4-zone timers are $40ish IIRC (my supplier stocks Nelson Turf). Cheap enough to buy one, open it up and have a look at how it's done commercially if you wanted to. They're well made and reliable, nice LCD, battery backup, plenty of program options.

The zone valves are outside buried in a green-box. They're waterproof, and the wire connections are done with King-Connects, waterproof wire nuts filled with silicone grease. The zone valve box gets fed with a direct-bury multi-conductor cable from the timer. But you probably already know all this. :D
 
Last edited:
blueroomelectronics said:
justDIY: Very nice PCB, I'm working on a relay board to control a 24VAC furnace. What is common to all furnace relays are snubbers on the contacts. I wonder if that would help in a sprinkler design?

Is an RC snubber adequate for an inductive AC load, or is something more exotic called for. I have a MOV installed on the supply line for the relays, and I have two in parallel at the switcher.

Plan B separates the AC and DC supplies completely, so other than EMI there shouldn't be any problem with transients.
 
Weather info at any time

If weather info is required you can add this complement. Bateryless 365x24
 

Attachments

  • Piedra meteorológica.jpg
    Piedra meteorológica.jpg
    29.8 KB · Views: 233
Bill - I was thinking of building one that controlled 4 zones - 2 zones for lawn areas, and 2 for the flower beds. The 4 zones would come on and off at different times during the week. For the time being I'm not going to worry about soil/wind/humity sensors. If I see its going to rain I'll just disable watering for that day. :)
 
you could have a simple moisture tester circuit so that the irrigator can verify if it needs to water or if to water less the resistance of the ground should change shouldn't it ?
 
atferrari said:
If weather info is required you can add this complement. Bateryless 365x24

ah yes very accurate, how do we interface a pic with it ?
 
atferrari said:
If weather info is required you can add this complement. Bateryless 365x24

Thunderchild said:
ah yes very accurate, how do we interface a pic with it ?

Interfacing a pic with it would be a great Graduating Project :D
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top