IR leds and 38KHz receivers as a optoencoder or similiar

shall i use another device in order to achieve what has been written above? if so, which one?

Yes.
Use a TSOP4038, that will stay high when you send a continuous modulated signal to it.