The Flora SI1145 UV Sensor is a versatile and compact sensor module capable of measuring UV index, ambient light intensity, and infrared (IR) light intensity. This sensor is particularly useful in wearable technology, environmental monitoring, and any application where tracking UV exposure or light levels is crucial.
Pin Number | Name | Description |
---|---|---|
1 | VIN | Power supply (3.3V input) |
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() {
float UVindex = uv.readUV();
// The SI1145 gives UV index * 100, so divide by 100 to get the true UV index
UVindex /= 100.0;
Serial.print("UV Index: "); Serial.println(UVindex);
// Read visible and IR light levels
Serial.print("Visible: "); Serial.println(uv.readVisible());
Serial.print("IR: "); Serial.println(uv.readIR());
// Delay between readings
delay(1000);
}
Q: Can the sensor be used with a 5V microcontroller? A: Yes, but level shifters should be used on the I2C lines, and the sensor should still be powered with 3.3V.
Q: How can I extend the life of the sensor? A: Avoid prolonged exposure to extreme conditions, such as direct sunlight or high temperatures, and follow the recommended operating conditions.
Q: Is calibration required for the sensor? A: The sensor comes factory-calibrated, but for precise applications, you may need to calibrate it against a known light source.
Q: What is the I2C address of the Flora SI1145 UV Sensor? A: The default I2C address is 0x60.