Header Ads

Arduino DC Voltmeter (0-30V) with Lcd display

Overview

In this video tutorial, we will learn how to make a dc voltmeter using Arduino. This is very easy to make and useful project for the people of electronics lovers.

You can watch the following video below:-

Components Required

The required components list for this project given below:-
  • Arduino Uno
  • 16*2 Lcd Display 
  • 10k Potentiometer
  • 100k ohm Resistor
  • 10k ohm Resistor
  • 220-ohm Resistor
  • Breadboard
  • Some Jumper Wire

Pinout

Circuit Schematic

The circuit diagram of the Dc voltmeter using Arduino has been given below:-
Fig: Dc Voltmeter using Arduino

Circuit Description

    Source Code

    The source code is given below:-
     /*  
      DC Voltmeter  
      An Arduino based on voltage divider concept  
      Shahadat Hossen Razib  
      Youtube Channel: Razib Shahadat  
     */  
       
     #include <LiquidCrystal.h>  
     LiquidCrystal lcd(2, 3, 4, 5, 6, 7);  
     int analogInput = 0;  
     float vout = 0.0;  
     float vin = 0.0;  
     float R1 = 100000.0; // resistance of R1 (100K)  
     float R2 = 10000.0; // resistance of R2 (10K)  
     int value = 0;  
     int a[5] = {};  
     void setup() {  
      Serial.begin(9600);  
      pinMode(analogInput, INPUT);  
      lcd.begin(16, 2);  
      lcd.setCursor(2, 0);  
      lcd.print("DC VOLTMETER");  
      lcd.setCursor(0, 1);  
      lcd.print("-RAZIB SHAHADAT-");  
      delay(3000);  
      lcd.clear();  
       
     }  
     void loop() {  
      lcd.print("DC Voltmeter");  
      // read the value at analog input  
      value = analogRead(analogInput);  
      vout = (value * 5) / 1024.0;  
      vin = vout / (R2 / (R1 + R2));  
      Serial.println(vin);  
      if (vin < 0.09)  
      {  
       vin = 0.0;  
      }  
      lcd.setCursor(0, 1);  
      lcd.print("Voltage V :");  
      lcd.print(vin);  
      delay(3000);  
      lcd.clear();  
     }  
    


    No comments

    Powered by Blogger.