That is a simple analog circuit to build for less than 15 USD or an easy job for an Arduino or a Raspberry Pi connected up to a photocell to accomplish digitally for less than 40. There are large internet communities that will describe how to build either project. Alternatively, perhaps you could modify a garage door photocell safety sensor system to get the voltage you need like this product

- Ed Morra -