Cov txheej txheem:

Digital Arduino Voltmeter: 3 Kauj Ruam
Digital Arduino Voltmeter: 3 Kauj Ruam

Video: Digital Arduino Voltmeter: 3 Kauj Ruam

Video: Digital Arduino Voltmeter: 3 Kauj Ruam
Video: как сделать цифровой вольтметр на ардуино 2024, Kaum ib hlis
Anonim
Cov Digital Arduino Voltmeter
Cov Digital Arduino Voltmeter

Voltmeter lossis Voltage Meter yog ntsuas ntsuas uas siv los ntsuas ntsuas hluav taws xob.

Khoom siv

Kho vajtse Cheebtsam

Arduino Ib

LCD - 16x2

Tib tig Potentiometer- 10k ohms

Kev tiv thaiv 100k ohm

Kev tiv thaiv 10k ohm

Software Cheeb Tsam

Arduino IDE Cov

Kauj Ruam 1: Txog Txoj Haujlwm

Txog Txoj Haujlwm
Txog Txoj Haujlwm

Tsim Circuit Court

Txhawm rau kov yeej qhov tsis zoo ntawm analog voltmeters, Digital Voltmeters tau nthuav tawm. Ntau dua li tsuas yog ntsuas thiab taw qhia kom pom qhov ntsuas hluav taws xob zoo ib yam li analog voltmeter, digital voltmeters qhia ncaj qha ntsuas qhov ntsuas ntawm cov zaub.

Circuit Tsim Tus Pin 1 thiab Pin 2 (Vss thiab Vdd) ntawm LCD lub hwj chim muab yog cov pins rau zaub. Lawv tau txuas rau hauv av thiab +5V cov khoom siv feem. Tus Pin 3 (Vee) ntawm LCD txuas nrog lub wiper davhlau ya nyob twg ntawm 10KΩ POT thiab lwm lub davhlau ya nyob twg ntawm POT txuas nrog +5V cov khoom siv thiab hauv av feem. 3 tus pin tom ntej ntawm LCD yog tswj tus pin.

Tus Pin 4 thiab Tus Pin 6 ntawm LCD tau txuas rau digital input/output pins 2 thiab 3 ntawm Arduino feem. Tus Pin 5 (RW) ntawm LCD tau txuas rau hauv av. Tus Pin 15 (LED +) ntawm LCD txuas nrog +5V cov khoom siv los ntawm qhov txwv tam sim no ntawm 220Ω. Pin 16 (LED-) ntawm LCD tau txuas rau hauv av.

Qhov tso tawm ntawm qhov hluav taws xob faib hluav taws xob suav nrog 100KΩ resistor thiab 10KΩ resistor txuas nrog rau tus lej sib txuas tus lej A0 ntawm Arduino UNO nrog lwm qhov kawg ntawm 100KΩ resistor txuas rau qhov hluav taws xob kom suav thiab lwm qhov kawg ntawm 10KΩ resistor txuas rau hauv av.

Ua hauj lwm

Hauv digital voltmeter, qhov ntsuas hluav taws xob kom kwv yees, uas yog nyob hauv daim ntawv sib piv, tau hloov pauv mus rau digital daim ntawv nrog kev pab los ntawm Analog rau Digital Converters (ADC).

Li no, ADC tshwj xeeb ntawm Arduino UNO tau siv hauv txoj haujlwm no. Lub sijhawm siv hluav taws xob rau Arduino Uno cov lus sib piv yog 0V txog 5V.

Yog li, txhawm rau txhawm rau txhim kho qhov no, yuav tsum tau siv qhov faib hluav taws xob faib hluav taws xob. Nrog kev pab los ntawm qhov faib hluav taws xob faib hluav taws xob, qhov hluav taws xob nkag tau raug suav tau raug coj mus rau qhov ntau ntawm Arduino UNOs analog input.

Kauj ruam 2: Khiav qhov program

/*

DC Voltmeter Cov

*/ #suav nrog LiquidCrystal lcd (7, 8, 9, 10, 11, 12);

int analogInput = 0;

ntab vout = 0.0;

ntab vin = 0.0;

ntab R1 = 100000.0; // tsis kam ntawm R1 (100K)

ntab R2 = 10000.0; // tsis kam ntawm R2 (10K)

int tus nqi = 0;

void teeb tsa ()

{pinMode (analog nkag, INPUT);

lcd.begin (16, 2);

lcd.print ("DC VOLTMETER");

}

void lub voj ()

{// nyeem tus nqi ntawm analog input tus nqi = analogRead (analogInput);

vout = (tus nqi * 5.0) / 1024.0;

vin = vout / (R2 / (R1+R2));

yog (vin <0.09)

{vin = 0.0; // nqe lus rau quash tsis xav nyeem

lcd.setCursor (0, 1);

lcd.print ("INPUT V =");

lcd.print (vin);

ncua (500);

}

Kauj ruam 3:

Kawm paub ntau ntxiv txog IoT Kev Kawm Online nrog uas koj tuaj yeem tsim tau yooj yim tsim Kev Lag Luam IoT Kev Lag Luam.

Pom zoo: