I'm working on a atmega16l microcontroller and my project is to display the humidity and temperature of in the room on an LCD screen. I'm taking ADC input from humidity(0-5) volts DC and temperature sensor(0-0.5) volts DC and according to that I have to switch the room warmer and humidifier. But at present my controller is showing one problem that it is showing correct humidity all time, but approx about 1 time in six repetition the temperature ADC input is flipped with the humidity ADC input while humidity ADC input remains the same. For getting rid of this problem I have tried to change the port of both adc apart from each other but then also the problem remains the same.
Please tell me how to solve this problem.