The Adafruit SI1145 is a multifunctional sensor capable of detecting ultraviolet (UV) light, infrared (IR) light, and visible light. It is designed to measure the UV Index, which is an international standard measurement of the strength of sunburn-producing ultraviolet radiation at a particular place and time. Additionally, it can measure IR levels and ambient light levels, making it a versatile choice for environmental monitoring, weather stations, or projects requiring light sensing capabilities.
Pin Number | Name | Description |
---|---|---|
1 | VIN | Power supply (3.3V to 5V) |
2 | GND | Ground connection |
3 | SCL | I2C clock line |
4 | SDA | I2C data line |
5 | INT | Interrupt pin (active low) |
#include <Wire.h>
#include "Adafruit_SI1145.h"
Adafruit_SI1145 uv = Adafruit_SI1145();
void setup() {
Serial.begin(9600);
if (!uv.begin()) {
Serial.println("Didn't find Si1145");
while (1);
}
Serial.println("Si1145 is ready!");
}
void loop() {
Serial.println("===================");
Serial.print("Vis: "); Serial.println(uv.readVisible());
Serial.print("IR: "); Serial.println(uv.readIR());
// Read UV index and divide by 100 to get the actual value
Serial.print("UV: "); Serial.println(uv.readUV() / 100.0);
delay(1000);
}
Q: Can the SI1145 sensor measure UVB and UVC? A: The SI1145 is designed primarily to measure UVA and the UV Index, which is related to the effect of UVA and UVB on human skin. It does not measure UVC.
Q: Is calibration required for the SI1145 sensor? A: The sensor comes factory-calibrated for UV Index measurements. However, for precise applications, additional calibration against a known light source may be necessary.
Q: How can I use the interrupt feature? A: The INT pin can be used to trigger an interrupt on your microcontroller when certain light thresholds are reached. This requires additional programming to set up the interrupt thresholds and handle the interrupt signal.
Q: What is the maximum distance for reliable I2C communication with the SI1145? A: I2C is typically used for short-distance communication, usually not more than a meter. For longer distances, consider using I2C buffer or extender chips.