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.

Using PIC or not?

Status
Not open for further replies.

vinke

New Member
Hey guys,
Im faced with a dilemma. Heres the point: I want to implement an automated irrigation system but is indecisive about implementing it using only hardware or using a micro controller based system. The irrigation system will comprise of humidity sensors as input to the system, they will be placed in the soil and when the humidity content of the soil goes below a preset value the system should give an output to activate solenoid water valves and when the humidity of the soil goes above a max value the system should stop irrigation.
It might be simpler using a pic but would it be cost effective rather than using simple hardware?
An important point is that the whole system will be powered by batteries which will be charged using solar power.
 
vinke said:
It might be simpler using a pic but would it be cost effective rather than using simple hardware?

A microcontroller is the most cost effective solution as only a single IC is needed. It allows for multiple channels of sensor inputs and driving signal output.

It also has the added capability of dealing with possible sensor failure if the expected result from any sensor is outside of "normal" range.

You can also reduce the current consumption dramatically by connecting the microcontroller outputs to latching relays or MOSFET depending on the type of solenoid valves. As soil humidity don't change rapidly, the software can even program the microcontroller to go into SLEEP mode and only performs its measurement once every seconds or minutes, consuming virtually no power between each measurement.
 
thank you buddy.
what type of micro controller would you advise me to use then? I was thinking to use the 16f84A PIC. Is there cheaper PIC that can do the job? Im quite a novice in that field, some suggestions would be well welcomed!!
Umm, if I got only about 4-5 months to implement that system, could I learn the programming language for the PIC within that time frame.(I have done C++, assembly language for the Intel 8085, and also conversent with Matlab.)
 
vinke said:
what type of micro controller would you advise me to use then? I was thinking to use the 16f84A PIC.

The PIC16F84A *might* not have the hardware you need: if the sensors have analog outputs, you need a microcontroller with comparators or A/D converters.
The PIC16F84A is considered obsolete now and it is not cost effective.

Small PICs look interesting when you need few I/O lines. Can you already say how many input and output pins you need?
 
Last edited:
eng1 said:
The PIC16F84A *might* not have the hardware you need: if the sensors have analog outputs, you need a microcontroller with comparators or A/D converters.
The PIC16F84A is considered obsolete now and it is not cost effective.

Small PICs look interesting when you need few I/O lines. Can you already say how many input and output pins you need?

Well, the sensors have analog outputs. A single input pin could be sufficient as I was thinking of multiplexing the sensors outputs. Whereas for the output I was thinking to use the 8 bit data bus interfaced with a decoder to have many possible outputs. See I wana a system that can retrieve data from many as possible sensors and drive many as possible outputs .But not at the same time, it would be like a time-multiplexed system.Wat you think?
 
vinke said:
Well, the sensors have analog outputs. A single input pin could be sufficient as I was thinking of multiplexing the sensors outputs. Whereas for the output I was thinking to use the 8 bit data bus interfaced with a decoder to have many possible outputs. See I wana a system that can retrieve data from many as possible sensors and drive many as possible outputs .But not at the same time, it would be like a time-multiplexed system.Wat you think?

As suggested, don't even consider the 16F84, it was obselete last century - it's replacement was the cheaper, higher spec, 16F628 - but that doesn't include A2D either. For an 18 pin PIC with A2D, try the 16F819 or 16F88, although you may be better going for a larger device, something like the 40 pin 16F877 perhaps?.
 
As suggested, don't even consider the 16F84, it was obselete last century - it's replacement was the cheaper, higher spec, 16F628 - but that doesn't include A2D either. For an 18 pin PIC with A2D, try the 16F819 or 16F88, although you may be better going for a larger device, something like the 40 pin 16F877 perhaps?.

Thanks dude,
As I said earlier I never worked with PICs before, I would to know if its hard to
understand and program it?how much time would I have to spent in it, I dnt wana either become an expert in PIC, just the necessary!
 
Much of what you need is covered in my tutorials, PIC assembler is fairly easy to learn anyway, as there's only 35 instructions for the mid-range devices.
 
Attached is a ATtiny13 based pump controller, but could be used in different ways. Pretty much what you are looking for as is. Don't remember where I found it, and have gotten around to testing it.
 

Attachments

  • pump.zip
    267.6 KB · Views: 162
Hey Harvey,
its pretty much what im trying to do,though its much simpler than wat i intend to do.I also use a solar panel. But ill also include a keypad and a display for the user to input the range of humidity reguired for irrigation.
Neways thanks for the file,it will surely help.
 
You could use a microchip PicKit 2 programmer with the debug express (16f887 & 44 pins). Or a new demo board (DM4120-5) that has the PIC18F87J10, giving you 64/80 pins to fool with. Must be a new part tho, because not seeing on Digikey or Mouser sites. Whoops, only 1K of flash write cycles.:eek:
 
What do you plan to use for sensing the humidity content of the soil? Would like to hear that it can be done inexpensively.

Large pin count processors are inexpensive. Are you sure you need to multiplex?

The 40 pin PIC18F4220-I/P has 36 IO lines of which 13 can be used as analog inputs.

An expandable system would be interesting. Maybe have the add-on units talk to the main over I2c. Maybe 10 or 12 zones per box.
 
My take on a pump controller. IMHO a kiss design would keep it cheap and reliable.

  • No keypad, and only a single LED display for status
  • rtc clock done in software with supercap backup
  • 32768 crystal, low cost, power etc...
  • Roman Black switching power suppy more efficent than a linear regulator and simple in design.
  • iButton **broken link removed** programmable
The DS1994 has a binary real time clock, 10yr battery, 4K bit of NVRAM and lots of code on the net for PICs.

**broken link removed**

You would sync your iButton to your PCs clock with the simple and cheap reader/writer from www.ibutton.com you could also enter pump on / off settings into the 4K of RAM

You would then program your pump controllers by simply touching them to the ibutton touch (pictured above) and your done. They're weather proof, cheap and easy to use. A weatherproof keypad would cost you more.

Food for thought.
 
blueroomelectronics said:
My take on a pump controller. IMHO a kiss design would keep it cheap and reliable.

  • No keypad, and only a single LED display for status
  • rtc clock done in software with supercap backup
  • 32768 crystal, low cost, power etc...
  • Roman Black switching power suppy more efficent than a linear regulator and simple in design.
  • iButton **broken link removed** programmable
The DS1994 has a binary real time clock, 10yr battery, 4K bit of NVRAM and lots of code on the net for PICs.


You would sync your iButton to your PCs clock with the simple and cheap reader/writer from www.ibutton.com you could also enter pump on / off settings into the 4K of RAM

You would then program your pump controllers by simply touching them to the ibutton touch (pictured above) and your done. They're weather proof, cheap and easy to use. A weatherproof keypad would cost you more.

Food for thought.
Hey dude thank you very much for your ideas, but the problem is that these devices (iButton..etc) are not easily accessible in my region(perhaps we dnt have them though). When I said keypad, I was thinking of a simple up-down buttons connected to an up-down BCD counter and displayed via two 7-segment LED,and interfaced with the micro-processor.
 
3v0 said:
What do you plan to use for sensing the humidity content of the soil? Would like to hear that it can be done inexpensively.

Large pin count processors are inexpensive. Are you sure you need to multiplex?

The 40 pin PIC18F4220-I/P has 36 IO lines of which 13 can be used as analog inputs.

An expandable system would be interesting. Maybe have the add-on units talk to the main over I2c. Maybe 10 or 12 zones per box.
Well Im not fixed yet on what type of sensors to use, perhaps the IH3602-C, it already gives an output of 0.8 to 4.0 V over the 0 to 100% relative humidity range.Of course there will be some signal conditioning. By how much is the PIC18F4220 more expensive than the PIC 16F628, if it is more expensive, i dnt know me.
 
By how much is the PIC18F4220 more expensive than the PIC 16F628
Go with the 18F series PIC. Microchip makes a free C compiler for this series of chip. Since you already know C++, going to C will be easier than assembler, though PIC assembler is pretty easy on the 16F series.
 
Last edited:
vinke said:
Well Im not fixed yet on what type of sensors to use, perhaps the IH3602-C, it already gives an output of 0.8 to 4.0 V over the 0 to 100% relative humidity range.Of course there will be some signal conditioning. By how much is the PIC18F4220 more expensive than the PIC 16F628, if it is more expensive, i dnt know me.

In Canada the 18F2525 is about $14, the 16F886 about $5

PS the 16F628 would be a bad choice if you need to measure that IH3602-C. Almost any PIC with an A/D is a better choice, like the 16F88.
 
vinke said:
Well Im not fixed yet on what type of sensors to use, perhaps the IH3602-C, it already gives an output of 0.8 to 4.0 V over the 0 to 100% relative humidity range.Of course there will be some signal conditioning. By how much is the PIC18F4220 more expensive than the PIC 16F628, if it is more expensive, i dnt know me.

Do not know what part of the world you are in so I will quote US prices.

Newark has the PIC18F4220 for $5.18 and the PIC16F88 for $2.60.

If you are not in the US you can get them for a bit less from Microchip Direct but I understand the shipping in about $16.

Note that if you can handle surface mount parts you can get PICs with 80 and 100 pins.

I did not have much luck finding a place to buy the IH3602-C. Is it obsolete?
 
3v0 said:
I did not have much luck finding a place to buy the IH3602-C. Is it obsolete?
Thanks for the prices dude.
You can have the IH3602-C from Microswitch/Hycal Sensing products,Freeport, IL
 
eblc1388 said:
A microcontroller is the most cost effective solution as only a single IC is needed. It allows for multiple channels of sensor inputs and driving signal output.

It also has the added capability of dealing with possible sensor failure if the expected result from any sensor is outside of "normal" range.

You can also reduce the current consumption dramatically by connecting the microcontroller outputs to latching relays or MOSFET depending on the type of solenoid valves. As soil humidity don't change rapidly, the software can even program the microcontroller to go into SLEEP mode and only performs its measurement once every seconds or minutes, consuming virtually no power between each measurement.


You must have been reading my mind and reading it for the past 7 years. It cannot be streased enough to use a versatile resource. Damn good post too.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top