Since you have a working sytem that malfunctions at certain distance , what is required is "dressing" for your setup.
The photos show the protype which needs a rearrangement of all hanging wires.( but all system under development will be like yours :lol
One thing that you can test is:
those two lines (one you take from trfr for voltage measurement and another for frequency) can be re arranged such that it doesnt pickup any noise from external sources.
carefully route that two wires and its ground to atmega input port lines , probably with shield.
and see that your dc supply has adequate filters.
if it works then , you can go to further steps.
please test and report.