Introduction
The ML8511 is a UV sensor, which is suitable for acquiring UV intensity indoors or outdoors. iT is equipped with an internal amplifier, which converts photo-current to voltage depending on the UV intensity. This unique feature offers an easy interface to external circuits such as ADC. In the power down mode, typical standby current is 0.1A, thus enabling a longer battery life.
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 a analog voltage that is linearly related to the measured UV intensity (mW/cm2). If your microcontroller can do an analog to voltage conversion then you can detect the level of UV.
Applications
- Weather Station
- UV Index Monitoring
- DIY UV electronic project,etc...
Specification
- Supply Voltage: 3.3V - 5V
- Interface: Gravity Analog (PH2.0-3P,analog voltage output 1.0 - 2.8 VDC)
- Sensitivity Wave Length: UV-A (320 - 400nm), UV-B (280 - 320nm)
- Operating Temperature: -20 - 70°C
- Dimension: 30 x 22mm (1.18" x 0.87")
Connection Diagram
The ML8511 intensity graph
Mapping the outputVoltage to intensity is straight forward. No UV light starts at 1V with a maximum of 15mW/cm2 at around 2.8V. Arduino has a built-in map() function, but map() does not work for floats. Thanks to users on the Arduino forum, we have a simple mapFloat() function:
//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;
}
The following line converts the voltage read from the sensor to mW/cm2 intensity:
float uvIntensity = mapfloat(outputVoltage, 0.99, 2.8, 0.0, 15.0); //Convert the voltage to a UV intensity level
Sample Code
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.