Hello friends, I hope you all are doing great. Today, I am going to share the new ML8511 UV Sensor Library for Proteus Simulation. The ML8511 is a small sensor that measures the ultraviolet light of the sun - the UV-A and UV-B that tan and burn the skin - and turns it into a simple analog voltage. With this library you can run a full Proteus simulation of it, through a whole summer day, and test your UV meter before you take it outside.
ML8511 UV Sensor Library for Proteus
Latest version: V1.0 (November 2026, this tutorial)
Other light sensors: BH1750 · TCS34725 · LDR · APDS-9960 · AS7341
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The module is drawn at its real size and comes alive at run time: its PWR LED works and the sensor's die glows violet with the UV it sees. The demo is a UV index lamp - an RGB LED that changes colour from green in the morning to violet at noon, and a buzzer that chirps when it is time for shade and sunscreen.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the photodiode board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the ML8511 UV Sensor Library for Proteus Simulation:
What is the ML8511?
The ML8511 from LAPIS (ROHM) is an ultraviolet light sensor: a photodiode that responds to light from about 280 to 390 nm - UV-B and UV-A, the most at about 365 nm - and an amplifier that turns its tiny current into a voltage. It needs no setup and no protocol: power it, enable it, and read one analog pin. That makes it a favourite for weather stations, UV index meters, wearable sun alarms and UV lamp checkers.
| ML8511 | |
|---|---|
| Senses | UV-A and UV-B, about 280 - 390 nm (the most at 365 nm) |
| Output | an analog voltage: about 0.99 V in the dark, about 2.8 V at 15 mW/cm2 |
| Supply | 2.7 - 3.6 V, about 300 uA; EN low = standby, about 0.1 uA |
| Package | 4.0 x 3.7 mm, a clear mould |
| Our module | 18 x 12 mm, a 3.3 V regulator, pins VIN, 3V3, GND, OUT, EN |
UV-A, UV-B and the UV Index
Sunlight carries a little ultraviolet next to the light we see. UV-A (315 - 400 nm) reaches deep into the skin and ages it; UV-B (280 - 315 nm) causes sunburn. The UV index that weather reports give is not the raw UV power but the power weighted by how strongly each wavelength burns - heavily towards UV-B. The ML8511 measures the unweighted UV in mW/cm2, so a true index needs a weighted sensor; for sunlight, whose mix of UV-A and UV-B changes little, an estimate from the intensity is fair. Our demo uses a rough 1.7 index points per mW/cm2 and says so.
How the ML8511 Works: One Voltage
The ML8511's output is linear. In the dark it sits at about 0.99 V; every mW/cm2 of UV adds about 0.12 V, up to about 2.8 V at 15 mW/cm2. So the intensity is simply:
| Quantity | Formula |
|---|---|
| Intensity | (VOUT - 0.99) x 15 / (2.8 - 0.99) mW/cm2 |
| VOUT from two readings | 3.3 V x A(OUT) / A(3V3) |
| UV index (our sunlight estimate) | about 1.7 x intensity |
Why Read the 3.3 V Pin Too?
The ML8511's signal is small - 0.12 V per mW/cm2 - and an Arduino's analog reading is measured against its own 5 V, which can easily be off by a few percent. The module's regulator, however, makes a stable 3.3 V and brings it out on the 3V3 pin. Read OUT on one analog pin and 3V3 on another: their ratio times 3.3 V is the output voltage, whatever the board's supply does.
EN: On and Standby
EN switches the sensor: high and it is active, drawing about 300 uA; low and it sleeps on 0.1 uA with its output at 0 V. Most designs tie EN to 3V3 and forget it; a battery-powered UV logger can switch it on only for each reading.
Features of the ML8511 UV Sensor Library for Proteus Simulation
- A real-looking module: the blue board at its real size, 18 x 12 mm, with the clear-moulded sensor and its die, the regulator, the capacitors and our small TEP mark.
- Animated: the PWR LED and the sensor's die glowing violet with the UV it sees.
- The real behaviour: OUT = 0.99 V + 0.12 V per mW/cm2, its limit, standby with EN low, and the regulator's 3.3 V on the 3V3 pin.
- A summer day: the sun's UV from sunrise to sunset, peaking at noon, with a cloud after midday; a clock to run the day in seconds; chips for the night, the morning, noon, a UV lamp, a cloud and the shade.
- A pop-up: the sky with the sun on its arc and the cloud, the UV and OUT through the day, eight live tiles, graphs, an event log and a check page.
- A complete package: about 2.2 MB with the library, our RGB LED, passive buzzer and resistor libraries, our Arduino UNO V4.0 and the demo, without the source code of the model.
The ML8511 in Proteus
The device is ML8511TEP in TEPML8511.LIB, under Sensors > Optical, with the prefix U and the model TEPML8511.DLL. Search ML8511 or UV in Pick Devices. It has five pins along the bottom: VIN (3.3 to 5 V), 3V3 (the regulator's output), GND, OUT and EN. Its properties describe the sky: PROFILE (DAY or STEADY), UV (the steady UV), PEAK (the sun's UV at noon) and SPEED (the day's clock - 1800 runs half an hour of the day each simulated second).
Download ML8511 UV Sensor Library for Proteus Simulation
Click the button below to download ML8511-UV-Sensor-Library-for-Proteus-v1.0.zip (about 2.2 MB, without the source code of the models):
ML8511 UV Sensor Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPML8511.LIB,TEPRGB.LIB,TEPRESISTOR.LIB,TEPPASSIVE.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPML8511.DLL,TEPRGB.DLL,TEPRESISTOR.DLL,TEPPASSIVE.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch.
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install ML8511 UV Sensor Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPML8511.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for ML8511.
Proteus Simulation of a UV Index Lamp
Our demo is a lamp that tells you how strong the sun is. U1 is the ML8511 with PROFILE DAY: the day starts at 06:00 and runs half an hour every simulated second, the sun's UV climbs to 6.5 mW/cm2 at noon, a cloud covers it from 12:30 to 13:30, and the sun sets at 18:00. Its OUT goes to A0 of our Arduino UNO Library for Proteus V4.0 and its 3V3 to A1 - and to its own EN, so the sensor is always on. D1 is a common-cathode LED from our RGB LED Library for Proteus on pins 9, 10 and 11, and BZ1 a buzzer from our Passive Buzzer Library for Proteus on pin 8. The Arduino's built-in monitor is the same window as our TEP Serial Monitor Advance for Proteus. Open ML8511-UV-ArduinoUnoV4.pdsprj.
The Sketch
Every half second the sketch averages eight readings of A0 and eight of A1. Their ratio gives the output voltage without trusting the board's 5 V:
const float vout = 3.3 * uvLevel / refLevel; // the ratio cancels the board's own supply
The maker's straight line turns it into an intensity:
float mw = mapFloat(vout, 0.99, 2.8, 0.0, 15.0); // mW/cm2
and our rough rule for sunlight turns that into a UV index - honest about being an estimate:
const float K_UVI = 1.7; // our rough estimate: UV index per mW/cm2 of sunlight
The index, rounded to a whole number, picks the colour of the RGB LED - green for 0 - 2, yellow for 3 - 5, orange for 6 - 7, red for 8 - 10 and violet for 11 and above - and from "very high" on the buzzer chirps every two seconds:
if (level >= 3 && millis() >= beepAt) { tone(BUZZER, 2400, 80); beepAt = millis() + 2000; }
ML8511 Simulation Results
Open the project and press Run. The demo runs 24.5 simulated seconds - a day from 06:00 to after sunset - and took 300 seconds on our PC with the pop-up open and the pictures being taken. Click the module for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
Morning
At 07:00 the sun is still low and the UV at the sensor is 0.57 mW/cm2: OUT rises from the dark level of 0.99 V to 1.059 V, the sketch reads about 0.6 mW/cm2 - index 1, LOW - and the lamp is green. By 08:15 the UV has quadrupled to 2.24 mW/cm2 (OUT 1.260 V): index 3, MODERATE, and the lamp turns yellow. The pop-up shows the sun climbing its arc and the violet UV curve rising with it.
Noon
By 09:36 the UV is 4.44 mW/cm2 (OUT 1.525 V) and the lamp turns orange - HIGH; at 10:30, with 5.63 mW/cm2, it turns red and the buzzer starts to chirp every two seconds - VERY HIGH. At noon the sun is at its highest: 6.50 mW/cm2 at the sensor and OUT at 1.774 V. The sketch reads 6.48 mW/cm2, an index of 11 - EXTREME - and the lamp glows violet.
A Cloud After Noon
At 12:30 a cloud slides in front of the sun. At 13:00 the UV is down to 2.75 mW/cm2 and OUT to 1.322 V; the index falls to 5 - MODERATE - the lamp turns yellow and the buzzer stops. The pop-up's chart shows the bite the cloud takes out of the day's curve.
Afternoon and Sunset
At 13:30 the cloud has passed and the UV jumps back: 5.02 mW/cm2 at 14:00 (OUT 1.596 V), and the lamp is red again. Through the afternoon it falls - 1.87 mW/cm2 at 16:00 (yellow), about 0.5 at 17:00 (green) - and after sunset OUT is back at 0.99 V, the dark level of the sensor. All day long the sketch's reading, 3.3 V x A0 / A1, matched OUT within a few millivolts.
The Graphs, the Event Log and the Check Page
The Graphs page plots the UV at the sensor, OUT, the 3V3 pin and the index estimate. The Event log keeps the power-on, noon, the cloud and the sunset. The Check page sums up the run: VIN 5.00 V, the 3V3 pin at 3.30 V, EN high and the sensor active, OUT 1.774 V at the most for 6.50 mW/cm2, and about 300 uA for the sensor.
The monitor shows the sketch's side: every two seconds and at every change of level, the time, OUT, the intensity, the index and its advice.
Clouds, Shade and Glass
UV behaves differently from the light we see. Thin clouds let most of it through - sunburn on a hazy day is common - while thick clouds cut it by half or more, as in our demo. Shade helps, but the open sky still sends scattered UV. And ordinary window glass blocks most of the UV-B: a UV sensor behind a window reads far too low, which is why outdoor UV meters use quartz or PTFE windows. For the visible sunlight, our Solar Irradiance Sensor Library for Proteus measures the full irradiance in W/m2.
Testing with a UV Lamp
A UV LED or a black light is a handy test source on the bench - our IR UV LED Library for Proteus has one. Close to the sensor it can give far more UV than the sun; click UV lamp in the pop-up to see 12 mW/cm2 and OUT near 2.4 V. The index estimate means nothing for such a lamp, though: its narrow 365 or 395 nm light has almost none of the UV-B that the index is about.
Try It Yourself
- Click Shade at noon: the UV falls to a third and the lamp drops from violet to yellow.
- Click UV lamp: OUT jumps to about 2.4 V - then try the index rule on it and see why it fails.
- Change the module's PEAK to 9 for a tropical noon: the lamp stays violet for hours.
- Disconnect EN from 3V3: OUT falls to 0 V - standby - and the sketch reads nothing.
- Read OUT against the 5 V reference only (drop A1): the readings now follow the board's supply.
Ideas to Extend the Demo
- Add up the UV through the day for a personal sun dose, and warn when it passes a limit.
- Put the sensor on a weather station next to the irradiance sensor: the UV share of the sunlight through the day.
- Switch EN from a pin and sleep between readings for a battery UV logger.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real ML8511
- 3.3 V: the bare sensor runs at 2.7 - 3.6 V; on a 5 V board use a module with a regulator, as ours.
- The reference: read OUT against the module's 3.3 V on a second analog pin.
- The window: glass and most plastics block UV-B; leave the sensor open or use quartz or PTFE.
- The index: the ML8511 is not weighted like the UV index; treat an index from it as an estimate for sunlight only.
- Average: the signal is small; average a few readings to steady it.
Troubleshooting
- OUT is 0 V: EN is low - tie it to 3V3 - or VIN is missing.
- OUT stays at about 1 V: no UV reaches the sensor - glass, the shade or the night.
- The readings wander: they follow the board's 5 V; read OUT against the 3V3 pin.
- The index looks too high under a lamp: the estimate is for sunlight only.
- The part is not simulated:
TEPML8511.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The output line (0.99 V in the dark, 2.8 V at 15 mW/cm2), the standby with EN low and the module's 3.3 V follow the maker's datasheet and the usual breakout; the module is our own drawing of an ML8511 board.
- Our own choices: the day's UV curve, the cloud and the shade factors, the output's settling, limit and noise, and the UV index estimate of 1.7 per mW/cm2.
- Not modelled: the spectral response curve, the temperature drift and the sensor's angle of view.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the maker of the ML8511.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the ML8511 UV Sensor Library for Proteus Simulation. I hope it helps you build your UV meter, your weather station or your sun alarm before the real sensor arrives - and shows that measuring the sun's UV is a simple thing at heart: one photodiode, one amplifier and one straight line. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!