Good quality and prompt delivery
NOVEL 12V 1Amp Industrial Grade SMPS Power Adapter
Ml8511 Ultra Violet Sensor Module
Couldn't load pickup availability
This is GYML8511 Analog Output Ultra-Violet Light Sensor Module. The GYML8511 module is easy to use the ultraviolet light sensor. The GYML8511 Sensor works by outputting an analog signal in relation to the amount of detected UV light.
This breakout can be very handy in creating devices that warn the user of sunburn or detect the UV index as it relates to weather conditions.
This sensor detects 280-390nm light most effectively. This is categorized as part of the UVB (burning rays) spectrum and most of the UVA (tanning rays) spectrum. It outputs an analog voltage that is linearly related to the measured UV intensity (mW/cm2).
Simply connect the output of the module to an ADC channel of the microcontroller to read UV Light intensity.

int UVOUT = A0; //Output from the sensor
int REF_3V3 = A1; //3.3V power on the Arduino board
//https://kitsguru.com/products/gyml8511-analog-output-ultra-violet-light-sensor-module-1
void setup()
{
Serial.begin(9600);
pinMode(UVOUT, INPUT);
pinMode(REF_3V3, INPUT);
Serial.println("MP8511 example");
}
void loop()
{
int uvLevel = averageAnalogRead(UVOUT);
int refLevel = averageAnalogRead(REF_3V3);
//Use the 3.3V power pin as a reference to get a very accurate output value from sensor
float outputVoltage = 3.3 / refLevel * uvLevel;
float uvIntensity = mapfloat(outputVoltage, 0.99, 2.9, 0.0, 15.0);
Serial.print("MP8511 output: ");
Serial.print(uvLevel);
Serial.print(" MP8511 voltage: ");
Serial.print(outputVoltage);
Serial.print(" UV Intensity (mW/cm^2): ");
Serial.print(uvIntensity);
Serial.println();
delay(100);
}
//Takes an average of readings on a given pin
//Returns the average
int averageAnalogRead(int pinToRead)
{
byte numberOfReadings = 8;
unsigned int runningValue = 0;
for(int x = 0 ; x < numberOfReadings ; x++)
runningValue += analogRead(pinToRead);
runningValue /= numberOfReadings;
return(runningValue);
}
//The Arduino Map function but for floats
//From: http://forum.arduino.cc/index.php?topic=3922.0
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
} //CREDITS : http://wiki.sunfounder.cc/index.php?title=GYML8511_UV_Sensor
| Operating voltage (VCC) | 3 V to 5V |
| Operating current | 120?A (typical) 190?A (max) |
| Operating Temperature | -40°C ~ +85°C |
| Dimensions | 3 x 2 x 1cms |
| Weight | 50 grams |