How to program IR sensor with Arduino Custom Coding Needed?

Hi, I am Vijay. I need to interface the IR sensor with Arduino and Relay Module. If a signal is detected by the IR sensor the Relay switches ON and if it again detects the same signal switch OFF the Relay. It can either do with the esp8266 module.

What do you mean by custom coding? You can use interrupts to turn on/off the relay. It’s the best method. Before that, which microcontroller are you using?

I didn’t get this part. Are you using an ESP8266 as your microcontroller?

Yes, Arduino or Esp8266

I remember Arduino should have a special library for IR. You can refer to its sample program.