Auto-phase selector for single phase loads with three phase supply

Hi guys,I just would like to let you review of this code.We will use it for our thesis but when we measure the voltage it will jus be staedy to 230 V and it wont vary.Do we miss something on the code? Also inn usng Acs712 Current sensor for AC current sometimes the readings does not match with the actual tested current.Please do help us.Thank you.

Below is the schematic and code of our thesis.

SCHEMATIC THESIS-Model.pdf (103 KB)

here is the code,we are using

psl22.ino (10.8 KB)