Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Proximity and Ambient Light Sensor with APDS-9930

View and Edit Project In Cirkit DesignerImage of Arduino UNO Proximity and Ambient Light Sensor with APDS-9930

Circuit Documentation

Summary

This circuit interfaces an Arduino UNO with an APDS-9930 Proximity and Ambient Light Sensor. The Arduino UNO reads proximity data from the sensor and prints the values to the Serial Monitor.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. APDS-9930 Proximity and Ambient Light Sensor

    • Description: A sensor that provides digital ambient light sensing (ALS), IR LED and a complete proximity detection system.
    • Pins: INT (not used), SDA, SCL, VCC (3.3V), GND, VL (not used)

Wiring Details

Arduino UNO

APDS-9930 Proximity and Ambient Light Sensor

Code Documentation

/*
 * Arduino Sketch for interfacing with APDS-9930 Proximity and Ambient Light
 * Sensor. This code initializes the sensor and reads proximity data, printing
 * the values to the Serial Monitor.
 */

#include <Wire.h>
#include <Adafruit_APDS9960.h>

Adafruit_APDS9960 apds;

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    delay(10); // Wait for Serial to be ready
  }

  Serial.println("APDS-9930 Proximity Sensor Test");

  if (!apds.begin()) {
    Serial.println("Failed to initialize APDS-9930!");
    while (1);
  }
  Serial.println("APDS-9930 initialized.");

  apds.enableProximity(true);
}

void loop() {
  uint8_t proximity = apds.readProximity();
  Serial.print("Proximity: ");
  Serial.println(proximity);
  delay(500); // Delay for half a second
}