ACS 712 +photon is not working properly

Hello everybody
I am a new member of this community , I wanna to build a project using Photon and ACS712 to measure AC current , I faced a problem with codes which I found on the internet because the reading is not accurate and not stable,
would you please suggest reading materials for me to use ACS712 with photon correctly