TheML8511intensitygraph
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: