Maker Pro
Maker Pro

Programming - Solenoid valve in an irrigation system

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
 
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.
 
I have a sensor, but the circuit I uploaded the image is only for connecting the solenoid valve to start or stop irrigation.
 
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
 
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