thanks for the reply. What bits have I not made clear? Apologies, I am brand new to the arduino When i was testing earlier the voltage readings didn't make sense - with an input voltage of 4v i think it was displaying 3.5v but if i dropped the voltage to 3v it would be sensible.

I have just edited the code following your advice, the display is now reading 0v and does not increase when I connect a voltage to the analog pin?

One odd thing I noticed is I pulled the usb cable and the arduino LED stayed on, this was because of the voltage I was inputting to analoge pin 0, (it was about 3v) is this normal behavior lol?

Whoops! I hate it when that happens. I haven't fetched my Arduino out of storage yet and it's been two years since I played with this stuff so I'm a little rusty. Let's pretend we're still in first grade and make sure all the data types match because I can't remember if you can mix floats and ints in an expression. If this works, then you can play with it and you'll have a working model to revert to. You'll have to tell me what happens because, as I said, I don't have anything to test the code on.

just playing around and as soon as I divide the input by 1023 I get a static display of 0v :~

Sorry I dropped the ball. I'm in a conference (arduino workshop two days from today and more on physics teaching!).

The reason you got zero was because you divided your reading by 1023. Both your analog reading and 1023 are integers so their division was handled as integer. Only quotient was reported, which is almost always 0, while the remainder is lost. Say you have 512 from analog input, you divide it by 1023. You get 0 as quotient and 512 as remainder but integer division only reports quotient, 0. Then any subsequent multiplication or division is zero.

You want to do this instead: result=analogRead(sensor)*5.00/1024;

The above way multiplies an integer (analogRead) with a float 5.00. The operation requires converting integer to float. Then the result is divided by an integer 1024, which also requires the integer be converted into floats. Dividing floats won't be as inaccurate as dividing integers so you will get the desired scaling effect you want. BTW, it should be 1024, although 1023 is almost as good.

Good catch liudr , I knew it had something to do with mixing the data types. I couldn't remember what to do to get the compiler to cooperate, hence my suggestion to convert the input explicitly to a float.

I have just edited it so it displays a second voltage on the second line of the screen

when the inputs are not connected the float like crazy, is there a way to pull them down with software? I've just tried a 1m ohm resistor (all i found around) but I don't think that's enough resistance? For some reason it brings the voltage reading up to a shade under 5v, I can't get my head around why :~

there will not always be an voltage connected to all three inputs, in which case id rather them read 0v than some phantom reading got them pulling down now via a 47k resistor and it seems to work nicely

I still have the problem of the measurements being off slightly though is it possible to somehow calibrate it?

What if you don't pull with a resistor? Do you still have offset?If you don't connect input to analog channels, you should let it float. Forcing input is not the way to go. If you so insist it, use 500k.

Well I have been experimenting with some values, and it seems to be that the highest resistance I can go to without float is about 300k.

Id rather not pull them at al but its going to be used as test equipment so It needs to be clear if something has a fault or its just the input floating around.

I have also now built the circuit on a proto-sheild (lcd wiring etc) and it seems to be a bit more accurate... about 20mv off so I could probably get away with that might have been picking up some noise or something on the breadboard I guess?

The other thing, input no.1 will be measuring 5v, at the moment my range is 0-5v so I guess it would be more sensible to measure the range of 0-10v so 5v sits in the middle.