Programming - Solenoid valve in an irrigation system

Bellon

Sep 20, 2015
10
Joined
Sep 20, 2015
Messages
10
Hello!
I'm doing a system for irrigation and me there were some questions about the schedule. I'm using a PIC18F4550 and programming in C language (I'm at the very beginning of the program).
In the picture I am sending, has a connector which will put the solenoid valve that will open and close the record of water for irrigation of the garden. However, I have no idea how to program this part. I know that the first to do is read the value in RA2 (pin PIC) that appears in the schematic there and see if it is in the humidity range of suitable soil. But it needs to be irrigated, how do I start watering?
Thank you very much to help me. If you need some more data is only talk.

14234435.png
 

Minder

Apr 24, 2015
3,561
Joined
Apr 24, 2015
Messages
3,561
How is reading RA2 get you the humidity, it is an output to the relay.
You will need sensor of some kind.
But if you haven't done any programming you have to get that out of the way first.
M.
 

Bellon

Sep 20, 2015
10
Joined
Sep 20, 2015
Messages
10
I have a sensor, but the circuit I uploaded the image is only for connecting the solenoid valve to start or stop irrigation.
 

Bellon

Sep 20, 2015
10
Joined
Sep 20, 2015
Messages
10
I have two circuits to measure moisture (the sensor goes in the connector and are nails and I want to read the average of the two). A league in RA0 and RA1 on the other.42354353465.png
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
I have two circuits to measure moisture (the sensor goes in the connector and are nails and I want to read the average of the two). A league in RA0 and RA1 on the other.View attachment 22616

There is something odd about your circuit. Can you please run through how it is supposed to work.
Thanks
Adam
 

Bellon

Sep 20, 2015
10
Joined
Sep 20, 2015
Messages
10
The sensor (which are two nails) measures the change of resistance in the ground and sends the signal to the PIC (image 2). In the first image, it is part of the circuit which drives the solenoid valve with the relay, starting or stopping irrigation.
 
Top