LM393 Optocoupler code needed

I'm using an LM393 Optocoupler module to detect an object falling through the slot. I need a simple code that reads the 5V input from the module to momentarily activate a relay. I've tried using the 5V to power the relay module directly, but without success. Arduino coding is definitely the hardest part for me, so thanks for your help.

LM 393 is a comparator not an optoisolator.

Welcome.

We will help you when you have problems with your coding.

If you need the code written for you, go to the Gigs and Collaboration forum.

There are many good sketch examples in the Arduino IDE you sould review.