Photoelectric sensor with Teach Mode?

Hi, I’m working on a project that is supposed to simulate a hockey face off with the computer. The idea is to have a sensor on the floor that determine when the player has swung the stick. I found this sensor https://www.valinonline.com/products/cx-422 and I am curious about how the teach mode works. Also, is this the best component for the job?

In the datasheet:

https://files.valinonline.com/userfiles … sensor.pdf

the word “teach” is not found. Not sure why you would ask about it.

But, generally, a photosensor teach mode requires you to place an object in the sensing area, push a button, then remove and press again.

If you get one of these, you may want one with the suffix “-P” for PNP type that sources voltage to your input rather than pulling your input low.

Also, that particular unit is de-rated based on the target size, smaller target, smaller sensing range.

\Were you planning on the broad face of the hockey stick being detected or the edge?

You may even find a distributor that can demo the unit for you.

Or, if you use a pullup resistor on your input, NPN will work fine as well. Your choice.