GA1A1S202 Log-Scale Analogue Light Sensor to Intel Galileo example

In this example we will connect a GA1A12S202 Log-Scale Analog Light Sensor to an Intel Galileo.

The GA1A1S202 Log-Scale Analogue Light Sensor is very simple sensor to use, just add power and then monitor the analogue output. Most light sensors have a linear response to the light intensity which means that they can be quite insensitive to low light levels and then max-out at high light levels. This sensor on the other hand has a logarithmic response which means that it is more sensitive in low light conditions when small changes in intensity make a big difference to a human eye. It’s also less sensitive to changes in very bright conditions when it takes a bigger change to register with the human eye.

The light sensor has a dynamic range of between 3 and 55,000 lux.

The features of this sensor are as follows

Output voltage increases with light on the sensor
Logarithmic response not only gives more sensitivity in low light, its also almost impossible to “max-out” the sensor
Dynamic range of 3 to 55,000 Lux
Use indoors and outdoors without needing to recalibrate!

Again these are typically best used in breakout/module form. Here is a picture of the module

 

Parts List

Label Part Type
Part1 Intel Galileo Gen2
Part2 Adafruit GA1A1S202WP

Layout

 

Code

This uses a library – https://github.com/arduinolearning/Arduino-Libraries/tree/master/GA1A12S202

 [codesyntax lang=”cpp”]
#include "GA1A12S202.h"

GA1A12S202 luxValue(A0);

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

void loop() 
{
    Serial.print("Raw value = ");
    Serial.print(luxValue.getRaw());
	Serial.println();
    Serial.print("Lux value = ");
    Serial.println(luxValue.getLux());
	Serial.println();
    delay(1000);
}

[/codesyntax]

Testing

Open the serial monitor and you should see the following

Raw value = 518
Lux value = 4.28

Raw value = 473
Lux value = 3.78

Raw value = 498
Lux value = 4.08

Raw value = 355
Lux value = 2.70

Raw value = 363
Lux value = 2.77

 

Links

 

 

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views :