Components · 10 min read

UV Sensor Arduino: Measure the UV Index with GUVA-S12SD and Code

UV sensor Arduino guide: GUVA-S12SD wiring, converting voltage to UV index, UV index risk table, ESP32 code and a comparison with the ML8511 and VEML6075.

The GUVA-S12SD is the part used most often in UV sensor Arduino projects. This small module measures the ultraviolet (UV) radiation in sunlight and gives a proportional analog voltage; the Arduino reads that voltage and converts it into the UV index you see in weather reports. That way you can see with a device you built yourself how risky the sun is for your skin on a summer day, and get a light and sound warning when the value climbs.

In this article you'll learn how the GUVA-S12SD works, the difference between UVA and UVB, what the UV index means and how to convert the module's output voltage into a UV index. You'll take precise readings with the Arduino Uno's internal 1.1 V reference, learn the rules for measuring correctly in the sun, build a battery-powered UV logger that runs in deep sleep on an ESP32 and make a sun warning device with an RGB LED and a buzzer. Finally, we'll compare the GUVA-S12SD with the ML8511 and VEML6075.

What is the GUVA-S12SD UV sensor and how does it work?

The GUVA-S12SD is a gallium nitride (GaN) Schottky photodiode. Unlike silicon photodiodes, it barely sees visible light or infrared: its sensitive range is 240–370 nm, which is UVB and UVA. So it reacts only to the ultraviolet part of sunlight, not to how bright it is. The current the diode produces is in the nanoamp range, far too small for the Arduino to read directly. That's why modules on the market have a small op-amp next to the diode that turns the current into a voltage of about 0–1 V. In the Adafruit design the output voltage is 4.3 times the photocurrent in microamps. The module runs on 2.7–5.5 V, draws a few hundred microamps and its output is independent of the supply voltage; it gives the same voltage in the same light at 3.3 V or 5 V. You can find the basic logic of diodes in the what is a diode article.

FeatureValue
SensorGaN Schottky photodiode (Genicom GUVA-S12SD)
Spectral sensitivity240–370 nm (UVB + UVA)
Supply2.7–5.5 V (module)
OutputAnalog, about 0–1.2 V
Conversion (approximate)Output (V) / 0.1 = UV index
Module pinsVCC (+), GND (-), OUT (SIG)

UV radiation and the UV index

Ultraviolet radiation from the sun is divided into three bands. UVC (100–280 nm) is absorbed completely by the atmosphere and never reaches the ground. UVB (280–315 nm) is a small share of the UV reaching the ground but is the main cause of sunburn. UVA (315–400 nm) makes up about 95% of the UV reaching the ground, goes deeper into the skin and contributes to skin ageing. The UV index is the strength of this radiation, weighted by how much it reddens the skin, divided by 25 mW/m². The World Health Organization (WHO) and weather services use the same scale: 0–2 is low and 11 or more is extreme risk. Around midday in summer the UV index often reaches 8–10 in clear weather at mid latitudes, and even more at the coast and at altitude. The UV index has nothing to do with temperature: on a cool but sunny day in the mountains it can be very high.

UV indexRiskColor codeWhat to do
0–2LowGreenNo protection needed, sunglasses are enough
3–5ModerateYellowSeek shade around midday, wear a hat and SPF 30+ sunscreen
6–7HighOrangeCut time in the sun between 11:00 and 16:00, reapply sunscreen every 2 hours
8–10Very highRedAvoid going out around midday, keep protecting yourself even in the shade
11+ExtremeVioletStay indoors if possible, skin can burn within minutes

Converting voltage to UV index

The rule of thumb given by module makers is simple: UV index ≈ output voltage (V) / 0.1, so every 100 mV corresponds to one UV index point. If you read 0.5 V, the UV index is about 5. It's an approximation, because the sensor's spectral curve isn't identical to the skin's reddening curve; still, a simple calibration gets you to about ±1 index point. The real problem is resolution. With a 5 V reference the Arduino Uno's ADC measures 4.9 mV per step, which means steps of about 0.05 in UV index and a last digit that jumps around with noise. The fix is to use the internal 1.1 V reference with analogReference(INTERNAL): you measure about 1.07 mV per step and resolution rises four times. The price is that voltages above 1.1 V can't be read; that corresponds to a UV index of 11, and showing '11+' from there on is enough. The real value of the internal reference can vary from 1.0 to 1.2 V between boards; measure the AREF pin with a multimeter and enter it in VREF_MV in the code. The ADC is explained in detail in the what is an ADC article.

UV indexOutput voltageanalogRead (5 V reference)analogRead (1.1 V reference)
00–50 mV0–100–46
2About 200 mV41186
5About 500 mV102465
8About 800 mV164744
10About 1000 mV205930
11+1100 mV and above225 and above1023 (saturated)

Wiring the GUVA-S12SD: Arduino Uno and ESP32

GUVA-S12SD pinArduino UnoESP32Note
VCC (+)5V or 3.3VGPIO 25 (powered from a pin) or 3V3Output is independent of the supply
GND (-)GNDGNDCommon ground
OUT (SIG)A0GPIO 34 (ADC1)0–1.2 V analog
RGB LED (warning device)D9, D10, D11 + 220 Ω-Common cathode
Active buzzer (warning device)D8-Or a bigger buzzer through a transistor
Board LED (logger)-GPIO 2Blinks as many times as the UV index
Don't put the UV sensor behind window glass or inside an ordinary plastic box. Glass blocks almost all UVB and part of the UVA, and clear acrylic and polycarbonate absorb UV heavily too, so the sensor reads far below the real value. In an outdoor enclosure, leave the top of the sensor open or use a UV-transparent window such as quartz glass or thin PTFE (Teflon). Also, the pin order of these modules varies by manufacturer; check the labels on the board so you don't mix up VCC and OUT.

Reading the UV index with an Arduino

  1. Connect the module's VCC to 5V, GND to GND and the OUT pin to A0.
  2. Upload the code and open the Serial Monitor at 9600 baud.
  3. First check indoors that the value is around 0–50 mV, meaning a UV index of 0.
  4. Take the board outside and hold the sensor level, facing the sky.
  5. Compare the value with the official UV index for that hour and adjust the CAL factor if needed.
C++ (Arduino IDE)
1// GUVA-S12SD ile UV indeksi ölçümü (Arduino Uno) / UV index measurement with GUVA-S12SD (Arduino Uno)
2const int UV_PIN = A0;             // modülün OUT (SIG) çıkışı / module OUT (SIG) output
3const float VREF_MV = 1100.0;      // dahili 1,1 V referans (ölçüp düzelt) / internal 1.1 V reference (measure and correct)
4const float CAL = 1.0;             // resmî UV indeksiyle karşılaştırıp ayarla / tune against the official UV index
5
6const char* category(float uvi) {
7  if (uvi < 3) return "Dusuk / Low";
8  if (uvi < 6) return "Orta / Moderate";
9  if (uvi < 8) return "Yuksek / High";
10  if (uvi < 11) return "Cok yuksek / Very high";
11  return "Asiri / Extreme";
12}
13
14void setup() {
15  Serial.begin(9600);
16  analogReference(INTERNAL);       // 0-1,1 V aralığı: adım başına ~1,07 mV / 0-1.1 V range: ~1.07 mV per step
17  for (int i = 0; i < 10; i++) {   // referans değişince ilk okumaları at / discard first readings after switching reference
18    analogRead(UV_PIN);
19    delay(10);
20  }
21}
22
23void loop() {
24  long sum = 0;
25  for (int i = 0; i < 64; i++) {   // 64 ölçüm ortalaması / average of 64 readings
26    sum += analogRead(UV_PIN);
27    delay(2);
28  }
29  float raw = sum / 64.0;
30  float mv = raw * VREF_MV / 1023.0;
31  float uvi = mv / 100.0 * CAL;    // yaklaşık 100 mV = 1 UV indeksi / about 100 mV = 1 UV index
32
33  Serial.print("Cikis / output: ");
34  Serial.print(mv, 0);
35  Serial.print(" mV  UV indeksi / index: ");
36  if (raw > 1015) {
37    Serial.print("11+");           // referans doydu / reference saturated
38  } else {
39    Serial.print(uvi, 1);
40  }
41  Serial.print("  ");
42  Serial.println(category(uvi));
43  delay(1000);
44}

In setup() the code switches to the internal 1.1 V reference and throws away the first 10 readings; after a reference change the ADC's capacitor takes a few conversions to settle on the new value. Each measurement averages 64 samples, which cuts the noise roughly eightfold. The voltage is converted to millivolts, divided by 100 and multiplied by the CAL factor to give the UV index. If the raw value is above 1015, the reference is saturated and the code prints '11+'. The category() function puts the result into one of the WHO's five risk classes. If you have a UV lamp (such as a banknote checker), you can see the sensor react indoors too; ordinary LED and fluorescent lamps emit almost no UV.

Measuring correctly in the sun

By definition the UV index is calculated for radiation falling on a horizontal surface, so place the sensor flat, facing the sky, somewhere without shade. If you point the sensor straight at the sun, you'll read higher than the official value outside midday. UV peaks around solar noon, when the sun is highest (roughly 13:00–14:00 with summer time in most of Europe); in the morning and late afternoon the sun's rays travel a longer path through the atmosphere and the value drops quickly. Clouds block less UV than you'd expect: thin clouds let most UV through, and with broken clouds light reflected off cloud edges can briefly push the value above clear-sky levels. In the shade UV is roughly halved but not eliminated, because light scattered from the sky carries UV too. If you leave the module in the sun for a long time, the inside of the box can heat up; the GaN sensor is barely affected by temperature, but use a ventilated, light-colored box for the op-amp and wiring.

EnvironmentEffect on UV
Fresh snowReflects up to 80% of UV, nearly doubling total exposure
Dry sandReflects about 15%
Sea foamReflects about 25%
AltitudeRises by about 10% every 1000 m
Thin cloudMost UV gets through, sunburn risk remains
Shade (tree, umbrella)Roughly halved, not zero because of scattered light
Window glassBlocks almost all UVB, part of the UVA gets through
The easiest calibration is to measure at midday on a clear, cloudless day and compare the result with the UV index your national weather service publishes for that day. If the official value is 8 and you measure 6.5, then CAL = 8 / 6.5 ≈ 1.23. Repeat this on a few different days and take the average for a more reliable result.

A battery UV logger with an ESP32

The ESP32 is a good choice for running a UV sensor on batteries for days. The logger in the code wakes every 5 minutes, powers the sensor from GPIO 25, takes a reading, switches the sensor off and goes back into deep sleep. In deep sleep an ESP32 draws from a few tens of µA to a few mA depending on the board; powering the module from a pin also cuts the sensor's current to zero while sleeping. The day's highest UV value is kept in a variable marked with RTC_DATA_ATTR; this memory survives deep sleep. The result is printed to the Serial Monitor and the on-board LED blinks as many times as the UV index, so you can read the value without a computer. With 2.5 dB attenuation the ESP32's ADC measures about 0–1.25 V, a perfect fit for the GUVA-S12SD's output. analogReadMilliVolts() uses the ESP32's factory calibration, so it's far more accurate than a raw analogRead value. The sensor is on GPIO 34 because ADC2 pins don't work while Wi-Fi is on; if you later want to send the data over Wi-Fi, you won't need to change the pin.

C++ (Arduino IDE)
1// ESP32 pilli UV kaydedici: derin uyku + günün en yüksek değeri / ESP32 battery UV logger: deep sleep + daily maximum
2#include "esp_sleep.h"
3
4const int UV_PIN = 34;             // ADC1 pini, Wi-Fi'dan etkilenmez / ADC1 pin, unaffected by Wi-Fi
5const int SENSOR_POWER = 25;       // modül VCC'si bu pinden / module VCC from this pin
6const int LED_PIN = 2;             // DevKit üzerindeki LED / on-board LED of the DevKit
7const float CAL = 1.0;             // kalibrasyon katsayısı / calibration factor
8const uint64_t SLEEP_US = 5ULL * 60ULL * 1000000ULL;   // 5 dakika / 5 minutes
9const int WAKES_PER_DAY = 288;     // 24 saat / 5 dk / 24 h / 5 min
10
11RTC_DATA_ATTR int wakeCount = 0;   // derin uykuda korunur / kept during deep sleep
12RTC_DATA_ATTR float dayMax = 0;
13
14float readUvIndex() {
15  analogSetPinAttenuation(UV_PIN, ADC_2_5db);   // yaklaşık 0-1,25 V aralığı / about 0-1.25 V range
16  long sum = 0;
17  for (int i = 0; i < 32; i++) {
18    sum += analogReadMilliVolts(UV_PIN);       // fabrika kalibrasyonlu mV / factory-calibrated mV
19    delay(5);
20  }
21  float mv = sum / 32.0;
22  return mv / 100.0 * CAL;
23}
24
25void setup() {
26  Serial.begin(115200);
27  pinMode(SENSOR_POWER, OUTPUT);
28  pinMode(LED_PIN, OUTPUT);
29  digitalWrite(SENSOR_POWER, HIGH);  // sensörü aç ve otursun / power the sensor and let it settle
30  delay(100);
31  float uvi = readUvIndex();
32  digitalWrite(SENSOR_POWER, LOW);
33
34  if (++wakeCount >= WAKES_PER_DAY) {  // gün bitti, en yükseği sıfırla / day over, reset the maximum
35    wakeCount = 0;
36    dayMax = 0;
37  }
38  if (uvi > dayMax) dayMax = uvi;
39  Serial.printf("UV indeksi / index: %.1f  Gunun en yuksegi / daily max: %.1f\n", uvi, dayMax);
40
41  int blinks = (int)(uvi + 0.5);     // UV indeksi kadar yanıp sön / blink as many times as the UV index
42  for (int i = 0; i < blinks; i++) {
43    digitalWrite(LED_PIN, HIGH);
44    delay(150);
45    digitalWrite(LED_PIN, LOW);
46    delay(250);
47  }
48
49  esp_sleep_enable_timer_wakeup(SLEEP_US);
50  esp_deep_sleep_start();
51}
52
53void loop() {
54  // derin uyku nedeniyle buraya gelinmez / never reached because of deep sleep
55}

A summer sun warning device

This project is a small warning device you can put on the beach, a balcony or a school yard. A common-cathode RGB LED shows the UV index in the WHO color code: green, yellow, orange, red and violet. When the risk rises to 'high' or above, the buzzer beeps as many times as the level number; while the UV index is above 3, it also beeps three times every two hours to remind you to reapply sunscreen. Readings are smoothed over a window of about 4 seconds with an exponential filter using 0.95 / 0.05 coefficients, so a passing cloud or the shadow of a hand doesn't cause a pointless alarm. Fit a 220 Ω resistor on each LED leg; you can find the right value with the LED resistor calculator. Run the device from a power bank and it can stay outside all day.

C++ (Arduino IDE)
1// Yazın güneş uyarısı cihazı: GUVA-S12SD + RGB LED + buzzer / Summer sun warning device: GUVA-S12SD + RGB LED + buzzer
2const int UV_PIN = A0;
3const int RED_PIN = 9, GREEN_PIN = 10, BLUE_PIN = 11;   // ortak katot RGB LED, her bacakta 220 Ω / common-cathode RGB LED, 220 Ω per leg
4const int BUZZER_PIN = 8;          // aktif buzzer / active buzzer
5const float VREF_MV = 1100.0;
6const float CAL = 1.0;
7const unsigned long REMINDER_MS = 2UL * 60UL * 60UL * 1000UL;   // 2 saatte bir krem hatırlatması / sunscreen reminder every 2 hours
8
9float uvi = 0;
10int lastLevel = 0;
11unsigned long lastReminder = 0;
12
13int levelOf(float u) {             // DSÖ kategorileri: 0 düşük ... 4 aşırı / WHO categories: 0 low ... 4 extreme
14  if (u < 3) return 0;
15  if (u < 6) return 1;
16  if (u < 8) return 2;
17  if (u < 11) return 3;
18  return 4;
19}
20
21void setColor(int r, int g, int b) {
22  analogWrite(RED_PIN, r);
23  analogWrite(GREEN_PIN, g);
24  analogWrite(BLUE_PIN, b);
25}
26
27void beep(int times) {
28  for (int i = 0; i < times; i++) {
29    digitalWrite(BUZZER_PIN, HIGH);
30    delay(120);
31    digitalWrite(BUZZER_PIN, LOW);
32    delay(180);
33  }
34}
35
36void setup() {
37  Serial.begin(9600);
38  pinMode(BUZZER_PIN, OUTPUT);
39  pinMode(RED_PIN, OUTPUT);
40  pinMode(GREEN_PIN, OUTPUT);
41  pinMode(BLUE_PIN, OUTPUT);
42  analogReference(INTERNAL);
43  for (int i = 0; i < 10; i++) {
44    analogRead(UV_PIN);
45    delay(10);
46  }
47}
48
49void loop() {
50  float mv = analogRead(UV_PIN) * VREF_MV / 1023.0;
51  uvi = 0.95 * uvi + 0.05 * (mv / 100.0 * CAL);   // yaklaşık 4 s'lik yumuşatma, bulut geçişine karşı / ~4 s smoothing against passing clouds
52
53  int level = levelOf(uvi);
54  switch (level) {                 // DSÖ renkleri / WHO colours
55    case 0: setColor(0, 255, 0); break;      // yeşil / green
56    case 1: setColor(255, 180, 0); break;    // sarı / yellow
57    case 2: setColor(255, 60, 0); break;     // turuncu / orange
58    case 3: setColor(255, 0, 0); break;      // kırmızı / red
59    default: setColor(160, 0, 255); break;   // mor / violet
60  }
61
62  if (level > lastLevel && level >= 2) {     // risk yükseldi: seviye kadar bip / risk went up: beep the level
63    beep(level);
64    lastReminder = millis();
65  }
66  lastLevel = level;
67
68  if (level >= 1 && millis() - lastReminder >= REMINDER_MS) {
69    beep(3);                       // güneş kremini yenile / reapply sunscreen
70    lastReminder = millis();
71  }
72
73  static unsigned long lastPrint = 0;
74  if (millis() - lastPrint >= 2000) {
75    lastPrint = millis();
76    Serial.print("UV indeksi / index: ");
77    Serial.print(uvi, 1);
78    Serial.print("  seviye / level: ");
79    Serial.println(level);
80  }
81  delay(200);
82}

GUVA-S12SD vs ML8511 vs VEML6075

There are three common UV modules on the market. The ML8511 is an analog sensor that sees 280–390 nm and outputs from 1.0 V to about 2.8 V depending on UV intensity; it needs a 3.3 V supply and gives its result in mW/cm², so converting it to a UV index needs another approximation. Because it outputs 1 V even in the dark its zero point is clear, but its output is sensitive to the supply. The VEML6075 is a digital I2C sensor that measures UVA and UVB on separate channels, making it easy to calculate the UV index from both; however, Vishay has discontinued it, so an I2C UV sensor such as the LTR390 is recommended for new projects. The GUVA-S12SD is the cheapest and simplest: one analog pin, no library and a wide supply range. If all you want to know is 'how risky is the sun?', the GUVA-S12SD is more than enough.

FeatureGUVA-S12SDML8511VEML6075
OutputAnalog (0–1.2 V)Analog (1.0–2.8 V)Digital I2C (16-bit)
Spectrum240–370 nm280–390 nmSeparate UVA (365 nm) and UVB (330 nm)
Supply2.7–5.5 V3.3 V1.7–3.6 V
UV indexApproximate via V / 0.1Approximate conversion from mW/cm²From UVA and UVB with a formula
LibraryNot neededNot neededNeeded
StatusCommon and cheapCommonDiscontinued, replaced by LTR390
Best useUV index and warning deviceMeasuring UV lamp intensityPrecise UVA/UVB analysis

UV sensor project ideas

  • Mini weather station: Measure UV index together with temperature, humidity and light level; pair it with a BH1750 for visible light.
  • School yard UV board: Build a board that shows the UV index with a colored LED strip during breaks.
  • Sunscreen test: Put clear film with and without sunscreen in front of the sensor and compare how much UV the cream blocks.
  • Sunglasses tester: Place a lens between a UV lamp and the sensor and measure how much UV gets through.
  • UV curing lamp check: Check whether a resin or UV curing lamp really emits UV and whether it weakens with age.
  • Daily UV chart: Log readings with an ESP32, plot a day's UV curve and see the midday peak.

Common mistakes and fixes

SymptomLikely causeFix
Value very low outdoorsSensor behind glass or plasticOpen the top of the sensor or use a quartz or PTFE window
Value always 0OUT and VCC mixed up or wrong analog pinCheck the pin labels, connect OUT to A0
Last digit keeps jumpingLow resolution with the 5 V referenceUse analogReference(INTERNAL) and average the samples
UV index stuck at 111.1 V reference saturatedShow '11+' or switch back to the 5 V reference
Value differs from the official UV indexNo calibration or sensor facing the sunHold the sensor level, set CAL with a midday reading
ESP32 value goes wrong when Wi-Fi is onSensor on an ADC2 pinUse ADC1 pins between GPIO 32 and 39

The GUVA-S12SD is a cheap, educational sensor that lets you measure the invisible side of sunlight with a few wires, and it teaches ADC references, calibration and real-world measurement along the way. Build the warning device before summer arrives and see for yourself how the value climbs around midday. In the BlueGrays app you can open the RGB LED, buzzer, LDR and ESP32 deep sleep projects with step-by-step circuit diagrams and ready-to-use code, and combine them with the UV sensor.

Frequently asked questions

How does a UV sensor work?

A UV sensor uses a photodiode that responds only to ultraviolet light; when light hits it, the diode produces a small current. The amplifier on the module turns that current into a voltage, and the Arduino reads it on an analog pin. With the GUVA-S12SD about every 100 mV corresponds to one UV index point.

How do you calculate the UV index with a GUVA-S12SD?

Divide the module's output voltage in volts by 0.1; 0.5 V means a UV index of about 5. For a more accurate result, measure at midday on a clear day, compare with the official UV index and work out a calibration factor. Using the 1.1 V internal reference on an Arduino Uno increases resolution four times.

What UV index is dangerous?

On the WHO scale, 3–5 is moderate, 6–7 high, 8–10 very high and 11 or more extreme risk. At a UV index of 3 or more, a hat, sunglasses and SPF 30+ sunscreen are recommended. At 8 and above it's best to stay out of the sun around midday.

Can a UV sensor measure through glass?

Not correctly. Window glass blocks almost all UVB and part of the UVA, so the sensor reads far below the real value. Use the sensor outdoors with its top open or behind a UV-transparent window.

Is the GUVA-S12SD or the ML8511 better?

For measuring the UV index and building a warning device, the GUVA-S12SD is simpler and cheaper, with a wide supply range and easy calibration. The ML8511 gives UV intensity in mW/cm² and needs 3.3 V, so it suits jobs like measuring UV lamps. If you want to measure UVA and UVB separately, choose a digital I2C sensor.

Does a UV sensor work on cloudy days?

It does, and it actually tells you something important: even on cloudy days much of the UV can reach the ground. Under thin cloud the value can stay close to clear-sky levels, while thick cloud lowers it noticeably. So testing the idea that 'it's cloudy, the sun won't burn' with the sensor is a good experiment.

See all projects
Using an RGB LED
AR-39Beginner
Premium

Using an RGB LED

Three colours hide inside a single LED: the RGB LED lights up red, then green, then blue, each colour on for half a second and off for half a second, before the cycle starts again.

4.9(74)
101
Smooth Color Transition with RGB Led
AR-40Beginner
Premium

Smooth Color Transition with RGB Led

A single RGB LED drifts slowly from red to green, green to blue and back to red, looping through the rainbow without ever stopping.

4.8(59)
78
Using a Buzzer
AR-13Beginner

Using a Buzzer

Ever wondered how a doorbell or an alarm makes its sound? The Arduino makes a small buzzer beep at short intervals: beep, pause, beep, pause.

4.7(93)
180
Measuring Light Intensity with an LDR
AR-11Beginner

Measuring Light Intensity with an LDR

Want to see how bright your room is as a number? The LDR, a small part that reacts to light, measures the light around it, and the Arduino writes the value to your computer screen every half second.

4.5(86)
154
Reading Light Intensity with the ESP32 LDR Module
ES-11Beginner

Reading Light Intensity with the ESP32 LDR Module

Real-time monitoring of the LDR module's raw ADC value and relative light percentage calculated from dark and light reference values in the Serial Monitor. This percentage is not a lux measurement. Teaches the module’s calibration logic. It is ideal to complete this before Project 10, as it is used to determine the threshold value.

4.6(36)
56
ESP32 RGB LED Control
ES-9Beginner

ESP32 RGB LED Control

Unlimited color generation with a single RGB LED instead of 3 separate LEDs. As in Arduino, we make a rainbow transition by setting the R/G/B values with analogWrite(). Color theory (such as red+green=yellow) is seen practically.

4.6(29)
52
ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)
ES-32Advanced
Premium

ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)

In this project the ESP32 makes a REST API call over the internet to a weather API (wttr.in) using HTTPClient.h. Unlike the I2C LCD version, it uses an SSD1306 OLED (128×64) display, with large text and vector icons for a richer look. Seven weather icons (sunny, rainy, snowy and more) are drawn on the fly, with no bitmap files.

4.3(10)
22
ESP32 Deep Sleep — Battery Saving (OLED + RTC RAM Counter)
ES-33Advanced
Premium

ESP32 Deep Sleep — Battery Saving (OLED + RTC RAM Counter)

The ESP32's Deep Sleep mode shuts down the CPU and most peripherals, cutting current draw to about 10µA, which is vital for battery-powered IoT devices. This project uses three wake-up sources: a timer (15 s), an external pin (EXT0, the button on GPIO 33) and a touch pin (T0/GPIO 4). Counters marked with RTC_DATA_ATTR survive deep sleep.

4.3(10)
17