View Source pmod_als (grisp v2.8.0)
Digilent Pmod_ALS module.
This component provides ambient light-to-digital sensing through the SPI2 interface on a 6-pin connector.
For further information about the Digilent Pmod_ALS and its components : https://store.digilentinc.com/pmod-als-ambient-light-sensor/
Texas Instrument's ADC081S021 analog-to-digital converter http://www.ti.com/lit/ds/symlink/adc081s021.pdf
Vishay Semiconductor's TEMT6000X01. http://www.vishay.com/docs/81579/temt6000.pdf
Start the driver with
1> grisp:add_device(spi2, pmod_als).
Summary
Functions
Returns a the percentage of current ambient light
based on the read/0
function. The value
is rounded to the closest integer.
Returns the ambient light value that is currently sensed by the ALS module. On success, the return value is a number in the 0..255 range that is proportional to the luminous intensity.
Functions
-spec percentage() -> 0..100.
Returns a the percentage of current ambient light
based on the read/0
function. The value
is rounded to the closest integer.
-spec read() -> 0..255 | no_return().
Returns the ambient light value that is currently sensed by the ALS module. On success, the return value is a number in the 0..255 range that is proportional to the luminous intensity.
Technically, the values are representative of the power perceived by the phototransistor from the light source incoming at an angle of ±60°. It is a model of the response of the human eye to the same light source that is obtained by calculating the luminosity function.
The peak wavelength sensitivity of the module is at 570nm making it close to the human eye (555nm). This implies that return values will be the highest when the ALS is exposed to wavelengths of green light with a slight yellow tint.