When you search for a light sensor wire diagram, you will inevitably encounter two distinct types of modules: digital I2C sensors (like the BH1750) and analog phototransistors (like the TEMT6000). Conflating the two is a common mistake that leads to fried GPIO pins or nonsensical serial monitor readings. This guide focuses strictly on the analog 3-pin TEMT6000 breakout board, providing the exact wiring, the raw-to-unit math required to convert ADC readings into Lux, and the real-world interference traps that ruin prototype accuracy.
Sensing Principle: How the TEMT6000 Measures Light
The TEMT6000 is an NPN epitaxial planar silicon phototransistor. Unlike basic cadmium sulfide (CdS) photoresistors that change bulk resistance, a phototransistor uses incoming photons to generate base current, which is then amplified by the transistor's internal gain (hFE). When light strikes the base-collector junction, electron-hole pairs are created, allowing current to flow from the collector to the emitter proportionally to the light intensity.
This physical mechanism makes the TEMT6000 significantly faster and more linear than an LDR, with a spectral response peaking around 570nm (visible green-yellow light) that closely mimics the human eye. Because it acts as a current source rather than a variable resistor, the output is not a native voltage; interfacing it requires a physical load resistor on the breakout board to convert the output current into a measurable analog voltage.
Light Sensor Wire Diagram & Pinout Table
The standard TEMT6000 breakout board features three pins. The output signal is an analog voltage ranging from 0V to VCC, dictated by the ambient light striking the sensor and the value of the onboard pull-down resistor (typically 10kΩ on SparkFun and generic clones).
| Module Pin | ESP32 Pin | Arduino Uno Pin | Description | Supply Range |
|---|---|---|---|---|
| VCC | 3V3 | 5V | Power Input | 3.3V - 5.0V DC |
| GND | GND | GND | Ground Reference | 0V |
| SIG (OUT) | GPIO 34 | A0 | Analog Signal Out | 0V - VCC |
Numbered Wiring Steps
- De-energize the board: Disconnect the USB cable or power supply from your microcontroller before making connections.
- Connect Ground: Route a black jumper wire from the sensor's GND pin to any GND pin on your microcontroller.
- Connect Power: Route a red jumper wire from the sensor's VCC pin to the 3V3 pin (for ESP32) or 5V pin (for Arduino Uno).
- Connect Signal: Route a yellow jumper wire from the sensor's SIG pin to your designated ADC pin (e.g., GPIO 34 on ESP32 or A0 on Arduino).
- Verify: Use a multimeter in continuity mode to ensure GND is not shorted to VCC before applying power.
Converting Raw ADC Readings to Lux (The Math)
Reading the analog pin only gives you a raw digital number. To get a physical unit (Illuminance in Lux), you must scale the raw ADC value to voltage, convert voltage to current, and then apply the sensor's responsivity curve. Calibration is absolutely necessary here because microcontroller ADCs (especially on the ESP32) are notoriously non-linear at the voltage rails.
According to the Vishay TEMT6000 datasheet, the sensor passes approximately 2.0 µA of current at 1000 Lux (with a collector-emitter voltage of 2.0V). Assuming your breakout board uses the standard 10,000Ω (10kΩ) load resistor, the math flows as follows:
- Raw to Voltage:
V_out = (ADC_raw / Max_ADC) * V_ref - Voltage to Current:
I_amps = V_out / 10,000 - Current to Lux:
Lux = (I_amps * 1,000,000) * 2.0
For a 12-bit ESP32 ADC (Max_ADC = 4095) running at 3.3V, this simplifies algebraically to:
Lux = V_out * 200
Here is the complete, copy-pasteable C++ implementation for the ESP32, utilizing the modern analogReadMilliVolts() function to bypass the ESP32's raw ADC non-linearity issues:
// ESP32 TEMT6000 Lux Calculation
const int LIGHT_PIN = 34;
const float V_REF = 3.3;
const int LOAD_RESISTOR = 10000; // 10k Ohm on breakout
void setup() {
Serial.begin(115200);
analogReadResolution(12); // Ensure 12-bit resolution (0-4095)
}
void loop() {
// analogReadMilliVolts uses eFuse calibration data for accuracy
uint32_t mV = analogReadMilliVolts(LIGHT_PIN);
float volts = mV / 1000.0;
// Calculate Current in Amps
float amps = volts / LOAD_RESISTOR;
// Convert to microamps, then to Lux (2 uA = 1000 Lux -> multiplier is 2.0)
float lux = (amps * 1000000.0) * 2.0;
Serial.print("Voltage: ");
Serial.print(volts);
Serial.print(" V | Lux: ");
Serial.println(lux);
delay(500);
}
Interference, Calibration, and Edge Cases
Even with perfect wiring and math, environmental interference will corrupt your data if you do not account for it in software or physical placement.
- 50Hz/60Hz Mains Flicker: LED drivers and fluorescent ballasts pulse light at 100Hz or 120Hz. Because the TEMT6000 has a microsecond response time (unlike slow LDRs), it will capture this ripple. Fix: Do not take a single analog reading. Sample the pin 60 times over a 20ms window and average the results to integrate out the AC ripple.
- IR and UV Bleed: While the TEMT6000 includes an IR-cut filter, it is not perfect. Placing the sensor near an incandescent bulb or a heat source will yield artificially high Lux readings due to near-infrared radiation. Fix: Use the sensor strictly for ambient daylight or LED room lighting, and shield it from direct thermal sources.
- ESP32 ADC Non-Linearity: The ESP32's internal ADC is highly inaccurate below 0.15V and above 3.1V. If your sensor is in a very dark room, the raw reading will bottom out and fluctuate wildly. Fix: As shown in the code above, always use
analogReadMilliVolts()rather thananalogRead()to leverage the chip's factory-stored eFuse calibration curves.
Frequently Asked Questions
How to read a 3-pin light sensor wire diagram for Arduino?
A standard 3-pin diagram will label the pins as VCC (or +), GND (or -), and SIG (or OUT, or AO). Connect VCC to the Arduino's 5V pin, GND to any GND pin, and SIG to an analog pin like A0. Never connect the SIG pin to a digital pin (like D2) unless you are using a digital sensor module with a built-in comparator potentiometer, which is a different circuit entirely.
Why does my light sensor wire diagram show a resistor to ground?
The phototransistor inside the TEMT6000 only regulates current; it does not output a voltage on its own. The resistor to ground (the load resistor, typically 10kΩ) is required to create a voltage drop that the microcontroller's ADC can measure. If you are wiring a bare TEMT6000 component instead of a pre-built breakout module, you must physically solder a 10kΩ resistor between the emitter pin and ground, and read the voltage at that exact junction.
Can I use a 5V light sensor wire diagram with a 3.3V ESP32?
Yes, but you must wire the VCC pin to the ESP32's 3V3 output, not the 5V (VIN) pin. The TEMT6000 operates perfectly fine between 3.3V and 5.0V. If you power the sensor with 5V, the analog SIG pin could output up to 5V in bright light, which will exceed the ESP32's 3.3V GPIO tolerance and permanently damage the microcontroller's ADC pin. Always match the sensor's VCC to the microcontroller's logic level.






