Arduino Nano -Erratic Analog to Digital Conversion

I am using the Nano to convert 6 analog input channels for precisely setting a robot arm position. The servos used are analog. I am using 6 10 turn pots, each of which is 10K as inputs to the AtoD. Initially the conversion generated stable data, but after running the robot program, the converted data is erratic varying more than 10 percent. I am not sure why this has happened and am wondering if I have somehow damaged the AtoD converters. Otherwise the Nano works fine.

You're missing a lot of information in your post, please supplement it as described here:

1 Like

It could be due to noise pickup by your wiring. or the motor current causing a voltage to be developed on the GND wire to your potentiometers.
It could be the supply voltage dropping as the servo's move.

These are just guesses, we need more information to determine which it is.

Show us a photograph of your wiring.
Tell us how you are powering your servos and your Nano
Show us your sketch using code tags.

Provide a separate power supply unit for the Arduino and the servos. A common GND is needed.

It SEEMS trivial but can you post a schematic please? It DOES matter how the pots are connected ie are the readings absolute or ratiometric? What are you using as a reference? your supply?

Can you run a very simple sketch to read the value from a single pot and print the RAW data?

Robot Arm Control.pdf (1.5 MB)
I think I resolved the problem. In the original setup, the trim pots voltage source was the Servo 5v supply. When I changed this and connected the trim pot voltage source to the 3.3V of the Nano the problem disappeared. I attached a schematic of the way it is connected now.
Thanks for responding.

Check out the 1.1V reference option. It can be useful in situations like that.

Thanks for the suggestion.

Not for ratiometric sensors, like pots.

Powering the pots from 3.3volt (see OP's diagram in post#6), and using default Aref, makes the pot value depending on the pot setting and on the USB supply.

A pot read with default Aref should be powered from the (classic) Nano's 5volt supply.
Leo..

1 Like

Oh, I see... but isn't the 3.3V well regulated? Edit - never mind. The ADC ref and applied pot voltage should be the same...

Speaking from ignorance, can't you output the 1.1V ref somehow?

Yes, Aref and pot supply should be the same, to preserve ratiometric behaviour.

When pot supply goes up, the A/D compensates by becoming equally less 'sensitive',
thus keeping A/D value the same.

When you tie two rubber bands together with a knot, then the knot stays in the middle,
independent of how much you stretch it (ratio stays the same).
If you replace one rubber band with a piece of string (fixed reference voltage),
then the knot won't stay in the middle when you stretch.
Leo..

1 Like

Better show your schematic like this!

.. so as Leo says, use the 5V and DEFAULT reference; or continuously calibrate by reading your 3V3 on A7
as explained here

Yes, I have connected the trim pots to the Nano 5V. All works well
Thanks again for the comments

I am adding my latest schematic with ref connected to the Nano's 5V pin

Robot Arm Control.pdf (789.1 KB)

How hard is this?

This will tell you how to post an image

Schematic missing a single critical connection, the tie between Servo power ground and Arduino ground. It's the return path for the control signals for those servos. Without it, your servos may do a 'happy dance', or do nothing at all.

I neglected to show it on the schematic. I do have it wired. I think I also left of the pot values of 10K.The arm works well.
Thanks for your comment.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.