I am using all the 8 ADC channels of ATmega32 controller and sending the channel values to PC through USB. This is basically an analog input card. When I disconnect some channels, it starts sending random values to PC. I want to detect these channels initially and exclude them from the reading list. I am using a method, where I am pulling all the channel pins up and reading them for 30 times at the initial program, if the ADC values still more than 1020, then I am marking them as floating channels. But this approach is not giving me a successful result.
If you have any better idea of detecting the floating or non-connected ADC channel please help me.