280-390nm
280-390nm
3.3V to 5V
2.5mA
0-5V (analog signal)
10ms
-20C to 85C
20% to 80% RH
14mm x 18mm x 2.5mm
2g
Applications
Pinouts
The ML8511 Ultra Violet Sensor Module has the following pinouts |
Supply voltage (3.3V to 5V)
Ground
Analog output signal (0-5V)
Conclusion
The ML8511 Ultra Violet Sensor Module is a versatile, high-sensitivity UV radiation sensor that is easy to use and integrate into various IoT applications. Its compact design, low power consumption, and simple analog output make it an ideal choice for a wide range of projects, from weather stations to wearable devices.
Ml8511 Ultra Violet Sensor Module Documentation
Overview
The ML8511 Ultra Violet Sensor Module is a low-cost, high-sensitivity UV sensor designed to measure the intensity of ultraviolet radiation in the 280-390nm range. This module is ideal for applications such as UV index monitoring, sun protection, and phototherapy.
Pinout
VCC: Power supply (3.3V-5V)
GND: Ground
OUT: Analog output signal
Technical Specifications
Operating Voltage: 3.3V-5V
Operating Current: 10mA
UV Range: 280-390nm
Sensitivity: 1.3V-2.5V (typical)
Accuracy: 10%
Response Time: 10ms
Example Code
### Example 1: Basic UV Index Measurement using Arduino
In this example, we will connect the ML8511 UV sensor to an Arduino board and measure the UV index.
```cpp
const int uvPin = A0; // Connect the OUT pin of the ML8511 to Analog Input 0 on the Arduino
void setup() {
Serial.begin(9600);
}
void loop() {
int uvReading = analogRead(uvPin);
float uvVoltage = (uvReading 5.0) / 1024.0;
float uvIndex = map(uvVoltage, 1.3, 2.5, 0, 11); // Map the voltage reading to a UV index value
Serial.print("UV Index: ");
Serial.println(uvIndex);
delay(1000);
}
```
### Example 2: UV Index Monitoring using Raspberry Pi (Python)
In this example, we will connect the ML8511 UV sensor to a Raspberry Pi and create a Python script to monitor the UV index.
```python
import RPi.GPIO as GPIO
import time
# Set up the GPIO library
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN) # Connect the OUT pin of the ML8511 to GPIO 17 on the Raspberry Pi
while True:
uv_reading = GPIO.input(17)
uv_voltage = (uv_reading 3.3) / 1024.0
uv_index = (uv_voltage - 1.3) / 0.25 # Calculate the UV index
print("UV Index:", uv_index)
time.sleep(1)
```
### Example 3: UV Index Display using ESP32 and OLED Display (MicroPython)
In this example, we will connect the ML8511 UV sensor to an ESP32 board and an OLED display, and create a MicroPython script to display the UV index on the OLED display.
```python
import machine
import ssd1306
# Set up the OLED display
i2c = machine.I2C(-1, scl=machine.Pin(5), sda=machine.Pin(4))
oled = ssd1306.SSD1306_I2C(64, 48, i2c)
# Set up the ML8511 UV sensor
uv_pin = machine.ADC(machine.Pin(32)) # Connect the OUT pin of the ML8511 to Analog Input 32 on the ESP32
while True:
uv_reading = uv_pin.read_u16()
uv_voltage = (uv_reading 3.3) / 65536.0
uv_index = (uv_voltage - 1.3) / 0.25 # Calculate the UV index
oled.fill(0)
oled.text("UV Index:", 0, 0)
oled.text(str(uv_index), 0, 10)
oled.show()
time.sleep(1)
```
Note: In all examples, ensure that the ML8511 UV sensor module is properly connected to the microcontroller or single-board computer, and that the voltage supply is within the recommended range.