DFRobot Ambient Light Sensor SKU:DFR0026

From Robot Wiki
Jump to: navigation, search
Ambient Light Sensor V2 SKU:DFR0026

Introduction

Here comes DFRobot's new Analog Ambient Light Sensor. Brand new design and much more convenient to use.This module help you to detect the light density and reflect the analog voltage signal back to Arduino controller. You can set the threshold of voltage level to trig other unit on Arduino project.

Specification

  • Supply Voltage: 3.3V to 5V
  • Illumination range : 1 Lux to 6000 Lux
  • Responsive time : 15us
  • Interface: Analog
  • Size:22x30mm

Application

  • Automatic screen brightness control

PinOut

DFR0026 Diagram.png
Color Pin
GREEN S
RED VCC
BLACK GND

Tutorial

Connection Diagram

Ambient Light Sensor Diagram


Arduino Sensor
A0 GREEN
5V RED
GND GRAY

Sample Code

void setup()
{
  Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
}
void loop()
{
      int val;
      val=analogRead(0);   //connect grayscale sensor to Analog 0
      Serial.println(val,DEC);//print the value to serial        
      delay(100);
}

Result

Open the serial port monitor, set the baud rate according to the program for 9600.The light intensity around the sensor is different, the received data is also different.The more light, the bigger the data.

Trouble shooting

More question and cool idea,visit DFRobot Forum

More

Nextredirectltr.pngClick to buy on DFRobot Store
Nextredirectltr.png DFRobot Distributor List