6mega 2560 6 channel voltmeter with utft

hi i'm creating a 6 channel voltmeter with utft screen on the mega 2560

now if i run the program the connections on the analog inputs fluctuate the ones who are connected work fine. how can i stabelize the conections who aren't connected??

tomRealtimePlotterArduinoCode.ino (108 KB)

A 1 MegOhm (or more, within reason) resistor to ground will pull the floating input down and as long as the output impedance of the voltage source that you are measuring is low (<1K), it will have little effect on the voltage measurement.

i mean can you do like run a setup initializing when the program starts som like

read A1 if connected then pin a1 = PINPUT

How does the Arduino know if the pin is connected or not?

i mean right now the analog pin that i'm reading displays the correct voltage cus it's connect to a3 and ground

the other pins are not connected at all and varie between 0.1 volt to 0.32 volt

i want them to be at 0 volt when not connected

See reply #1. Did you try that? What is wrong with that solution?

The only way that you can fix a floating pin with software is to enable the internal pullup. That would definitely affect the voltage measurement.

sorry dude i didn't tried it i'm a programmer not verry good with electronic components, but i've read alot and your way seems to be sucsesfull, i trying to make 1 pin a pulldown pin cus i don't have a 1mohm resistor

thx bro :slight_smile: