Arduino OLED Voltage Meter

Arduino OLED Voltage Meter is a simple code that i wrote to read analog input and convert in to voltage and show up on OLED Display this device can be use to check 0 – 5V DC

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Things That You Going Need for This Project

i2C 128x64 OLED Display

6 X Jumper wires

1 X 1M Resistor

1 X Arduino Uno

1 X Project Board

Step 2: Schematics

connect all components as shown on the schematics

Step 3: Code

you can download Arduino Sketch by click this link below:

You also gonna need this library for OLED Display :


/*code by Neranjan Walakulpola
for more help and diagram visit http://www. */

#include #include #include #include

#define OLED_RESET 4 Adafruit_SSD1306 display(OLED_RESET);

#if (SSD1306_LCDHEIGHT != 64) #error("Height incorrect, please fix Adafruit_SSD1306.h!"); #endif

void setup() {

// Set up the display display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Initialize with the I2C addr 0x3D if not working use 0x3C (for the 128x64) display.setTextColor(WHITE);

} void loop(){

delay(1);//delay time 1 mili second display.clearDisplay();

display.setTextSize(1);//text size display.setTextColor(WHITE);//text color display.setCursor(0,0); display.println("Analog Read V1.0");//display out text 1st line display.setTextColor(BLACK, WHITE); display.println(); display.println("A0");//define analog pin display.setTextSize(1); display.setTextColor(WHITE);//text color display.println(); display.setTextSize(2);//text size display.setTextSize(2);//text size int sensorValue = analogRead(A0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): float voltage = sensorValue * (5.0 / 1023.0); // print out the value you read: display.print(voltage); display.println("V"); display.display();


Step 4: Demo

Hope you found this use full for you as a beginner if you have any question leave a comment thanks watching this keep coding ;


for more projects

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    10 Discussions


    4 years ago

    how could you make this so it could reach voltages of up to about 15v so I could measure the voltage of my leasure battry

    6 replies

    Reply 10 months ago

    I used this code to read a math equation, not the A0 digital pin that is limited to 5 volts. I'm using a L298N Dual motor driver that can handle a current up to 35 volts. Instead I'm having the OLED display read a value of (0-255), and converting that to volts with a float function. First I defined the variables like this:

    int F=(a+b)
    int a = 17 //roughly 1 volt increments
    int b = 2 //roughly .1 volt increments

    Then I made the equation in the loop function like this:

    int sensorValue = F;
    // Convert the digital reading (which goes from 0 - 255) to a voltage (0 - 15V):
    float voltage = sensorValue * (15.0 / 255.0);
    // print out the value you read:
    display.print(voltage); display.println("V");

    Hope this helps!

    You actually can use it for more than 5v, but then you have to use a voltage divider as Akillion said. There are probably instructables for this, if not, there are lots of information on how to make such a rather simple device on the net.


    2 years ago


    3 years ago

    Hi Niranjan, I have 6 pins - GND VCC SCL SDA RES and DC. How will the connections be in that case ?


    3 years ago

    Hi, how could I modify this to work upto 50.4v? Thanks!