#Multiple pots on one arduino.

1 messages · Page 1 of 1 (latest)

frail current
#

Hello, Today i tried programming my throttle quadrant and i came to an issue where potentiometers affect the other pots readings. First two analog pins ( A0 and A1 ) work perfectly fine but the rest is just a mess. I have read this discussion https://forum.arduino.cc/t/working-with-multiple-pots-in-multiple-analogue-inputs/594265 but i don't know how to make it work in mobiflight. Do you know how to do this?

deep berry
#

Nothing in that thread is related to Mobiflight.

What do you mean "The rest is just a mess"?

frail current
#

Basically when i move one pot, it changes the value of two analog inputs like on the picture below. Also sorry that i put this thread in the wrong category, should we move this discussion to a diffrent forum?

deep berry
#

it's not possible to move threads between channels in Discord unfortunately. Here is fine

#

I'm not super familiar with analog inputs so we'll have to wait for someone else to reply. what does your wiring look like?

#

and if you remove the pots from A0 and A1, does A2 work?

frail current
#

This is a scheme of my wiring, and yes when i move the pots to the further analog pins it has the same effect

deep berry
#

please post photos of your actual wiring

#

and what Arduino are you using

frail current
#

I am using an arduino mega right now, but before i have used an uno and it did the same thing

deep berry
#

I'm not an expert but I believe it has to do with interference between the wires. I'm sure someone with more experience will chime in later today

frail current
#

Alright, so only solution i came up with is to split the wiring between two arduinos, 3 analog inputs seem to be the maximum amount that works fine on each board

#

any more than that results in interference

odd flax
#

I have done an audio panel with arduino mega that has 15 potentiometers and they work ok.

#

so I suspect it is the wiring

#

also I have my sensitivities to 5

#

if I set them all to 1 they of course chatter a bit and this is likely amplified by the number of them and their wiring

#

but even at 2 they are reasonably stable and dont interfere much, I keep them at 5 because these are just audio volumes so they dont need to be super precise

frail current
odd flax
#

Sure. This is actually a circuit board design, and a very old one, so while I am "still learning" I was even more "still learning" at that point 😄

#

this also has the pots wired backwards, so that left is 1024 and right is 0

#

so 5V and GND should be swapped I think

#

the potentiometers "chatter" a bit because they are analog, so setting sensitivity to 0 will always have a bit of jitter

#

but for throttles it should be fine to have the sensitivity at maybe 2 - 5 range and still get reasonably ok accuracy, for flight controls I might go with a joystick HID sketch in arduino pro micro or pico, that will also let you then use the sensitivity curves in the simulator

#

Could also try placing everything on a piece of cardboard and maybe using something like a drop of hot glue to neatly fix the wires in an oderly route from the pots to the arduino and see if that makes a difference - or using shielded wire, or twisting each bundle separately? I am not an expert in this but that could definitely be a thing to look into if they cause a lot of interference.

frail current
#

Chattering is not an issue for me, if i have more than 3 pots connected to arduino, the ones that are further than A1 have this very weird thing happening, when i move one pot it changes the value of two analog inputs at once by the same amount as if i moved two pots at once. Sorry if i can't explain this well but English is not my first language. I'll send some pictures or a video in a few minutes showing the issue more clearly

#

Also one quick question, what does this mean? its the first time i see this

#

This video shows what happens when i move just one axis on either pin A1 or A0

#

And this one is any axis from A2 and up

odd flax
#

hmm

#

So this should really work. Do you have a multimeter where you could measure connectivity or resistance between the data pins?

#

The Atmega 2560 has one internal AD converter and a multiplexer that switches it for each of the analog pins, one at a time. I think it also has a shared filter capacitor for noise, so one needs to wait 125 microseconds for the capacitor to get charged after switching pins, and then do an AnalogRead() twice, and discard the first read. But I think the MobiFlight firmware does this.

#

I am suspecting there is something in the wiring. Do you have more potentiometers so you could try making a fresh wiring for just the minimal problem case?

frail current
#

Alright, so i have completely rewired the throttle quadrant and it works perfectly fine now, i don't really know what exactly was wrong with my wiring but i am happy that it was not an isssue with the arduino / mobiflight. Thank you so much for help!

odd flax
#

yeah, there was likely something that connected several signals

#

great news and end result then! 🙂