For the final project in my Internet of Things course, my team decided to create a smart light system in order to remotely control a LED bulb. The idea behind the smart light was to conserve energy by automatically adjusting the brightness of the LED depending on the ambient light in the room.
We interfaced the LED bulb, as well as a photoresistor and a transistor, with a Raspberry Pi. The photoresistor was used to determine the ambient brightness in the room in order to adjust the brightness of the LED accordingly. The transistor was used with the batteries to vary the brightness of the LED using the pulse width modulation (PWM) output from the Raspberry Pi.
To control the LED, I wrote Python scripts to read the input from the photoresistor and to adjust the LED brightness by varying the PWM output.
In addition to using Python, I used PHP with the Apache server on the Raspberry Pi to retrieve the user's input from the webpage and run the appropriate Python script.Back