Basically I wanted 2 more analag pins so I thought something like this might work. S1 and S2 are simple soil moisture sensors(nails) D1 and D2 are digital outputs from Arduino and A1 is the analog input.
So if D1(hight) + D2(low)= I get readings from S2 and D1(low) + D2(high) = readings from S1, right?
To add extra analog inputs to your Arduino you'll be wanting to use an additional chip, something like the 74HC4051 (click for datasheet) which acts like a switch box - you tell it which of the up to 8 sensors attached to it you want to read from, and it connects that physical leg with the leg that you have wired to a single analog pin on your Arduino. There will be lots of tutorials about on how to use these and they're quite straightforward to set up and use too.
itiohs:
I have almost zero experience with eletronics.
You've come to the right community to learn, in my experience
With a RC circuit its possible to 'emulate' an analog input with a pure digital pin with the 'R' being made by your nail in the soil.. In simple terms you set the pin to output, set it high to charge the capacitor, switch it low and then to input and time how long it takes to discharge to the point where it registers as being a low. The lower the resistance of what is connected to the pin, the quicker it discharges. You'd need to use something (multimeter or an analogue pin) to determine an approximation of 'R' the (resistance of your nail through the soil) to determine a suitable value for C. Plenty of stuff on google to work it out but heres a start : http://www.allaboutcircuits.com/vol_1/chpt_16/4.html. The digital input will register as low when it reaches approximately 2.5 volts. This probably appeals more if you're a cheapskate...........
itiohs:
In other words, the circuit I drew wouldn't work?
That's right spot on.
why?
Too much wrong to explain but transistors don't work like that. For starters there is no path or any current from the emitter, the analogue input is very high impedance it doesn't allow current to flow. The base needs a resistor in it. You can't get a voltage out of the emitter more than 0.7V lower than the base voltage. Basically it is not the way to do it.