Professional Documents
Culture Documents
Aim:
To control the intensity of LED lights based on solar light using Raspberry Pi.
Apparatus Required:
S.No Name of the Component Description Quantity
1. Raspbery Pi Model 3 or Model 4 1
2. Keyboard - 1
3. Mouse - 1
4. Monitor - 1
5. LDR 3mm 1
5. Resistor 10K, 330ohms 1 each
6. LED 3mm 1
7. Bread Board - 1
8. Connecting Wires - few
Program:
from gpiozero import PWMLED, MCP3008 # import necessary packages
from time import sleep
led.value =1 - ldr.value
#change led brightness accordingly to the ldr value
print(ldr.value) #print the ldr value
sleep(1) #pause for 1 seconds
Output:
Result:
Thus the intensity of LEDs is controlled by sensing the solar light and implemented
successfully..