Wrong readings on my Nano

Hello,

I just began learning arduino and i practice with a cheap clone Arduino Nano.

I have tried some inbuilt examples including other tutorials i found online and had no problem but reading ADC/Voltages.

When i try the "potentiometer to reduce or increase ADC readings" the serial monitor reading lags behind the real reading on the A0 pin that i use and only reads equally on the ends of the potentiometer.

I also tried reading a single Lithium-ion cell of 3.69v but ADC value was giving 1023 reading.

Where do i look into for a problem please?

Thanks.

1 Like

Click on < code > and post your code.

2 Likes

Also diagram exactly how things are connected. pencil and paper sketch is fine.

The how to get the most from the forum post explains how to properly post code. Please read it.

2 Likes

It sounds like a wiring mistook and without your schematic we can only guess the pot is connected wrong. This type of mistook can damage or destroy the pot depending on how it is connected.

1 Like

It would seem you missed this before.

2 Likes

Iyts hard to know without seeing the link to the

tutorial.

If youre having fun my site might give you some more ideas of things to try.

and for measuring volytage with an ADC

3 Likes

Do you want to see close to 3.69 V on the Serial Monitor when Lithium-ion Cell is connected with A0-pin of the ARduino NANO?

1 Like

Here's my connection to the arduino.

2 Likes

My connection is GND and 5v of the Arduino to the 2 out pins on the potentiometer and the Pot wiper to A0.

Code is the same built-in "AnalogReadSerial" in the Example. I have tried with 3 different type of potentiometer, got same result.

Follow these steps and chcek that close to 3.3V/0V/5V appears on Serial Monitor at 1-sec interval.

1. Remove your Pot from A0-pin.
2. Take a jumper and short 3.3V-poin wit A0-pin.
3. Uplaod the following sketch:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  unsigned int y = analogRead(A0);
  float testVolt = (5.00 / 1023.0) * y;
  Serial.println(testVolt, 1);
  delay(1000);
}

4. Open Serial Monitor at Bd = 9600.
5. Press RESET Button of NANO.
6. Check that Serial Monitor shows close to 3.3 at 1-sec interval.
7. Connect A0-pin with GND-point.
8. Check that SM shows clsoe to 0.
9. Connect A0-pin wit 5V-point.
10. Check that SM shows close to 5.
11. The Ch-0 of the ADC Module of your NANO is fully functional.
12. Now, connect the wiper-point of your Pot at A0-pin. Slowly, turn the Pot from fully CCW to fully CW and observe that readings on SM chnage accordingly.

2 Likes

What value are your potentiometers?

10K Ohm is a good value to use with Nano. Lower values also ok.

If you are using a much higher value, like 1M Ohm, this won't work so well and might cause the effect you are describing.

Also, there are "linear" and "logarithmic" potentiometers. It is normal to use linear with Arduino projects. Logarithmic are sometimes used in audio projects, for example as volume controls.

1 Like

Thank you @GolamMostafa

The A0 port

  • connected to 3.3v brings 5.0 in the SM
  • connected to GND brings 0.0 in the SM
  • connected to 5v brings 5.0 in the SM

Meanwhile reading the Arduino pins with a DMM, the 5v pin reads 4.7, 3v3 pin reads 3.2

I have tried with these types as i usually have them in my parts-box. All gave same result.

Something is definitely wrong either in the setup or NANO!

Change the channel to A1-pin. Change the following code in the skecht of post #10.

unsigned int y = analogRead(A0);
===> unsigned int y = analogRead(A1);

Also, add the following line in the setup() function:

analogReferene(DEFAULT);

Upload the sketch and report what values you are getting on SM for 3.3V, 0V, and 5V.

1 Like

Same result as the A0 pin.

Do you ave another Arduino UNO or NANO?

1 Like

Unfortunately not.

I also wished there was another to troubleshoot.

Ok!

From the examples of the IDE, upload the blink sketch and check that the onboard LED (L) blinks at 2-sec interval.

1 Like

I can see that the pot on the left is 50K, which is a little too high. The others, I cannot tell what value they are. I asked about the values.

There seem not to be any issue with all LED controlling i have tried. In fact, in the few time i began learning, i can so so much with LEDs, same with some other sensors.

My trouble is just with this voltage reading, which is my main goal of ttrying to learn Arduino as i do a lot of Lithium battery hobbies.