Problem with Analog input being loaded by UNO

Hi,

Having run out of digital pins, I wanted to monitor a switch that has 13.3V in the off state (0V when on).

I did the maths and installed a 5K6 and 3K3 resistor chain, expecting 4.9V on the input.

However, the UNO seems to be loading the circuit, so the pin voltage is dramatically reduced
and the analog read command only gives a value of 76 and not the 1003 I expected.

This is not a problem in this project as I only need an On/Off state, but my next project needs
an accurate reading from an LDR (light sensor).

I do issue the command:
pinMode('A0',INPUT);

It compiles Ok, but the manual is a bit vague in this area.

So, my question is:

Is there a built in load on these pins, or have I managed to damage my device somehow?

Thanks,
Richard Gamester

richard_gamester:
Is there a built in load on these pins, or have I managed to damage my device somehow?

Yes. But it is so small that for all practical purposes the "load" is nonexistent.

I do issue the command:
pinMode('A0',INPUT);

No. The first parameter to pinMode is not a character constant but rather an integer constant. Drop the apostrophes.

I did the maths and installed a 5K6 and 3K3 resistor chain...

"Resistor chain"? What's that?

Analog pins can act as digital pins. On the Uno, analog pins A0 to A5 are also digital pins 14 to 19. Do a digitalRead from your pin.