error in analog sensor reading

guys, please take a look at the picture. why does this occur when the analog sensor didn’t trigger by anything and suppose to stay 0.

a 10Mresistor connected from A0 to ground.
i guess it has nothing to do with the coding, as normally the code works well, but all of a sudden it keeps repeating on showing amplitudes like this picture below.

huimay:
i guess it has nothing to do with the coding,

…and yet you posted your question in the programming section…?

sorry, as i am new to the forum and Arduino, still trying to figure everything out. As I am not too sure is it a programming problem or not. Maybe you could suggest to me a better solution and opinion rather than giving this reply. Anyway, I will try to post this question to another related section in the forum.

Well, this is the programming section, so why not post your code?
And a schematic.

You know - the sort of details that might help people help you.