Hello everyone,
My name is Daniel and I am making a project that controls a solenoid valve given a certain value of soil moisture. I have stablished that if the soil humidity is under 30 %, Arduino would turn on the solenoid Valve, else would mantain the solenoid valve closed.
However, I am having some difficulties putting the program to work. I have used a LED substituting the solenoid valve for debugging. Using the USB cable the circuit works perfectly, under 30 % LED goes on, over 30 % LED goes Off. When I transfer to power supply (12V 1 A) the circuit does not work, under 30 % the led goes on and off almost instantaneously, and over 30 % LED is off as it should. The same happens if I use the solenoid valve instead of the LED.
I am new at this, and I find the code very simple but I don't get it why it's not working... Attach I send the code . I used the same circuit as the following link, I added the soil moisture sensor in the pins A0, 5V and ground.
Could you Help me?
Thank you in advance,
Best regards,
Daniel Sousa
sketch_jun26a.ino (1.51 KB)
A couple of things come to mind. The first, I would suspect the power supply you are using is not up to driving the solenoid so when it turns on, you get a reset. The second thing to consider is the response time of your "system" - typically, the humidity sensor for the soil will lag behind (maybe quite a ways behind if the water is going in one area and the sensor is somewhere else) so you will end up flooding what you are watering. Perhaps a better consideration would be to water for a short period of time if the soil is too dry, wait 10 minutes or so and repeat if it is still too dry.
Tank you for the reply!
That is a good suggestion turning the valve for a period of time. I intend to put several humidity sensors, but I will take that into consideration, it's a matter of fine-tuning afterwards.
Regarding the power supply, what do you suggest? the valve specs is in chinese unfortunately, but it says DC12V and the power supply says 12VCA 1000mA 12VA. is there a relation between this information? I am sorry for the noob question.
Best Regards,
Daniel
Are you sure your power supply is a DC source not an AC source? That alone is a major difference of course.
Furthermore you will have to find out how much power your solenoid requires so you can get a strong enough power supply.
For your moisture sensors: make sure they're switched off most of the time. Leaving a voltage over the two probes (I assume you have those cheap two-pronged fork-like probes) guarantees them to corrode away within weeks if not days. So only measure once every 10 mins (or less), for the shortest time possible, after that switch them off.
hmm good advice!
It was definitely the power source.. -.-' it is working perfectly, now
yeah I will take in consideration the delays and the on/off issue of the humidity sensors.
btw, do you have a suggestion of a better humidity sensors?
Another question that is not related to this, Is there a water level sensor? like a buoy type of sensor that I could connect to arduino?
I am going to use one solenoid valve to fill up a deposit that I have. for the moment, I have those ultra sound sensors, but these are vulnerable to water aren't they, due to the small circuit board? there is going to be splashes of water..
Btw, my soil sensors also have a small circuit board attached to the forks, are they water resistant?
Bes regards,
Thank you for everything
rucabelda:
Another question that is not related to this, Is there a water level sensor? like a buoy type of sensor that I could connect to arduino?
Lots of options. Level switches, ultrasound from above, pressure sensors... Do a search at this forum and you'll have lots of answers.
I am going to use one solenoid valve to fill up a deposit that I have. for the moment, I have those ultra sound sensors, but these are vulnerable to water aren't they, due to the small circuit board? there is going to be splashes of water..
Unspecified ultrasound sensor... Hard to know what you're talking about... Rule of thumb: if not specified water proof, it's not. Same for your soil moisture sensor. You'll need at least a conformal coating if you want to have it moisture/splash proof, or pot it in epoxy or so to make it water proof.
Thank you for everything.
I will get there, for sure ;).
Now I am going to finish this step of the project, turn the code more robust and then I will go to do the other step of the project using the level sensor.
Best regards,
Daniel
rucabelda:
Hello everyone,
My name is Daniel and I am making a project that controls a solenoid valve given a certain value of soil moisture. I have stablished that if the soil humidity is under 30 %, Arduino would turn on the solenoid Valve, else would mantain the solenoid valve closed.
However, I am having some difficulties putting the program to work. I have used a LED substituting the solenoid valve for debugging. Using the USB cable the circuit works perfectly, under 30 % LED goes on, over 30 % LED goes Off. When I transfer to power supply (12V 1 A) the circuit does not work, under 30 % the led goes on and off almost instantaneously, and over 30 % LED is off as it should. The same happens if I use the solenoid valve instead of the LED.
I am new at this, and I find the code very simple but I don't get it why it's not working... Attach I send the code . I used the same circuit as the following link, I added the soil moisture sensor in the pins A0, 5V and ground.
Controlling A Solenoid Valve With Arduino - BC Robotics
Could you Help me?
Thank you in advance,
Best regards,
Daniel Sousa
hi is the attach code here is the updated and working? badly need it, thanks!