2)When nobody appears in the infrared induction area, the LED will not light.
3)When the intensity of environmental light is weak and somebody is appearing in the infrared induction area, the LED will light till the person leaves the infrared induction area.
4) On 24 o'clock at midnight, the buzzer will alarm and the LED will switch to the manual control till 8 o'clock in the morning.
5)You can set the time by the switches.
Code for your reference:
Step 1: Components list
11)+5V DC power supply
Step 2: Schematic diagram
Step 3: Lead to the power supply line and GND
Step 4: Connection of 4-bit digital tube
Step 5: The connection of the buzzer
Step 6: The connection of the infrared receiving tube
2.Connect the pin 1 of the infrared receiving tube to the 220K current-limiting resistance and A3 pin fo the ICStation Mega. Connect the pin 2 of the infrared receiving tube to the cathode and pin 3 of the infrared receiving tube to the pin 51 of ICStation Mega
Step 7: The connection of photoresistance
1.Place the photoresistance on the bread board
2.Connect the pin 1 of the photoresistance to the GND, and pin 2 of the photoresistance to the A2 pin of the ICStation Mega, and connect a 220K resistance in series.
Step 8: The connection of LED
Step 9: The connection of switches and 1K current-limiting resistance
2.Connect the pin 1 of all four switches to the +5V, and pin 3 to the GND. Connect pin 2 of the hour switch to the A4, and connect pin2 of minute switch to A1;connect the pin2 of +/- switch to A0; Connect the pin2 of on/off switch to A6
Step 10: The experimental effect