Have you ever wanted to know if your light is on in your room? What if you are out of town and have forgotten if you turned off the living room lamp? This project allows you to see the light levels of a room from a simple webpage that updates every second.VideoWiring
To begin, solder some headers to the ESP8266 Thing Dev board. Next, I connected the LDR to a 10k pulldown resistor and 3.3v. An LDR changes resistance based on the level of light that hits it. Then I used a jumper wire to connect the 10k resistor to the ADC pin.
<meta http-equiv="refresh" content="1">
after the <p> tags. Don't forget to include your WiFi credentials in the attached sketch.
Now, just visit the IP address of the ESP8266 to view the page, in my case it was 192.168.0.41. Be sure to allow websites to refresh automatically in your browser settings. If you would like to view the page when you're not on the same network, such as on a phone using data, port forward to the IP address of the ESP8266. So instead of 192.168.0.41, for example, I would type
is your external IP address and
is the port you set up in your router settings. And that's it! Now you can check if your lights are on or off without being in the room! Try making the device turn off a lamp if you click a button on the webpage for an added challenge!