I want to control LEDs using the LDR input readings. But I don’t know how the connections should be made. Can anyone help me out by providing a circuit connection for it
on which LDR reading do you make LED on?
For this system, you will need to connect the LDR and the LED together with the Bolt.
The connections are as follows
- +ve LED pin to 0 pin of Bolt.
- -ve LED pin to 1 pin of 330ohm resistor.
- 2nd pin of the 330ohm resistor to gnd pin of Bolt.
- 1 pin of LDR to 3.3v pin of the Bolt.
- 2nd pin of the LDR to A0 pin of the Bolt, along with 1 pin of 10k resistor.
- 2nd pin fo the 10k resistor to gnd pin of the Bolt.
You will then have to write your own code to use the following API on the Bolt Cloud to monitor the LDR output and accordingly set the LED on or off.