GA1A12S202 Log-scale light sensor - Power supply and read frquency

I've recently purchased a couple of Adafruit GA1A12S202 Log-scale light sensors for a robotics project. I used the demo code for testing on an Arduino Micro and Arduino Nano (both with AREF pin connected to +3.3V pin and VCC connected to +5V pin).

int sensorPin = A0;
float rawRange = 1024; // 3.3v
float logRange = 5.0; // 3.3v = 10^5 lux

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

void loop() 
{  
  int rawValue = analogRead(sensorPin); // read the raw value from the sensor  
  Serial.print("Raw = ");
  Serial.print(rawValue);
  Serial.print(" - Lux = ");
  Serial.println(RawToLux(rawValue)); 
  delay(1000);
}

float RawToLux(int raw)
{
  float logLux = raw * logRange / rawRange;
  return pow(10, logLux);
}

When I checked the datasheet (https://cdn-shop.adafruit.com/datasheets/GA1A1S202WP_Spec.pdf) I noticed a few points

  • Recommended supply voltage = 2.3 - 3.2 V
  • Rise time (3 - 55000lx) = 5 ms
  • Fall time (3 - 55000lx) = 15 ms

I then did a simple test (with Arduino Micro) changing the supply voltage between 3.3 and 5 Volt pins under two light conditions with the following (summarized) results
5V (room) Raw = 352 - 370 | Lux = 52.33 - 64.07
3.3V (room) Raw = 308 - 313 | Lux = 31.91 - 33.75
3.3V (torch) Raw = 484 - 487 | Lux = 230.82 - 238.74
5V (torch) Raw = 514 - 555 | Lux = 323.42 - 512.82
5V (room) Raw = 338 - 374 | Lux = 44.71 - 67.01
3.3V (room) Raw = 304 - 312 | Lux 30.51 - 33.38

All the online examples I've seen use a 5 volt supply with a delay of 1 or 2 seconds between readings. My questions are

  • What is the best supply voltage
  • What is the minimum delay between readings

Adafruit GA1A12S202: GA1A12S202 Log-scale Analog Light Sensor : ID 1384 : $3.95 : Adafruit Industries, Unique & fun DIY electronics and kits (Discontinued).
Demo code in the Tutorial: Programming | Adafruit GA1A12S202 Log-scale Analog Light Sensor | Adafruit Learning System.

It is a simple sensor. It is not meant to measure the lux in a accurate way. There are others sensors that can measure lux.

According to the datasheet:
Absolute maximum: 7.0 V
Recommended operating voltage: 2.3 ... 3.2 V

1. Voltage
The datasheet is always right (unless there is a newer version of the datasheet :wink: )
It will get damaged at a voltage higher than 7.0V.
It might not behave according to the specifications between 3.3 and 7.0V.
The specifications in the datasheet are only valid for the recommended operating voltage.

I suggest to use 3.3V. That is 0.1V too high, so it might be a very little more inaccurate than the specifications in the datasheet.
When everyone else uses 5V, that means nothing. They all could be wrong. Perhaps everyone copied the wrong thing from one another. Such things do happen sometimes.

2. Timing
It is a analog output. You can call analogRead() as many times as you wish. For example once per year or hundreds of times per second.

The speed of the sensor is mentioned because that is important when fast things needs to be measures.
Suppose someone is sending pulses with a led at a rate of 1 kHz. Then the 15 ms fall time means the sensor is too slow for that.

The rise/fall times in bright light are 150µs, note. Only in dim light does the increasing impedance
of the photodiodes cause a slow-down in response.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.