Aniket Singh

Aniket Singh

|

@aniketxai

I’m a Full Stack Developer and IoT/Arduino Innovator. I build smart web apps and intelligent devices. On this site, I share coding tutorials, tech projects, and blogs related to web dev, embedded systems, and startup building.

🚀 View Projects
MERN Web Dev Arduino JavaScript Java DSA

Skills

HTML/CSS
JavaScript
React/MERN
IoT & Arduino

how to make ardunio multimeter

 


Hello Guys , In this Post we learn how to make ardunio multimeter 

Lets start it :-

*Specifications:-

-Through this multimeter you can measures resistance,potentiometer,continuity test,drop down voltage,use as voltmetre and analog signal input ,pwm signal generate also.

*Parts Lists:-

1. Ardunio Nano

2. ssd1306 oled display

3.  Resistor(220Ω)

4. Buzzer(5v)

5. Push switch

6.Header pins

*Schematics



*Diagrams


-Do all the Connections according To this Diagram

*Codes

-Copy The following code in ardunio ide

/*********
-Tech Gyan Creative
Complete project details at https://techgyancreative.blogspot.com/2021/08/nodemcu-webserver.html
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*********/


// Import required libraries

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Fonts/FreeSans9pt7b.h>
#include <Fonts/FreeSans12pt7b.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#define XPOS 0
#define YPOS 1
#define DELTAY 2

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

const unsigned char PROGMEM ppwwmm [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFF, 0xBE, 0x00, 0x3F, 0xE0, 0x1F, 0x00, 0x02, 0x21, 0xE3, 0x00, 0x33, 0x30, 0x31, 0x00,
0x02, 0x20, 0x73, 0x00, 0x23, 0x18, 0x33, 0x80, 0x02, 0x3C, 0x71, 0x80, 0x66, 0x98, 0x67, 0x80,
0x02, 0x3E, 0x31, 0xBE, 0x66, 0x9C, 0x45, 0x80, 0x02, 0x3E, 0x39, 0xFF, 0xC7, 0xDC, 0xE9, 0x80,
0x02, 0x3E, 0x38, 0xE1, 0xCF, 0xF7, 0x89, 0x80, 0x02, 0x30, 0x7C, 0xE1, 0xCF, 0x23, 0x91, 0x80,
0x02, 0x20, 0xEC, 0xD1, 0x8E, 0x33, 0x31, 0x80, 0x02, 0x60, 0xE4, 0x40, 0x9E, 0x33, 0x31, 0x80,
0x02, 0x3F, 0xC6, 0x4C, 0x9E, 0x39, 0x71, 0x80, 0x02, 0x3F, 0x86, 0x4C, 0xBA, 0x3F, 0xF1, 0x80,
0x02, 0x30, 0x02, 0x5E, 0xBA, 0x3F, 0xF1, 0x80, 0x02, 0x70, 0x03, 0x5E, 0xB2, 0x37, 0xF1, 0x80,
0x03, 0xB0, 0x03, 0x7E, 0xF2, 0x33, 0x91, 0x80, 0x03, 0xF0, 0x01, 0xFB, 0xF3, 0xF0, 0x1F, 0x80,
0x00, 0xE0, 0x00, 0x70, 0xC0, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};


const unsigned char PROGMEM aslovo [] = {
0xF0, 0x00, 0x9F, 0xFF, 0x90, 0x00, 0xF0, 0x00, 0x40, 0x20, 0x40, 0x60, 0x40, 0x50, 0x40, 0xD0,
0x40, 0x88, 0x40, 0x88, 0x41, 0x08, 0x41, 0x08, 0x41, 0xF8, 0x41, 0x04, 0x41, 0x04, 0x40, 0x00,
0xF0, 0x00, 0x90, 0x00, 0x9F, 0xFF, 0xF0, 0x00, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x72,
0x2F, 0x00,
};

const unsigned char PROGMEM sat1 [] = {
0x0F, 0x80, 0x01, 0xF0, 0x39, 0xC0, 0x03, 0x9C, 0x61, 0x80, 0x01, 0x86, 0x43, 0x1F, 0xF8, 0xC2,
0xC6, 0x70, 0x0E, 0x63, 0x8D, 0xC0, 0x03, 0xB1, 0x9B, 0x00, 0x00, 0xD9, 0xF6, 0x01, 0x80, 0x6F,
0xEC, 0x01, 0x80, 0x37, 0x58, 0x01, 0x80, 0x1A, 0x10, 0x01, 0x80, 0x08, 0x30, 0x01, 0x80, 0x0C,
0x20, 0x01, 0x80, 0x04, 0x20, 0x01, 0x80, 0x04, 0x20, 0x01, 0x80, 0x04, 0x60, 0x01, 0x80, 0x06,
0x60, 0x01, 0x80, 0x06, 0x60, 0x7F, 0x80, 0x06, 0x60, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x06,
0x20, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x0C, 0x10, 0x00, 0x00, 0x08,
0x18, 0x00, 0x00, 0x18, 0x08, 0x00, 0x00, 0x10, 0x0C, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00, 0x60,
0x0F, 0x80, 0x01, 0xF0, 0x18, 0xE0, 0x07, 0x18, 0x30, 0x7C, 0x3E, 0x0C, 0x20, 0x0F, 0xF0, 0x04
};

const unsigned char PROGMEM baterja [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xF0, 0x40, 0x00, 0x00, 0x10, 0x47, 0x3C, 0xE0, 0x18,
0x47, 0xBD, 0xE0, 0x18, 0x45, 0xA5, 0xA0, 0x1E, 0x45, 0xA5, 0xA0, 0x1A, 0x45, 0xA5, 0xA0, 0x1A,
0x45, 0xA5, 0xA0, 0x1A, 0x45, 0xA5, 0xA0, 0x1A, 0x45, 0xA5, 0xA0, 0x1E, 0x47, 0xBD, 0xE0, 0x18,
0x47, 0x3C, 0xE0, 0x18, 0x40, 0x00, 0x00, 0x10, 0x3F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};


const unsigned char PROGMEM temperatura [] = {
0x00, 0x01, 0x80, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x04, 0x20, 0x00,
0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x20, 0x00,
0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x20, 0x00,
0x00, 0x04, 0x20, 0x00, 0x00, 0x05, 0xA0, 0x00, 0x00, 0x05, 0xA0, 0x00, 0x00, 0x05, 0xA0, 0x00,
0x00, 0x05, 0xA0, 0x00, 0x00, 0x05, 0xA0, 0x00, 0x00, 0x05, 0xA0, 0x00, 0x00, 0x0D, 0xB0, 0x00,
0x00, 0x19, 0x98, 0x00, 0x00, 0x33, 0xCC, 0x00, 0x00, 0x26, 0x64, 0x00, 0x00, 0x6C, 0x36, 0x00,
0x00, 0x68, 0x16, 0x00, 0x00, 0x68, 0x16, 0x00, 0x00, 0x2C, 0x34, 0x00, 0x00, 0x27, 0xE4, 0x00,
0x00, 0x33, 0xCC, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x01, 0x80, 0x00
};
const unsigned char PROGMEM continu [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x03, 0xFF, 0xFF, 0xC0, 0x0F, 0xFF, 0xFF, 0xF0,
0x1F, 0xC0, 0x03, 0xF8, 0x7F, 0x00, 0x00, 0xFE, 0xFC, 0x00, 0x00, 0x3F, 0xF8, 0x07, 0xE0, 0x1F,
0xF0, 0x3F, 0xFC, 0x0F, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x03, 0xF0, 0x0F, 0xC0,
0x07, 0xC0, 0x03, 0xE0, 0x03, 0x80, 0x01, 0xC0, 0x01, 0x0F, 0xF0, 0x80, 0x00, 0x1F, 0xF8, 0x00,
0x00, 0x3F, 0xFC, 0x00, 0x00, 0x3C, 0x3C, 0x00, 0x00, 0x38, 0x1C, 0x00, 0x00, 0x01, 0x80, 0x00,
0x00, 0x03, 0xC0, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x03, 0xC0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

const unsigned char PROGMEM resis [] = {
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x06, 0x04, 0x00, 0x00, 0x0F, 0x88,
0x00, 0x00, 0x18, 0xD0, 0x00, 0x00, 0x38, 0x60, 0x00, 0x00, 0x6C, 0x30, 0x00, 0x00, 0xC6, 0x18,
0x00, 0x00, 0x83, 0x08, 0x00, 0x01, 0x81, 0x8C, 0x00, 0x03, 0x00, 0xCC, 0x00, 0x07, 0x80, 0x78,
0x00, 0x0C, 0xC0, 0x30, 0x00, 0x18, 0x60, 0x60, 0x00, 0x38, 0x30, 0xC0, 0x00, 0x6C, 0x1B, 0x80,
0x01, 0xC6, 0x0E, 0x00, 0x03, 0x03, 0x0C, 0x00, 0x07, 0x01, 0x98, 0x00, 0x0D, 0x80, 0xF0, 0x00,
0x18, 0xC0, 0x60, 0x00, 0x30, 0x60, 0xC0, 0x00, 0x30, 0x31, 0x80, 0x00, 0x10, 0x19, 0x00, 0x00,
0x18, 0x0F, 0x00, 0x00, 0x0C, 0x06, 0x00, 0x00, 0x06, 0x0C, 0x00, 0x00, 0x0B, 0x18, 0x00, 0x00,
0x11, 0xF0, 0x00, 0x00, 0x20, 0x60, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00
};

const unsigned char PROGMEM dioda [] = {
0x00, 0x07, 0xE0, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x3F, 0xFC, 0x00, 0x00, 0x78, 0x1E, 0x00,
0x00, 0xE0, 0x07, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x01, 0xC0, 0x03, 0x80,
0x01, 0xC0, 0x03, 0x80, 0x01, 0xC0, 0x03, 0x80, 0x01, 0xC0, 0x03, 0x80, 0x01, 0xC0, 0x03, 0x80,
0x01, 0xC0, 0x03, 0x80, 0x01, 0xC0, 0x03, 0x80, 0x07, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xE0,
0x07, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00,
0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00,
0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00, 0x00, 0x1C, 0x38, 0x00
};


int pauza=300;
int raw= 0;
float Vin= 0;
float Vout= 0;
float R1= 2000;
float R2= 0;

float vout2 = 0.00;
float vin2 = 0.00;
float res1 = 100000.00;
float res2 = 10000.00;
int val = 0;
float buffer= 0;
void setup() {


pinMode(5,INPUT_PULLUP);
pinMode(4,INPUT_PULLUP);
pinMode(3,INPUT_PULLUP);
pinMode(13,OUTPUT);
attachInterrupt(1, pritisnuto, FALLING);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

display.clearDisplay();
display.setFont();
display.setTextColor(WHITE);
display.setCursor(0,0);
display.print("Kanti");
display.setCursor(80,0);
}
int maksimum=1;
int minimum=1024;
int stisnuto=0;
unsigned long brojPuta=0;
unsigned long zbroj=0;
int prosjek=0;
int pulse=125;
unsigned long m=0;
void loop()
{

if(stisnuto==0)
{
float volt3=readVcc()/1000.0;
val = analogRead(7);
vout2 = (val * volt3) / 1024.0;
vin2 = vout2 / (res2/(res1+res2));
display.clearDisplay();
display.setFont();
display.setTextColor(WHITE);
display.setCursor(0,0);
display.print("VOLTMETER:");
display.setCursor(80,0);

display.print(volt3);

display.setFont(&FreeSans9pt7b);

display.setCursor(0,24);
display.print(vin2+0.1);
display.display();
delay(500);
}

if(stisnuto==1)
{

if(digitalRead(4)==0)
{ delay(100); minimum=1024; maksimum=0; brojPuta=0; zbroj=0; }
display.clearDisplay();
display.setFont();
display.setTextColor(WHITE);
display.setCursor(0,0);
display.setTextSize(1);

display.print("ANALOG");
display.setCursor(95,0);

int vrije=analogRead(A0);
brojPuta=brojPuta+1;
zbroj=zbroj+vrije;
prosjek=zbroj/brojPuta;

if(vrije>maksimum)
maksimum=vrije;
if(vrije<minimum)
minimum=vrije;


int snaga=map(vrije,0,1024,0,128);
float voltaza=readVcc();
display.print(prosjek);
display.setCursor(70,0);
display.print("AVE:");

display.setCursor(70,10);
display.print("MAX:");
display.setCursor(70,20);
display.print("MIN:");
display.setCursor(95,10);
display.print(maksimum);
display.setCursor(95,20);
display.print(minimum);

display.setFont(&FreeSans9pt7b);

display.setCursor(0,24);
display.print(vrije);

display.drawLine(0,31,snaga,31,1);
display.display();

if(brojPuta>100000)
{brojPuta=0;
zbroj=0;
}

}

if(stisnuto==2)
{
display.clearDisplay();
display.setFont();
display.setCursor(0,0);
display.print("RESISTANCE:");
display.drawBitmap(96, 0, resis, 32, 32, 1);
raw= analogRead(A2);

Vin=readVcc()/1000.0;
buffer= raw * Vin;
Vout= (buffer)/1024.0;
buffer= (Vin/Vout) -1;
R2= R1 * buffer;
display.setFont(&FreeSans12pt7b);

display.setCursor(0,28);
if(R2<70000)
display.print(R2);
if(R2>70000)
display.print("empty");

display.display();
delay(pauza);
}

if(stisnuto==3)
{
display.clearDisplay();
display.drawBitmap(96, 0, dioda, 32, 32, 1);
display.setFont();
display.setCursor(0,0);
display.print("VOLTAGE DROP:");
raw= analogRead(A2);

Vin=readVcc()/1000.0;
buffer= raw * Vin;
Vout= (buffer)/1024.0;

display.setFont(&FreeSans12pt7b);

display.setCursor(0,28);
if(Vout==0)
{display.print("0");}else{
display.print(Vin-Vout);}
display.display();
delay(pauza);
}

if(stisnuto==4)
{
display.clearDisplay();
display.drawBitmap(96, 0, continu, 32, 32, 1);
display.setFont();
display.setCursor(0,0);
display.print("CONTINUITY TEST:");
display.setFont(&FreeSans12pt7b);

display.setCursor(0,28);


raw= analogRead(A2);

Vin=readVcc()/1000.0;
buffer= raw * Vin;
Vout= (buffer)/1024.0;
float rez=Vin-Vout;
if(rez<1)
{
tone(6,2250);
display.print("Yes");
digitalWrite(13,1);
}
if(rez>1)
{
noTone(6);
digitalWrite(13,0);
display.print("No");
}
display.display();
}

if(stisnuto==6)
{

display.clearDisplay();
display.drawBitmap(96, 0, baterja, 32, 32, 1);
display.setFont();
display.setCursor(0,0);
display.print("BATERRY:");
display.setFont(&FreeSans12pt7b);

display.setCursor(0,28);
float volt2=readVcc()/1000.0;
display.print(volt2);
display.setCursor(55,28);
display.print("V");


display.display();
delay(pauza);
}

if(stisnuto==7)
{

if(digitalRead(4)==0)
{ if(pulse<255)
{
tone(6,1800,10);
pulse=pulse+2; }
}

if(digitalRead(5)==0)
{ if(pulse>1)
{
tone(6,1400,10);
pulse=pulse-2; }

}
int snaga2=0;
analogWrite(9,pulse);
display.clearDisplay();
display.drawBitmap(72, 1, ppwwmm, 58, 30, 1);
display.setFont();
display.setCursor(0,0);
display.print("PULSE WIDTH:");
display.setFont(&FreeSans12pt7b);
display.setCursor(0,28);
display.print(pulse);
snaga2= map(pulse,0,255,0,128);
display.drawLine(0,31,snaga2,31,1);
display.display();
}

}

void pritisnuto()
{

static unsigned long last_interrupt_time = 0;
unsigned long interrupt_time = millis();
if (interrupt_time - last_interrupt_time > 220)
{
stisnuto++;
tone(6,2250,50);
if(stisnuto>7)
stisnuto=0;
}
last_interrupt_time = interrupt_time;

}
long readVcc() {
#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
#elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
ADMUX = _BV(MUX5) | _BV(MUX0);
#elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
ADMUX = _BV(MUX3) | _BV(MUX2);
#else
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
#endif

delay(2);
ADCSRA |= _BV(ADSC);
while (bit_is_set(ADCSRA,ADSC));

uint8_t low = ADCL;
uint8_t high = ADCH;

long result = (high<<8) | low;

result = 1125300L / result;
return result;
}

-Choose your board type and com port
-then upload the Code

*How to use
-In 3 pin header you can use resistance,potentiometer.
-In 2 pin header you can use voltage drop ,voltage of led,continuity test,Voltage.
-for up button you can increase value and  for down button you can decrease value
-for middle button you can change mode.
-Enjoy

Post a Comment