Arduino DC Voltmeter with OLED | Measure 0-50V | Complete Wiring & Code

Опубликовано: 17 Май 2026
на канале: GHH Tech Lab
99
7

In this Arduino tutorial, I'll show you how to build a precise DC voltmeter that can measure 0-50V using an Arduino and SH1106 OLED display. This DIY digital voltmeter is perfect for battery monitoring, power supply projects, or your electronics workbench.
Related Videos:    • Arduino Projects  

COMPONENTS USED:
• Arduino Uno/Nano (any board works)
• SH1106 OLED Display (128x64 I2C)
• 100kΩ Resistor (R1)
• 10kΩ Resistor (R2)
• Breadboard & Jumper Wires

COMPLETE WIRING DETAILS:

VOLTAGE DIVIDER CIRCUIT:
Test Voltage Input (+) → 100kΩ Resistor → Arduino A0 Pin → 10kΩ Resistor → GND
The junction between both resistors connects to A0

SH1106 OLED to ARDUINO:
OLED VCC → Arduino 3.3V
OLED GND → Arduino GND
OLED SCL → Arduino A5 (Uno/Nano)
OLED SDA → Arduino A4 (Uno/Nano)

IMPORTANT: If using Arduino Mega, SCL=21, SDA=20

HOW THE VOLTAGE DIVIDER WORKS:
Arduino reads 0-5V only. The divider scales down input voltage:
Ratio = (R1 + R2)/R2 = (100k + 10k)/10k = 11
Vin = Vout × 11
Example: 5V input → A0 sees 0.454V → displays 5V
Example: 50V input → A0 sees 4.54V → displays 50V

ARDUINO CODE: https://drive.google.com/drive/folder...

REQUIRED LIBRARIES (Install via Library Manager):
• Adafruit SH110X by Adafruit
• Adafruit GFX Library by Adafruit

TROUBLESHOOTING:
If display shows 50V for 5V input → Your resistor ratio is wrong. Check if you used 1kΩ instead of 10kΩ for R2.
If OLED doesn't work → Run I2C scanner. Common addresses: 0x3C or 0x3D
If readings fluctuate → Add capacitor (100nF) from A0 to GND

0:00 - Intro
0:06 - Demo & Overview
0:19 - Components Needed
0:35 - Wiring
0:59 - Arduino Code Walkthrough
1:26 - Testing
1:52 - Outro

QUESTIONS? Drop a comment below. I reply within 24 hours.

Facebook: https://www.facebook.com/profile.php?...
WhatsApp Channel: https://whatsapp.com/channel/0029VbBb...

SUBSCRIBE for more Arduino projects, sensors, and displays.

#arduino #voltmeter #oled #electronics #diy #arduinoproject #DCMeter #BatteryMonitor #arduinouno #electronicstutorial