The objective of this project is to change the brightness of the computer screen according to the brightness in the room. Here to determine the light intensity in the room, I used a LDR and a bolt Iot wifi module.
The circuit detects the room's light intensity and the value is read by the python code every 5 seconds, then the screen brightness is adjusted to appropriate value using simple if else statements.
CircuitDiagram
Steps to connect:
1. Make sure Bolt WiFi Module is off while connecting the circuit so there wont be any short circuits.
2.Connect one lead of the LDR to the 3V pin and the other lead into the A0 pin of the Bolt Module.
3. Connect one leg of the 330 Ohm resistor to the GND pin and the other leg to the A0 pin of the Bolt Module
NOTE: Make sure that the connections are proper. Make sure that the wires or pins connecting the 3V pin and GND do not touch other.
4. The circuit is ready and the device can be switched on.
5. Run the python code and the brightness of the screen is adjusted automatically every 5 seconds.
DemonstrationCodeEvery bolt wifi module has a device id and a unique api key to identify and retrive data. Store them in conf.py
Save the conf file in the same directory where code.pyis. Run the code.py file using any code editor or CLI.(Install relevent python packages before running the code)
The screen brightness is then adjusted based on the value of A0 pin every 5 seconds.
Comments