This is the basic dark and light sensor which using photoresistor as sensing component. The transistor act like as a…