TomGeorge:
Can you make a list of all your INPUT and OUTPUT devices, that is sensors and pumps and switches and indicator lights please.With 16 "channels", it may be worth using arrays to define your variables, which will shorten your code.
If you are using a UNO then you will need to look at input and output multiplexing as the UNO will not have enough I/O pins, especially analog inputs.
I'm not sure what soil moisture sensors you are using, if it is the soil conductivity type then check for corrosion during use, this can effect the readings above the actual soil moisture.
Tom...
Thanks Tom, i appreciate your advice, i need to keep them clear listed, i didn't had the time while i was trying to find ways or schemes on how to make it work. Soon ill update the code which right now works like a charm with the relay module.
At first i was really suspicious about the opto-couplers that Leo wrote. I was looking on my module, thinking if im gonna plug it and start the troubleshooting or if my project will be paused for a day at least by destroying my equipment.
Im using a DHT11 RH/Temp sensor, it is using 5v from the 5v pin of Arduino Uno, a digital pin as INPUT which is using the library of the specific module to map the readings. A soil humidity sensor (YL38(module)+YL69(probe)) which im using an analog INPUT, so we can have readings, a digital OUTPUT to turn on/off the module for some seconds(try to slow down the corrosion) and of course the soil hum. sen. is grounded on the Arduino. All the other digital pins are going to used as OUTPUTs to trigger actions on relays. Hopefully by multiplexing i can make it work, i still have some doubts, can i get clear readings through these 16 analogue channels like i did through the no-mulplex analogue pins on the Arduino? This device is like a GODMOD and i would like to read more.
Well here's what i found, while searching on google and because i have seen two different versions of this relay module one with parts missing, i though that is a good idea to search by looking the images on the web.
I found this picture on a simple guide which helps to connect high current devices to a low lever trigger module, the same that i own. So i could also connect high current devices, which will controlled by the relay.
At first i found out that i wired nearly perfect everything.
here's the plan
I was using a 12v 500ma plug directly to the Arduino, that was to help me run the pump when i was started the project (now there are 13 pumps). I was using a transistor to turn on and off the pump, running the 12v pump from the Vin pin of Arduino, using a diode between the legs of the pumps to prevent spikes return to the micro controller. So now i wired the Vin on the COM of all the relays, but also on VCC of the relay module (i don't know what i was thinking, but nothing bad happened so
), near the VCC was a GND which i wired to the Arduino, the "always open" side of relay connected to the + side of pump. The - to the GND on Arduino.
As you can imagine, when i was running the Arduino with a USB, everything seemed cool, low voltages on pumps, that nearly made them move, but relays were work like a charm. Then i decided to plug the 12v power supply, a move that turned on everything, making all the pumps and relays go on, like there's no code. Of course i rewired and used a jumper cable to get 5v from the Arduino and connect it to the VCC of the relay module. Now im just focusing on getting ASAP the Mux Shield and the soil hum. sen. but im also curious on how many relays can open instantly the same exact time (by coding and power consumption p.o.v.) and how many pumps can work together without any problem.
Wawa:
In your case, you might or might not need them.
Post a full diagram.
Leo..
Thanks for the information Leo, really useful
I will post diagram ASAP