Introduction: DIY: a 5 Minutes Arduino Voltmeter With an OLED Display

Hello !

I'm going to show you how to make a voltmeter* with Arduino UNO, an OLED display, 2 resistors and 9 jumpers for less than 5 minutes. With it you will be able to measure Voltage from 0 to 50V (if you exceed it you may damage your Arduino !). Lets begin !

*"A voltmeter is an instrument used for measuring electrical potential difference between two points in an electric circuit" - Wikipedia

Step 1: Parts and Software

For the voltmeter you will need:

  • An Arduino UNO board
  • An OLED display - 1.3' 132x64 with SH1106 controller
  • 2 resistors - 10 k and 100k
  • A breadboard
  • 9 jumper wires

You will need the Arduino IDE that you can get from:

https://www.arduino.cc/en/main/software

and the U8glib library for the OLED that you can get from:

https://code.google.com/archive/p/u8glib/

or

https://github.com/olikraus/u8glib

Step 2: Making the Voltmeter

I order to measure voltage we will a build a simple voltage divider, but first place the OLED board on the breadboard. Then connect pin 13 to CLK, pin 11 to DIN, pin 9 to CS, pin 8 to D/C and pin 7 to RES.

Pins: 13, 11, 9 are the SPI Bus of the Arduino UNO board.

Now we build the voltage divider, plug the resistors on the breadboard and connect them for each other, the other side of the 100k resistor connect to ground, the connection between both reistors to analog 0 and the other side of the 10k resistor to the source you wish to measure, like on the schematic above.

After that move to the next step.

Step 3: Code

In this step, we are going to see how to program the voltmeter that you just built. You can find the whole code for the voltmeter on the corresponding GitHub repository: https://github.com/KonstantinDimitrov/Arduino_OLED...

We are now going to program the board. The first step is to plug in the USB cable in the board and the other side in your PC.

Step 4: Done !

As final step you have to upload the code to the 'duino and, you now learned the basics on how to build a voltmeter with Arduino and OLED display.

Comments

author
pawlaa1370 made it! (author)2017-01-27

Thank you again .

One question .

How to add code in your own animation on boot.

author
xrad made it! (author)2016-11-20

Wrote some new code so that 'blinking' of WARNING LOW VOLTAGE happens when v<12.59 (for 14v lipo). Used u8g.firstPage(); to 'clearscreen' for two additional drawings. THX Konstantin, for an GREATprogram!!

sse vid at :

author
xrad made it! (author)2016-11-20

Excellent program. Thank you for posting!! Very robust. I modified the V minimum to 2v which which had less jitter when (vin < 2.0) . I am VERY new to C++ /Arduino. I am trying to make this IF work so that "LOWVOLT" flashes. I have tried variations of the IF statement, added void draw(void) drawStr's, seems to be a really simple operation for the page, but I can't get it to work, any help greatly appreciated! (PS: I could not find the link to post code in this box)

if (vin < 2.0)

u8g.setFont(u8g_font_profont17r); // select font

u8g.drawStr(18, 12, "LOWVOLT");

u8g.setPrintPos(33, 40);

delay(200);

author
Volthaus Electronics Laboratory made it! (author)2016-11-04

Wonderful lnstructable. Went together quickly. I've had this little OLED lying around for 2 years and had it working right after i bought it then forgot all about it. And then I forgot totally how to wire it up. My OLED display seems to be just a little different from most. But your tutorial worked great. I found my supposed OFFICIAL library at https://github.com/olikraus/U8glib_Arduino/releases/tag/1.19.1

meter.jpg
author
igcasenza_b made it! (author)2016-07-20

Hi,is it ok to use other arduino products ? Is this will affect the arduino project ?

author
link5505 made it! (author)2016-07-07

Hi, how can I modify this to allow for 50.4v? Thanks, I am fairly new to this stuff.

author
dcastor made it! (author)2016-04-11

In your intro, you say your voltmeter can measure "current from 0-30V". I think you meant to say it can measure "*voltage* from 0-30V" or did you mean current and the units would be Amps?

author
martinbolton made it! (author)2016-02-11

Very cool. If I wanted to adapt this for my motorcycle, all I would need to do use a 12v - 5v USB charger to power the Arduino ?

author

Thanks !

Yes you would need to use a USB charger !

author
Nickhend86 made it! (author)2016-02-15

Cool project! I'll try this.

author

Thanks !

author
Omnivent made it! (author)2016-01-28

Perhaps correct the title (Adruino)

author

Did it. Thanks for the warning !

author
Omnivent made it! (author)Omnivent2016-02-07

:)

author
VIVEK GR made it! (author)2016-01-28

awesome project

author

Thank you !

About This Instructable

9,460views

157favorites

Bio: I am a dreamer, maker and an engineer making and sharing interesting projects here at Instructables. Follow me @ instagram: @the_gadget.boy
More by Konstantin Dimitrov:Arduino/Genuino 101 BLE Thermometer With TMP102 and BlynkPixie: An Arduino Based NeoPixel WristwatchTurn Your Old 2.5'' Or 3.5'' Hard Drive Into Portable/External
Add instructable to: