Arduino Voltmeter – Homemade DIY voltmeter

Hello world! Today i made a simple Arduino Voltmeter, It’s pretty easy to build and very handy if you don’t have one.. like me. I never used a multimeter in non of my projects lol. I should buy one! I needed to repair a laptop charger for a friend but i could not test it because all my laptops had different plugs, so i made this. Have fun with it! If you have a I2C on your LCD1602A, scroll to the bottom of the page, there is the code for those who use i2C.

Schematic:
Arduino Voltmeter
Just wire it up like the schematic, and it should work after uploading. You need to solder the resistors to a prototype board, or you can use a breadboard of course. It’s pretty easy to build. Good luck building your Arduino Voltmeter!

Parts list:
Arduino uno, i used the RobotDyn Uno. (has 8 analog pins)
LCD 1602
Breadboard or a PCB ProtoType Board.
10k Potentiometer.
5x 10k Resistor
2x 2.2k Resistor
Jumper wire set MM/FF/FM

Code:

/*
Author: Danny van den Brande. Bluecore Tech, Arduinosensors.nl
This is a Arduino Voltmeter.
 */
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// variables for input pin and control LED
  int analogInput = 1;
  float vout = 0.0;
  float vin = 0.0;
  float R1 = 50000.0;    // !! resistance of R1 !!
  float R2 = 4400.0;     // !! resistance of R2 !!

  int value = 0;

void setup(){
  pinMode(analogInput, INPUT);
  lcd.begin(16, 2);
  lcd.setCursor(1, 0);
  lcd.print("BlueCore Tech");
  delay(2000);
  lcd.clear();
  lcd.print("Volt=");
}

void loop(){
  value = analogRead(analogInput);

  vout = (value * 5.0) / 1024.0;
  vin = vout / (R2/(R1+R2));  

  lcd.setCursor(6, 0);
  lcd.print(vin);
  lcd.print("V");

  delay(500);
}

I2C Code:

/*
Author: Danny van den Brande. Bluecore Tech, Arduinosensors.nl
This is a simple Arduino Voltmeter.
 */
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

// initialize the library with the numbers of the interface pins
//Most common adresses PCF8574 = 0x20, PCF8574A = 0x38,PCF8574AT = 0x3F 
//PCF8574T = 0x27   
#define I2C_ADDR          0x27   
#define BACKLIGHT_PIN      3
#define En_pin             2
#define Rw_pin             1
#define Rs_pin             0
#define D4_pin             4
#define D5_pin             5
#define D6_pin             6
#define D7_pin             7

// variables for input pin and control LED
  int analogInput = 1;
  float vout = 0.0;
  float vin = 0.0;
  float R1 = 50000.0;    // !! resistance of R1 !!
  float R2 = 4400.0;     // !! resistance of R2 !!

  int value = 0;
LiquidCrystal_I2C      lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
void setup(){
  pinMode(analogInput, INPUT);
  lcd.begin(16, 2);
  lcd.setCursor(1, 0);
  lcd.print("BlueCore Tech");
  delay(2000);
  lcd.clear();
  lcd.print("Volt=");
}

void loop(){
  value = analogRead(analogInput);

  vout = (value * 5.0) / 1024.0;
  vin = vout / (R2/(R1+R2));  

  lcd.setCursor(6, 0);
  lcd.print(vin);
  lcd.print("V");

  delay(500);
}
Danny van den Brande

http://www.arduinosensors.nl

Programmer, Game Designer, 3D Designer, Web Designer, Graphic Designer. Jup this website looks crappy.. :) But enjoy the projects! Everything you need is here.

Leave a Reply

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