Datasheets are a very mixed bag, and unfortunately some of them are absolutely awful. Sometimes you’d almost think they don’t want you to be able to figure out how to use their device.
That said, what do you mean by the ALS value? Do you mean the Lux value? You can piece it together from the Python code in Pimoroni’s library:
def update_sensor(self):
"""Update the sensor lux and proximity values.
Will perform a read of the status register and determine if either an interrupt
has triggered or the new data flag for the light or proximity sensor is flipped.
If new data is present it will be calculated and stored for later retrieval.
Proximity data is stored in `self._ps0` and can be retrieved with `get_proximity`.
Light sensor data is stored in `self._lux` and can be retrieved with `get_lux`.
Raw light sensor data is also stored in `self._als0` and self._als1` which store
the ch0 and ch1 values respectively. These can be retrieved with `get_raw_als`.
"""
status = self._ltr559.get('ALS_PS_STATUS')
ps_int = status.ps_interrupt or status.ps_data
als_int = status.als_interrupt or status.als_data
if ps_int:
self._ps0 = self._ltr559.get('PS_DATA').ch0
if als_int:
als = self._ltr559.get('ALS_DATA')
self._als0 = als.ch0
self._als1 = als.ch1
self._ratio = self._als1 * 100 / (self._als1 + self._als0) if self._als0 + self._als1 > 0 else 101
if self._ratio < 45:
ch_idx = 0
elif self._ratio < 64:
ch_idx = 1
elif self._ratio < 85:
ch_idx = 2
else:
ch_idx = 3
try:
self._lux = (self._als0 * self._ch0_c[ch_idx]) - (self._als1 * self._ch1_c[ch_idx])
self._lux /= (self._integration_time / 100.0)
self._lux /= self._gain
self._lux /= 10000.0
except ZeroDivisionError:
self._lux = 0
Alternatively the datasheet says the formula is in Appendix A which seems to be missing, but this issue on Pimoroni’s Github suggests that Liteon will email it to you if you ask nicely.
does anyone have available a circuit diagram for what is on the breakout
Unfortunately Pimoroni don’t publish circuit diagrams. I2C pull-up resistors are built into the Pi. As far as I know, Breakout Garden boards have built-in level shifting, so I’d assume the two ICs beside the SDA/SCL pins are to do with that and I’d assume then that the IC beside the 3-6V pin is a voltage regulator.