wire powered?

The problem with the ldr is it would have noise because it will receive light from others fonts like a lamp, I have seen i can know if a wire haves some power using a toroid but I have no idea how to make it possible.