The Light Sensor Module provides a very simple analog output, so all you need to connect it to your Arduino or compatible board such as the Eleven is GND, 5V, and one analog input. On a 3.3V microcontroller such as Freetronics EtherDue or Arduino Due, VCC should be connected to 3.3V instead of 5V.

The module actually accepts any power source (VCC) between 3.0 and 5.5Vdc. Output voltage will vary between 0V and slightly less than VCC.

You can use whichever analog input suits you best, but for this example we'll use A0:

That's it! Couldn't be much easier.

The code is very simple as well. Just perform an "analogRead()" call on the appropriate input to get a value between 0 and 1023 that represents the light level being detected. Copy and paste the following code into a new sketch in the Arduino IDE, compile it, upload it to your Arduino, and then open the serial monitor with the baud rate set to 38,400bps:

int lightLevel; 

void setup()

void loop() 
  lightLevel = analogRead(A0);
  Serial.println(lightLevel, DEC);

The light level will be reported five times per second via the serial console.