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

 

Things that you going to Need:

arduino oled voltage meter

i2C 128×64 OLED Display

6 X Jumper wires

1 X 1M Resistor

1 X Arduino Uno

1 X Project Board

 

you can download Arduino Sketch  by click this link below

https://github.com/NJ-Ozz/Arduino-OLED-voltage-reader-v1.0

You also gonna need this library

https://github.com/adafruit/Adafruit_SSD1306

 

 

Schematics  :

Untitled-1

CODE : 

/*code by Neranjan Walakulpola
for more help and diagram visit
http://www.http://circuitfreak.net/index.php/2015/05/05/arduino-oled-voltage-meter/
*/

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#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 128×64)
display.setTextColor(WHITE);
}
void loop(){

// draw scrolling text
delay(1);
display.clearDisplay();

// text display tests
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println(“Analog Read V1.0”);
display.setTextColor(BLACK, WHITE);
display.println();
display.println(“A0”);
display.setTextSize(1);
display.setTextColor(WHITE);
display.println();
display.setTextSize(2);
display.setTextSize(2);
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();

}

 

DEMO :

 

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

 

 




5 comments for “Arduino OLED Voltage Meter

  1. Henry
    27/06/2015 at 2:19 PM

    Hi, can you write a code that can display, voltage, current, resistance and power using the same OLED?

    • Neranjan Walakulpola
      25/07/2015 at 8:26 AM

      yes you can use it for voltage, resistance and current, ill do another tutorial about those other stuff soon thanks for leaving comment if further question just ask away cheers !!!

    • Neranjan Walakulpola
      25/10/2015 at 5:25 PM

      yes you can

  2. Mark
    21/07/2015 at 9:25 PM

    Hi.
    Awesome project !!!
    Please let me where you both you OLED display?
    With glossy screen not matte.
    Thank you

    • Neranjan Walakulpola
      25/07/2015 at 8:26 AM

      cheers mate

Leave a Reply

Your email address will not be published. Required fields are marked *