Cov txheej txheem:

Kuv - V Nkhaus Nrog Arduino: 5 Kauj Ruam
Kuv - V Nkhaus Nrog Arduino: 5 Kauj Ruam

Video: Kuv - V Nkhaus Nrog Arduino: 5 Kauj Ruam

Video: Kuv - V Nkhaus Nrog Arduino: 5 Kauj Ruam
Video: qhia nqi Adobe Premiere Pro CC 2017_siv txiav Video tso Youtube 2018 2024, Hlis ntuj nqeg
Anonim
Kuv - V Nkhaus Nrog Arduino
Kuv - V Nkhaus Nrog Arduino

Kuv txiav txim siab los tsim I -V nkhaus ntawm leds. Tab sis kuv tsuas muaj ib lub multimeter, yog li kuv tsim tau yooj yim I-meter nrog Arduino Uno.

Los ntawm Wiki: Tus yam ntxwv tam sim no – voltage lossis I – V nkhaus (tam sim no – qhov nkhaus nkhaus) yog kev sib raug zoo, feem ntau sawv cev raws li daim duab lossis kab duab, nruab nrab ntawm qhov hluav taws xob tam sim no los ntawm kev siv hluav taws xob, khoom siv, lossis cov khoom siv, thiab qhov sib xws sib txuas, lossis muaj peev xwm sib txawv hla nws.

Kauj Ruam 1: Cov Npe Khoom

Rau qhov haujlwm no, koj yuav xav tau:

Arduino Uno nrog USB cable

breadboard thiab duponts cable

leds (Kuv siv 5 hli liab thiab xiav leds)

poob resistor (shunt resistor) - Kuv txiav txim siab rau 200 ohm (rau 5V yog qhov siab tshaj tam sim no 25 mA)

resistors lossis potenciometer, Kuv siv sib xyaw resistors - 100k, 50k, 20k, 10k, 5k, 2.2k, 1k, 500k

Kauj ruam 2: Circuit Court

Circuit Court
Circuit Court

Circuit Court suav nrog los ntawm kev ntsuas coj, shunt resistor (R_drop) rau ntsuas tam sim no. Txhawm rau hloov qhov poob qis thiab tam sim no kuv siv ntau yam resistors (R_x).

Lub hauv paus ntsiab lus yog:

  • tau txais tag nrho tam sim no kuv hauv Circuit Court
  • tau txais qhov hluav taws xob poob ntawm kev sim coj Ul

Tag nrho tam sim no I

Txhawm rau kom tau txais tag nrho tam sim no, Kuv ntsuas qhov hluav taws xob poob Ur ntawm shunt resistor. Kuv siv analog pins rau qhov ntawd. Kuv ntsuas voltage:

  • U1 ntawm GND thiab A0
  • U2 ntawm GND thiab A2

Qhov sib txawv ntawm qhov ntsuas hluav taws xob no sib npaug qhov hluav taws xob poob ntawm shunt resistor: Ur = U2-U1.

Tag nrho tam sim no kuv yog: Kuv = Ur/R_drop = Ur/250

Voltage poob Ul

Txhawm rau kom tau txais qhov hluav taws xob poob ntawm coj, Kuv rho tawm U2 los ntawm tag nrho cov hluav taws xob U (uas yuav tsum yog 5V): Ul = U - U2

Kauj ruam 3: Code

ntab U = 4980; // qhov hluav taws xob nruab nrab ntawm GND thiab arduino VCC hauv mV = tag nrho qhov hluav taws xob

ntab U1 = 0; // 1 sojntsuam

ntab U2 = 0; // 2 sojntsuam

float ua = 0; // voltage poob ntawm shunt resistor

float Ul = 0; // voltage poob ntawm coj

ntab I = 0; // tag nrho tam sim no hauv Circuit Court

ntab R_drop = 200; // tsis kam ntawm kaw resistor

void teeb tsa ()

{

Serial.begin (9600);

pinMode (A0, INPUT);

pinMode (A1, INPUT);

}

void lub voj ()

{

U1 = ntab (analogRead (A0))/1023*U; // tau txais qhov hluav taws xob nruab nrab ntawm GND thiab A0 hauv milliVolts

U2 = ntab (analogRead (A1))/1023*U; // tau txais qhov hluav taws xob nruab nrab ntawm GND thiab A1 hauv milliVolts

Ua = U2-U1; // poob qhov hluav taws xob ntawm shunt resistor

Kuv = Ur/R_drop*1000; // tag nrho tam sim no hauv microAmps

Ul = U-U2; // voltage poob ntawm coj

Serial.print ("1");

Serial.print (U1);

Serial.print ("2");

Serial.print (U2);

Serial.print ("////");

Serial.print ("qhov hluav taws xob poob ntawm shunt resistor:");

Serial.print (Ua);

Serial.print ("qhov hluav taws xob poob ntawm coj:");

Serial.print (Ul);

Serial.print ("tag nrho tam sim no:");

Serial.println (Kuv);

// ncua

ncua (500);

}

Kauj ruam 4: Xeem

Kev Xeem
Kev Xeem
Kev Xeem
Kev Xeem
Kev Xeem
Kev Xeem

Kuv sim 2 leds, liab thiab xiav. Raws li koj tuaj yeem pom, cov coj xiav muaj lub hauv caug hluav taws xob loj dua, thiab qhov ntawd yog vim li cas xiav coj xav tau xiav coj pib tshuab ib puag ncig 3 Volts.

Kauj Ruam 5: Kuaj Cov Tiv Thaiv

Kuaj Resistor
Kuaj Resistor
Kuaj Resistor
Kuaj Resistor

Kuv ua kuv - V nkhaus rau resistor. Raws li koj tuaj yeem pom, kab ntawv yog kab tawm. Cov duab qhia, tias Ohm´s txoj cai ua haujlwm tsuas yog rau cov neeg tawm tsam, tsis yog rau leds. Kuv xam qhov tsis kam, R = U/I. Kev ntsuas tsis meej ntawm tus nqi qis tam sim no, vim tias analog - digital converter hauv Arduino muaj kev daws teeb meem:

5V / 1024 = 4.8 mV thiab tam sim no -> 19.2 microAmps.

Kuv xav tias ntsuas yuam kev yog:

  • breadboard contants tsis yog super contants thiab ua rau qee qhov yuam kev hauv qhov hluav taws xob
  • siv cov resistors muaj ib puag ncig 5 % ntau yam hauv kev tiv thaiv
  • ADC qhov tseem ceeb los ntawm analog nyeem oscilate

Pom zoo: