Build a Light Meter With the TEMT6000 Sensor and ESP32
by simple silicon in Circuits > Arduino
568 Views, 1 Favorites, 0 Comments
Build a Light Meter With the TEMT6000 Sensor and ESP32
Your phone knows when you walk outside and automatically brightens the screen. Your camera adjusts its lens based on light. Smart homes dim lights when the sun sets. All use a simple sensor.
Today, you will build your own light meter that measures brightness just like professional equipment used in studios and nurseries. And it costs less than a dollar.
No experience needed. Every step is explained. Let us build.
What Is the TEMT6000?
The TEMT6000 is a tiny light sensor made by Vishay. Inside is a phototransistor that lets more electricity flow when light hits it. Brighter light equals more electricity flowing.
Connect it to an ESP32, and the board measures electricity flow. Using simple math, we turn that into a lux reading. These types of ambient light sensors are used in cameras, phones, and greenhouse systems.
The TEMT6000 module has three metal pins. Each does a different job:
Think of it as a conversation. VCC says hello with power. SIG delivers the message about brightness. GND says goodbye as the signal returns.
Supplies
Hardware
- ESP-WROOM-32 development board
- TEMT6000 sensor module
- Breadboard
- Jumper wires or wires
- USB cable - (Micro USB B cable)
Software (All Free)
- Arduino IDE
Circuit Diagram & Wiring
Here is how the three wires connect your sensor to the ESP32:
⚠️ Important: Do NOT use 5V. Use only 3.3V.
Install Arduino IDE
Arduino IDE is where you write code and send it to your ESP32. Five quick steps:
- Download Arduino IDE 2 from arduino.cc for your computer (Windows, Mac, or Linux).
- Install it and open it.
- Click File > Preferences. In the Additional Boards Manager URLs field, paste: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Go to Tools > Board > Boards Manager. Search for ESP32 and click Install on the one by Espressif.
- Select your board: Tools > Board > ESP32 Arduino > ESP32 Dev Module.
Done. Arduino IDE now knows how to talk to your ESP32.
The Code
Copy this code into the Arduino IDE. Every line has a comment explaining what it does.
Upload the Code:
- Copy the entire code above and paste it into the Arduino IDE.
- Plug your ESP32 into your computer with the USB cable.
- Click the Upload button (the arrow at top left).
- After 10 seconds, you will see Upload done.
Downloads
Output
Now the exciting part. See the sensor working.
- Open Arduino IDE. Go to Tools > Serial Monitor.
- At the bottom right, set the baud rate to 115200.
- You will immediately see readings appearing every half-second.
Quick Reality Checks
Try these to confirm your sensor works:
- Cover the sensor with your hand. The lux number drops close to zero.
- Uncover it. The number jumps back up.
- Hold it near a bright window. The lux increases noticeably.
- Turn off the room light. The lux drops dramatically.
Conclusion
You just built a working light sensor from scratch. You wired a circuit, learned the math behind light measurement, wrote code, and got real data.
Happy building!