Source: https://mokxi.com/parts/ltr390
Updated: 2026-11-22

Part

# UV and light, LTR-390

The UV index and the visible light from one sensor, 13 to 20-bit counts at gain 1 to 18.

See every part

- 5 pins
- 2 settings
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## The UV and light, LTR-390 in brief

What it is, and every setting the properties panel gives it.

The Lite-On LTR-390UV is a digital sensor that reads the UV index or the visible light level over I2C at address 0x53, one at a time. It offers 13 to 20 bit readings at a gain of 1 to 18, so the same light can be read with more or fewer counts. The UV index is the number the weather forecast gives, 0 at night to 11 and more at noon in summer, which makes the part a natural sunburn warning. The Mokxi model exposes two properties, uvi for the UV index and lux for visible light, changed with sliders. It reads through Adafruit's library, shipped as Adafruit_LTR390.h. The model leaves out the interrupt pin, which it holds high-Z, the window factor of a cover over the sensor, and the spectral response. On real hardware you would set MAIN_CTRL for UV or light mode and MEAS_RATE and GAIN for resolution and gain, but in the simulator the sliders are what matter.

Family

Sensors

Pins

5

lux

300

uvi

3

Pins

## 5 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

VIN

Supply, 3 to 5 V on the board.

GND

Ground.

SCL

I2C. The board carries the pull-ups.

SDA

I2C. The board carries the pull-ups.

INT

The threshold interrupt, left high-Z by the model.

How to use it

## How to use the LTR-390 UV sensor with an Arduino Uno

The example project is a hiking compass built on an Arduino Uno. An LSM303AGR gives the compass heading and the tilt, and the LTR-390 gives the sun's UV index, with a warning printed at 3 or more. The LTR-390's VIN goes to the Uno's 5V pin, GND to GND, SCL to A5 and SDA to A4, the Uno's I2C lines.

The sketch includes Adafruit_LTR390.h and creates an Adafruit_LTR390 object. In setup it calls uv.begin(), then sets UV mode with setMode(LTR390_MODE_UVS), a gain of 18 with setGain(LTR390_GAIN_18), and 18 bit resolution with setResolution(LTR390_RESOLUTION_18BIT). In loop it calls uv.getUVI() and prints the UV index to one decimal place; at 3 or more it prints a sun cream warning.

With default settings, the serial monitor printed: "Hiking compass", "heading 45 tilt 0 UV 2.0". The heading of 45 comes from the magnetometer, the tilt of 0 means the board is flat, and the UV index of 2.0 is below 3, so no warning is printed.

After changing uvi to 14, the serial monitor printed: "heading 45 tilt 0 UV 14.0", "Sun cream". The UV reading followed the new setting and crossed the threshold of 3, so the sun cream warning appeared. You can drag the UV slider past 3 yourself, or tip the board with the roll slider and watch the heading and tilt change.

Part pin

Goes to

VIN

Arduino Uno R3 pin 5V

GND

Arduino Uno R3 pin GND

SCL

Arduino Uno R3 pin A5

SDA

Arduino Uno R3 pin A4

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

sketch.ino · Arduino Uno R3 · the first 45 lines

Common errors

## Common UV and light, LTR-390 errors and fixes

What goes wrong

The fix

Reading the UV counts in light mode.

Only the mode chosen is measured, so set UV mode with setMode(LTR390_MODE_UVS) before reading UV.

Getting a small UV figure at gain 1 and 13 bits.

The counts are few at low gain and resolution; raise the gain and the resolution.

Adding external pull-up resistors on SDA and SCL.

The board already carries the pull-ups, so wire SCL and SDA straight to A5 and A4.

Questions

## Questions and answers

### what is the ltr390 i2c address

The LTR-390 talks over I2C at 0x53.

### can the ltr390 read uv and light at the same time

No. It reads the UV index or the visible light, one at a time.

### what voltage does the ltr390 need

It takes 3 to 5 V on VIN, so the Uno's 5V pin works.

### does the ltr390 model have an interrupt

No. The INT pin, the threshold interrupt, is left high-Z by the model.

How it is modeled

## What is true about the UV and light, LTR-390, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Not modeled

The interrupt, the window factor of a cover over the sensor, and the spectral response.

From LTR-390 UV and light sensor, in full.

Projects

## See the UV and light, LTR-390 in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the UV and light, LTR-390 in it.

- Arduino Uno R3

Keep going

## Keep going

- I2C Scanner for Arduino and ESP32, and Fixes
- Ambient light, VEML7700
- Light sensor, BH1750
- Ambient light sensor, TEMT6000

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the UV and light, LTR-390

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
