When the doorbell button is pressed, the wireless doorbell receiver plays a chime and flashes its LEDs. This light sensor (photoresistor) is placed facing the LEDs, sending voltage level readings to an analog input on the Nano as the light levels change. The sketch running on the Nano will signal the relay to "open" when the readings exceed a specified threshold. The sketch uses a software delay to cover the duration of the period the LEDs are flashing, so that only one event is triggered per doorbell press.