When I am looking at the sensors, as I am "directly" looking at them by pin number, I realised I am using the "wrong" pins.LED 5 is looking at Pin 13. That's the onboard LED.

That isn't going to work.

Ok, so That is one problem detected. I shall have to change the assigned pins to the analogue inputs.Though that is going to be a problem as I need 6 inputs and two of the 6 analogue inputs are the I2C bus on which the RTC is going to live.

Hmmmmm... But anyway.

That aside, I see I can't use the pins listed in the sketch. BUT - and isn't there always one of them? - even if I negate the reading of the sensor pins for LED 5, it still doesn't glow.

I put a couple of lines in the SETUP() to turn the LED 5 on/off and it works.That is on Pin 12.SecondLED is pin 1 - just to let you know now.

Then it goes into the LOOP()And from there straight into the SOLENOID() function.

On loading the LED 5 blinked. So all was good.

I then copied the lines from the SETUP() to the SOLENOID() function, but put it after the LED_CONTROL(1) call.This just turns on another LED indicating the loop is running.

Uploaded it and LED 5 blinked only once. The "main" LED turned on indicating the loop was running and the other LEDs blinked as per normal, but 5 didn't.

For what ever reason, I copied the lines and put them BEFORE the LED_CONTROL(1) call and uploaded.

Lo and behold, LED 5 blinked TWICE when the sketch was loaded.

Then I copied them again and put them AFTER the LED_CONTROL(1) call.

LED 5 still only blinked twice, not three times.

The only "difference was the positioning of the lines before the LED_CONTROL(1) call.

So, I remarked out that line.

Now excluding the blinking at the start, LED 5 works as per the others.

So, to me: LED_CONTROL(1) is causing the problem.All that does is get the (1) which is sent, and depending if it is 1 or 0, turns the LED on or off.So to "test" what is going on, I simply putdigitalWrite(SecondLED,HIGH);where the LED_CONTROL(1) call was.

LED 5 doesn't work.How would doing a "digitalWrite(1,HIGH);" prevent a "digitalWrite(12,HIGH);" from working?

Oh, and please don't pick the "there is not a # 5 LED defined in the loop".There are 5 leds in the loop. 1 to 4 glow. 5 doesn't with the line un-commented.But with the line commented out, # 5 does glow.

After almost 80 post to help you solve your problem without success, it appears you have attempted something that is currently beyond your capabilities. I suggest you start out new with a simple part of your project and get it working, then attempt to move to the next part.

Google forum search: Use Google Search box in upper right side of this page. Why I like my 2005 Rio Yellow Honda S2000 https://www.youtube.com/watch?v=pWjMvrkUqX0

void loop(){ int i; //digitalWrite(1,HIGH); // With this line active, LED 5 doesn't glow. for (i=0;i<5;i++) { digitalWrite(LED+i,HIGH); delay(500); digitalWrite(LED+i,LOW); delay(500); } //digitalWrite(1,LOW); // With this line active, LED 5 doesn't glow. delay(2000); // Just a longer delay to simulate the long time between waterings. For now}

Notes:1. You don't need the while(1) loop. Your loop() already is the infinite loop.2. I think the LED+i+1 line was accidentally left in.3. LED 5 should get turned off after the watering sequence. I put a 2 sec delay in so you could see what I think you mean,that LED 5 indicates that a watering cycle is in progress.

Post if this doesn't do what you want.Good luck. Keep plugging.By the way, I water my house plants with a 20 ft coiled thin hose connected with a valve under the sink.I think gravity will not be forceful enough. I give each houseplant 12 sec twice a week.You can cannibalize a cheap battery operated faucet connected sprinkler timer to get the solenoid already connected to valve that canswitch water under presure. (Ex. http://www.amazon.com/Orbit-Hose-Watering-Timer-62024/dp/B0013I2MLS/ref=lh_ni_t If you need a bunch of them though, it starts to add up. You don't really ruin it. If you set it to On, remove the battery(s), and bring out two wires for power then when you provide power, via a digital out, you get a strong flow of water. I have a similar one. They're geared; the turn on/off is not instant but takes about a second.)

Originally it was triggered by a pin going low and causing the LEDs to cycle once.

Just with me cutting it back, and back and back, I made a mistake.

Techylab,Thanks very much.You do seem to have the idea of what I am wanting to do.Yes, you are correct, the +1 bit was an artifact from other trials.I'll give it a go when I get home.As a further note: I have tried other pins for LED 5 and have the same result to a degree.Explaination:From what I remember (sorry if that sounds lame, so much has happened since then) if I use a different PIN for LED 5, different LEDs don't glow.After several attempts, I just gave up on that and went on to the next "problem".

Probably late to the party here and somewhat irrelevant unless you can get the code working but I happened to run across this on ebay while I was looking for cheap arduinos. Perhaps it could be useful to you.

Instead of the 4016 or 4066 you could use a single MAX4617, which has 8 channels.I think you should play with the sensor first, i.e. a pair of galvanized nails and a cheap voltmeter.Perhaps a 1 Megohm (or more) resistor to ground on the "input" nail, the one not connected to the voltage source.Then, when you're confident that a certain low enough voltage, as measured on the meter, corresponds with the dryness you want,you can add one or two analog switches, and use a single Arduino analog input instead of the meter.

By the way, I think it's way cool, and considerate of the plants, to water each one when, and only when, IT needs water.Most everybody makes do with a single time schedule for all the plants!Good luck!. Mitch

I'm using a couple of stainless steel cooking skewers about 15cm long as moisture sensors, just pushed into the soil. They're mounted in a chop block electrical connector to keep them parallel and this also gives a convenient way to attach the wires. I'm using the technique of only powering the sensor when I need to take a reading, and reversing the pulse after the measurement to avoid any ionization effects. It took me a while to figure out the resistance and timing to get a consistent reading that reflects water content within the range I'm measuring, but it seems to be working OK now.

I only provide help via the forum - please do not contact me for private consultancy.

As I've suggested in similar prior threads - consider raising the reservoir so that the water is gravity fed. Then you don't need a pump and there is no need to sense the water level unless you want an alarm when it's empty.