Arduino Mega - analog inputs



  • Hello,
    I run REXYGEN version 2.50.8 on RPI with Arduino Mega - REXduino. I'd like to use analog input pins. On pins I want to bring the output from the ampmeter up to 1V. I suppose I will be able to read and process this voltage.

    I don't understand, but the output of analog pins. In the setup, I turned on Pins A0, A1, A2 and A12, A13, A14 for the test. Other Pins are off and I have nothing connected to any analog pins yet. However, some values ​​are displayed on some pin which are not enabled. I'm using Arduino Mega clone. See the attachment for pin settings and displayed values.

    I will be glad for your opinion or advice.

    Martin

    0_1553585495210_Arduino_MEGA_Analog_vstup.JPG

    0_1553585502110_Arduino_MEGA_Analog_vstup_nastaveni.JPG



  • Hello Martin,

    I have noted that the Arduino analog inputs can sometimes pick up signals from adjacent channels.
    You can try pulling the analog signals to ground with a 10K - 100K resistor to see if it corrects the unwanted readings.

    Cheers,
    Tom



  • Hello Martin,
    the main problem is that the pin modes are in reversed order. By setting pinmodes_A0_A7 to 0x66600000 you enabled A7, A6 and A5, not A0, A1 and A2 as you expect.

    The nonzero readings are then caused by picking up noise and other channels as mentioned by @sisktom2

    Regards,
    Jaroslav