Yet another potentiometer unstable voltage issue

Hello!

I have read a couple of threads on the subject, but did not quite find the exact problem.

So I'm building a project on Arduino Nano.
It has a 128x32 OLED screen, PN532 NFC module, RGB LED and a potentiometer that I want to use to change volume of the connected Raspberry Pi.

I noticed that every time NFC module check for tag, there is a spike in potentiometer values - around 10%.
I tried smoothing to normalize pot values and moved it out of phase of the NFC module.
However the values are still of by 1% all the time, and I can't set volume to 0.

So before I post any code or schematics is there any way I can normalize those voltage peaks with hardware?

Thanks.

Decoupling.

^^ that. The Nano has minimal decoupling because of it's size.
The RFID module draws AFAIK about 100mA.
How are you powering the setup, and how/where are things (like the pot) connected.
Power/ground to the pot from a shared breadboard power/ground could also do this (post a picture).
Leo..

Thank you for replies.

Attaching the photo of my setup.

Arduino is powered by Raspberry Pi (which is powered from a usb 5v socket adapter).

Then there are 2 breadboards. The second board has pot and nfc, and screen.

Hi,
OPs picture;


We need a circuit diagram.

Can you post link to NFC data/specs please.
Do you know how much current it draws when it is activated.

Do you have a DMM to measure the 5V at the NANO when the NFC problem occurs.

Tom... :slight_smile:

I did a diagram in Fritzing. Is it okay?

I'm not sure about the PN532 specs, it's not in the manual. I have a pretty simple multimeter and not sure if I can measure current drawn from. I'll try to dig into it a little later.

The sketch code (github)

Did some measurements of the NFC module current drawing with DMM:

Idle (no nfc chip):
82.8-83.2 mA

With chip present:
82.2-83.2 mA

…and the operating peaks?

TheMemberFormerlyKnownAsAWOL:
...and the operating peaks?

Sorry, the readings I posted above are the actual operating current values.

Both "idle" and "with chip present" are the operating program values.

Did you just poke the Dupond wires into the vias of the Nano, without soldering?
Leo..

Wawa:
Did you just poke the Dupond wires into the vias of the Nano, without soldering?
Leo..

Actually I just soldered the headers on the Nano, and it got more stable in the middle range.
Though still pretty wild on the lower and higher end.

Try powering (power and ground) the pot closer to the Arduino.
A whole detour past several high (peak) users is not good.
Star power/ground would even be better.

Add a buffer capacitor to the 5volt line, close to the Arduino 5volt/ground.
100-470uF could be needed.
Leo..

Is that a 50k pot? A or B
A <= 10k A/D source impedance is recommended. I would have used a 10kB (B for linear) pot.

Don’t know if the RFID transmitter energy can break into the A/D.
Try a 100n ceramic cap from A0 to ground, close to the Arduino.
Leo…

Thank you for suggestions, Wawa!

I replaced the pot with a different 10K pot (it also has a click switch at one rotation end), and wired it closer to Arduino and it's much better!
Actually looks very stable, cannot see any fluctuations at all.

Wawa:
Add a buffer capacitor to the 5volt line, close to the Arduino 5volt/ground.
100-470uF could be needed.

Don't know if the RFID transmitter energy can break into the A/D.
Try a 100n ceramic cap from A0 to ground, close to the Arduino.

Maybe I'll try later. Thanks!

Wawa:
Try powering (power and ground) the pot closer to the Arduino.
A whole detour past several high (peak) users is not good.
Star power/ground would even be better.

What exactly "Star power/ground" means?

Nevermind, reading about it.

Wawa:
^^ that. The Nano has minimal decoupling because of it's size.

Also what would decoupling mean here?

Wawa:
Is that a 50k pot? A or B
A <= 10k A/D source impedance is recommended. I would have used a 10kB (B for linear) pot.

Don't know if the RFID transmitter energy can break into the A/D.
Try a 100n ceramic cap from A0 to ground, close to the Arduino.
Leo..

So I tried to do this, but the POT value is only displayed once on program start.
Did I solder it correctly?
Also is this kind of connection of 5 pins to GND is bad?

So I resoldered the 104 capacitor to connect 5v and GND.
It works a little better and a little longer, but eventually, potentiometer returns a value of 0 and stops reacting to changes.

Which I assume happens because of the cap getting charged and not getting discharged (?).

How can I deal with it?

Hi,
Do you have a DMM to measure the voltage at the wiper of the pot and then at the analog input pin it is connected too?

The capacitor will not cause that effect.

What resistance value is the pot?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

TomGeorge:
Hi,
Do you have a DMM to measure the voltage at the wiper of the pot and then at the analog input pin it is connected too?

The capacitor will not cause that effect.

What resistance value is the pot?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Hi Tom.

I have this kind of scheme:

Right now 104 ceramic cap is soldered to Arduino's 5V and GND, but as I mentioned, it helps only until a minute or two.

The pot is 10k.

Will try to measure the voltage a bit later today.

Hi,
Put the cap between analog input and ground.

Tom.... :slight_smile: