UltraV: a Portable UV-index Meter




Scientist and researcher

Being unable to expose myself to the sun due to a dermatological problem, I used the time I would have spent on the beach to build an ultraviolet rays meter. UltraV.

It is built on an Arduino Nano rev3, with an UV sensor, a DC/DC converter to raise the 3v battery voltage, and a small OLED display. My main target was to keep it portable, so that I could easily know the UV-index in any moment and in any place.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts and Components

  • Microcontroller Arduino Nano rev.3
  • ML8511 UV sensor
  • 128×64 OLED diplay (SSD1306)
  • MT3608 DC-DC step-up
  • CR2 battery
  • CR2 battery holder
  • switch
  • enclosure case

Step 2: The Sensor

The ML8511 (Lapis Semiconductors) is an UV sensor, which is suitable for acquiring UV intensity indoors or outdoors. The ML8511 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.1µA, thus enabling a longer battery life.


  • Photodiode sensitive to UV-A and UV-B
  • Embedded operational amplifier
  • Analog voltage output
  • Low supply current (300µA typ.) and low standby current (0.1µA typ.)
  • Small and thin surface mount package (4.0mm x 3.7mm x 0.73mm, 12-pin ceramic QFN)

Unfortunately, I didn’t have the chance to find any UV-transparent material to protect the sensor. Any kind of transparent cover I tested (plastic, glass, etc.) was attenuating the UV measurement. The better choice seems to be quartz fused silica glass, but I haven’t find any at a reasonable price, so I decided to leave the sensor outside the box, in open air.

Step 3: Operations

To take a measure, just switch on the device and point it to the sun for several seconds, keeping it aligned with the direction of the sun rays. Then watch at the display: the index on the left always shows the instant measure (one each 200 ms), while the reading on the right is the maximum reading taken during this session: that’s the one you need.

In the lower left part of the display it is reported also the WHO equivalent nomenclature (LOW, MODERATE, HIGH, VERY HIGH, EXTREME) for the measured UV-index.

Step 4: Battery Voltage and Reading

I choose a CR2 battery, for its size and capacity (800 mAh). I used UltraV throughout the summer and the battery still reads 2.8 v, so I am quite satisfied of the choice. When operates, the circuit drains about 100 mA, but a reading measurement doesn’t take more than few seconds. As the battery nominal voltage is 3v, I added a DC-DC step up converter to bring the voltage up to 9 volts and connected it to the Vin pin.

In order to have the battery voltage indication on the display, I used an analog input (A2). Arduino analog inputs can be used to measure DC voltage between 0 and 5V, but this technique requires a calibration. To perform the calibration, you will need a multimeter. First power the circuit with your final battery (the CR2) and don’t use the USB power from the computer; measure the 5V on the Arduino from the regulator (found on the Arduino 5V pin): this voltage is used for the Arduino ADC reference voltage by default. Now put the measured value into the sketch as follows (suppose I read 5.023):

voltage = ((long)sum / (long)NUM_SAMPLES * 5023) / 1024.0;

In the sketch, I am taking the voltage measurement as an average over 10 samples.

Step 5: Schematic and Connections

Step 6: Software

For the display, I used the U8g2lib which is very flexible and powerful for this kind of OLED displays, allowing a wide choice of fonts and good positioning functions.

Concerning the voltage reading from the ML8511, I used the 3.3v Arduino reference pin (accurate within 1%) as a base for the ADC converter. So, by doing an analog to digital conversion on the 3.3V pin (by connecting it to A1) and then comparing this reading against the reading from the sensor, we can extrapolate a true-to-life reading, no matter what VIN is (as long as it’s above 3.4V).

int uvLevel = averageAnalogRead(UVOUT);
int refLevel = averageAnalogRead(REF_3V3);
float outputVoltage = 3.3 / refLevel * uvLevel;

Download the full code from te following link.

Step 7: Enclosure Case

After several (bad) tests on manually cutting the rectangular display window on a commercial plastic box, I decided to design my own for it. So, with a CAD application I designed a box and to keep it as small as possible, I mounted the CR2 battery externally on the back side (with a battery holder glued on the box itself).

Download the STL file for the enclosure case, from the following link.

Step 8: Possible Future Improvements

  • Utilize an UV spectrometer to measure actual real-time UV-Index values under various conditions (UV spectrometers are very expensive);
  • Simultaneously record output from the ML8511 with the Arduino microcontroller;
  • Write algorithm to relate ML8511 output to actual UVI value in real-time under a wide range of atmospheric conditions.

Step 9: Image Gallery

Step 10: Credits

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    14 Discussions

    Dr H

    1 year ago

    Very nice and well designed device.

    I had been playing with a VEML6075 UV sensor. It is a i2c sensor able to measure UV-A and B seperately. Have a look here: https://www.instructables.com/id/A-Talking-UV-inde...

    An option to cover the sensor might be a thin PTFE/Teflon membrane. It is highly transparent to UV light, but a very strong, nearly perfect diffusor. You may convince Millipore, GE or Pall/ThermoFisher to send you a small sample for free. Ask their sales services, or better a local sales rep. The membranes are watertight, but mechanically they are not very strong unless reinforced with other materials. So far I have not tried to use it myself, but it has been used by others, if I remember right.

    One thing I learned in the project was that the VEML6075 had to be directed directly to the sun to get maximum results, as measurements are very angle dependent. For a weather station, it might be helpful to use a sun tracker, e.g. as described by robot geek: https://www.instructables.com/id/Arduino-Sun-Track...

    How are your experiences with your sensor and setup concerning this topic?

    Best regards


    1 reply
    fmarzoccaDr H

    Reply 1 year ago

    Thank you very much for your comment and informations.
    Yes, I am working on a solar tracker with solar cells and rechageable batteries, but at the moment I don't have too much time for it.


    Tip 1 year ago on Step 2

    You would need a quartz protection for your sensor. Quartz does not absord UV.

    1 reply

    Reply 1 year ago

    Did you read the article?
    "The better choice seems to be quartz fused silica glass, but I haven’t find any at a reasonable price, so I decided to leave the sensor outside the box, in open air."


    1 year ago

    If you live near a university call their chemistry department and ask to speak to the lab coordinator. Students have a bad habit of breaking quartz curvettes and they might be willing to save a not too badly damaged one for you. Especially if you tell them what it's for, they tend to be geeks willing to help out the amateur scientist.


    1 year ago

    Very nice project - I like how you kept it such a small case and track the cumulative intensity.

    I built something similar into a permanent case on our boat dock, but used a single Adafruit NeoPixel (https://www.adafruit.com/category/168) to display a color that corresponds to the current UV intensity. It would be cool to add one to the center of your "sun" on the front of the case.

    BTW - I embedded my sensor in a small puck of clear, 2-part marine epoxy - seems to be holding up fairly well after a year in the sun.

    3 replies

    Reply 1 year ago

    I'm afraid that your marine epoxy is somehow attenuating the UV. Did you make some tests?


    Reply 1 year ago

    Yes, I tested it before & after embedding it, and it didn't make enough difference to really matter since I'm just using the UV rating to drive the NeoPixel. You could probably do the same and adjust the reading in the code.


    Reply 1 year ago

    Yes, it should be nice to add (just one multichromatic LED) in the center of the sun. Good idea, thanks!


    1 year ago

    A bit of a long shot, but maybe have a look at scientific glassware. I have used fused silica dishes in the past and some spectroscopy methods using UV will use cuvettes that are UV transparent. A diamond tile drill should be able to cut a small disk. Have you investigated all the main classes of plastics? The other thing that comes to mind are microscope slide cover slips which are very thin glass, albeit a bit fragile

    1 reply

    Reply 1 year ago

    Thanks for suggestions. Yes I tried to find small small fused silica dishes or laboratory cuvettes, with no luck (at least not at my budget).


    1 year ago

    Nice project. PS, you can put a piece of glass in front of it. Say the output voltage drops from 2.5V to 2V, no biggie just tell the Arduino to make 2V=2.5V. In other words calibrate it to a different curve.

    1 reply

    Reply 1 year ago

    Unfortunately you can't, I tried. It is not linear. Depending upon the glass, it filters some frequencies more than others, so it is useless. The right calibration should be done as I reported in Step 8.


    1 year ago

    Great project, and extremely useful too!