Currently I can only receive zeros on the serial console when I put any resister that is equal or larger than 560 ohm in parallel to the piezo. (I could not get any data at all with 10k ohm resister.) Should I still put a resister to protect the arduino?
1-Do you know anything about working with audio electronics ?
2- What is your test signal that you are using to generate sound for the piezo to pick up ?
There is nothing in the code you posted to suggest there is anything whatsoever for the piezo to pick up so why are you expecting to get anything ?
3- Did you read the datasheet for the piezo ?
4- What are you using for amplification of the signal from the piezo ?
5- What is the frequency of your test signal ?
6- what is the response frequency of the piezo ?
7- What amplitude do you expect to get from the piezo ?
8- Can you draw a schematic of your piezo circuit interface with the arduino ?