Camera sensor to accept or reject the position in which a component is kept on a machine
For an industrial project use industrial hardware.

It will work on standard 24 V supply.
It will be &quot;hardened&quot; against accidental short circuits, reverse connection, etc.
It will probably be waterproof and washable. (Check the IP rating.)
It will work - if you select the right one.
Others will know how to fix it if it breaks or you leave the company.
It will be configurable with the manufacturer's software by anyone with reasonable industrial controls knowlege.
Spare parts will be available.

Most of the industrial sensor manufacturers including Cognex, Keyence, Sick, Omron, ifm, etc., make low-end vision sensors that can be taught an image and give a simple pass/fail inspection result.

... would not want to invest in a plc though.

Micro PLCs are available from all the major manufacturers such as Siemens (LOGO!), Allen-Bradley, Mitsubishi, etc., with, typically, 8-in, 4-out arrangements for about €100 / $100. Once you get going on these you'll never look back. Raspberry Pi (note capitals) could be a disaster.