Contactless encoded electronic sensor with relay total safety management without an external controller