Ambient Light and Proximity Measurement

Ambient Light and Proximity Measurement

Objective

This experiment uses an ambient light and proximity sensor to measure the surrounding light intensity and the proximity of an object.

Required Components

Working Principle

The TCS3200 sensor detects light intensity and proximity by converting light into frequency, which is then processed by the Arduino.

Circuit Wiring

To connect the TCS3200 sensor to the Arduino, follow the steps below:

Ensure all connections are tight and double-check for errors before powering up the circuit.

Arduino Code


/*
 * Ambient Light and Proximity Measurement
 * This code measures light intensity and proximity using the TCS3200 sensor.
 */

int lightPin = A0;  // Light sensor connected to analog pin A0
int proxPin = A1;  // Proximity sensor connected to analog pin A1

void setup() {
  Serial.begin(9600);
}

void loop() {
  int lightValue = analogRead(lightPin);
  int proxValue = analogRead(proxPin);
  
  Serial.print("Light Intensity: ");
  Serial.print(lightValue);
  Serial.print(" Proximity: ");
  Serial.println(proxValue);
  delay(1000);
}
            

Results

The serial monitor will display the measured light intensity and proximity data.

Applications

Conclusion

The TCS3200 sensor is an effective tool for measuring light intensity and proximity, with applications in lighting systems, security, and automation.