Cov txheej txheem:
- Kauj ruam 1:
- Kauj Ruam 2: Ntsuas Cov Ntsuas Ntsuas
- Kauj ruam 3: Calibration
- Kauj ruam 4: Programming Arduino
- Kauj Ruam 5: Qee Cov Duab Ntxiv
- Kauj Ruam 6: Ua kom haum
- Kauj Ruam 7: Tsuas yog Duab
- Kauj Ruam 8: Cov Lus Kawg
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
4-20mA lub tshuab hluav taws xob muaj nyob ntawm ebay, tab sis kuv rau ib tus nyiam DIY ib feem ntawm yam thiab siv cov khoom kuv tau tso ib puag ncig.
Kuv xav sim peb lub PLC cov khoom siv sib piv los txheeb xyuas peb cov ntawv nyeem scada thiab sim cov txiaj ntsig ntawm 4-20mA cov cuab yeej. Muaj ntau qhov tam sim no rau cov hloov hluav taws xob thiab qhov hluav taws xob rau cov hloov pauv tam sim no rau arduino ntawm ebay, lawv xav tau kev ntsuas txawm hais tias. Kuv tuaj yeem siv qhov no txhawm rau ntsuas ib qho ntawm cov hloov pauv pom ntawm ebay thiab nyiam.
Kuv txiav txim siab tias kuv yuav DIY lub tshuab hluav taws xob thiab ntsuas ntsuas. Lub sijhawm no nws tseem yog ib txoj haujlwm tseem tab tom ua thiab yog ib qho qauv.
Kuv muaj lub suab 2.1 qub uas tsis tau siv (hais lus me me). Yog li kuv tau siv ib lub thawv hais lus ua ib lub thawv. Kuv kuj muaj lub tshuab hluav taws xob uas tuag vim yog xob laim, Kuv tshem lub dav hlau hais lus los ntawm lub tshuab hluav taws xob ntawd kom txuas tau cua. Kuv npaj siab yuav ua PCB nyob rau yav tom ntej thiab lub thawv ntawv zoo dua.
Khoom siv:
Daim Ntawv Teev Npe
LCD // 20x4 (hloov tus lej yog tias koj li me dua)
LM7808 // 8volt tus tswj hwm
LED // Txhua hom lossis loj
Resistor rau LED // Tsim nyog rau hom LED thiab 8volt
100 ohm resistor + 47 ohm resistor hauv koob // Yuav siv los ua shunt resistor
10K resistor // Arduino analog hauv kev tiv thaiv hluav taws xob siab
22K resistor // Txhawm rau nres A0 los ntawm ntab
Trimpot 100 ohm + 47 ohm resistor hauv koob // PT100 simulator
35 volt capacitor // Kuv siv 470uF, tsuas yog ua kom cov khoom hluav taws xob hloov pauv qis
RTD (PT100 tus hloov pauv) // Span tsis muaj teeb meem (ntau yam)
DIODE (rau kev tiv thaiv polarity)
TIAB SA 219
Arduino
Kauj ruam 1:
Ua raws li cov txheej txheem yuav tsum tau koj pib ntawm qhov twg ntxiv cov khoom thiab xaim lawv.
LM7808 tso cai siab tshaj 25volts cov tswv yim uas zoo rau PLC cov tshuab, feem ntau lawv siv 24volt cov khoom siv hluav taws xob. Ntxiv lub rhaub dej kub rau tus tswj hwm thiab tsis siv nws rau ncua sijhawm ntxiv. Kev poob 16volts ua rau tus tswj hwm tsim kom muaj cua sov ntau.
Cov tswv yim muab pub rau tus tswj hwm thiab txuas rau INA219 VIN, hauv qhov teeb tsa no INA219 tseem yuav tuaj yeem ntsuas qhov ntsuas hluav taws xob raug rho tawm qhov hluav taws xob poob los ntawm diode. Koj yuav tsum ntsuas koj qhov ntsuas hluav taws xob poob qis thiab ntxiv nws rau cov cai kom koj tau txais qhov ntsuas hluav taws xob raug nyeem.
Los ntawm INA219 VOUT rau RTD+ txhawb nqa RTD. RTD- rau hauv av ua tiav qhov Circuit Court.
Txhawm rau sim daim npav PLC sib piv koj yuav txuas RTD- rau cov lus nkag ntawm daim npav analog thiab hauv av los ntawm daim npav mus rau arduino av. (Nco ntsoov tshem tawm ib qho cuab yeej txuas nrog rau cov channel raug sim).
R5 thiab LED1, qhia tias lub zog tau qhib.
Tus tswj hwm pub rau hauv arduino VIN (arduino tau tsim los tswj hwm rau 5volts).
Arduino 5V tus pin mus rau INA219 txhawm rau ua kom muaj zog ntawm lub nkoj. INA219 GND rau hauv av arduino.
Txiav lub lauj kaub wiper rau RTD PIN1 thiab Trim lauj kaub tus pin 3 rau RTD tus pin 2 yuav ua piv txwv PT100 txuas. (Sib pauv cov xov hlau yog tias tig lub lauj kaub tais diav raws lub moos tsis nce mA).
Kauj Ruam 2: Ntsuas Cov Ntsuas Ntsuas
Txhawm rau ntsuas cov cuab yeej tsim tawm qhov xav tau ntxiv, xws li shunt resistor. Ib txwm 0.25W resistors yuav ua txoj haujlwm zoo xwb. Koj tuaj yeem tawm ntawm tus tiv thaiv shunt thiab ntxiv INA219 thib ob los ntsuas cov cuab yeej tso tawm. Kuv tsuas muaj ib sab laug xwb yog li kuv siv tus tiv thaiv hloov.
Kev sim siv lub shunt tuaj yeem ua tiav ntawm lub cuab yeej tsis zoo. Yog tias koj siv qhov zoo koj yuav muab koj cov arduino nrog ntau dua 4 zaug qhov tso cai tso tawm thiab tso cov pa luam yeeb tawm.
Ntxiv cov shunt resistor hauv koob nrog cov xaim tsis zoo ntawm qhov ntsuas. Sab ntawm lub shunt ze rau lub cuab yeej yuav dhau los ua qhov zoo sib xws rau arduino. Lwm sab ntawm lub shunt ze rau lub zog xa khoom yuav dhau los ua arduino hauv av ua tiav cov lus sib piv hauv Circuit Court.
150 ohm shunt resistor yog qhov siab tshaj plaws uas yuav tsum tau siv thaum siv arduino. Tus tiv thaiv muaj qhov ntsuas hluav taws xob poob tawm mus rau mA ntws los ntawm nws. Qhov ntau dua mA qhov ntau dua qhov hluav taws xob.
Ntawm 20mA tam sim no # 150ohm*0.02A = 3volt rau arduino.
Ntawm 4mA tam sim no # 150ohm*0.004A = 0.6volt rau arduino.
Tam sim no koj yuav xav kom qhov hluav taws xob nyob ze rau 5 volts yog li koj tuaj yeem ua rau peb tag nrho ADC ntau ntawm arduino. (Tsis yog lub tswv yim zoo).
RTD tuaj yeem ncav cuag 30.2mA tso zis (Kuv ua). 150ohm*0.03A = 4.8volts Qhov ntawd yog ze li kuv xav ua.
Lwm lub vev xaib qhia siv 250ohm resistor.
Ntawm 20mA tam sim no # 250ohm*0.02A = 5volt rau arduino.
Ntawm 30mA tam sim no # 250ohm*0.03A = 7.5volt rau arduino.
Koj pheej hmoo hlawv koj ADC thiab arduino.
Txhawm rau ntsuas qhov ntsuas tawm hauv thaj chaw, siv lub roj teeb 12volt nrog koj thiab txuas nws mus rau cov khoom siv. Kev siv lub zog sab nraud yuav tsis cuam tshuam rau kev teeb tsa PLC tam sim no.
Txhawm rau ntsuas daim npav sib piv hauv daim teb, nqa lub roj teeb 12volt nrog koj. Tshem tawm qhov ntsuas + los ntawm lub voj voog. Txuas hauv av mus rau qhov ntsuas hauv av thiab RTD- mus rau cov cuab yeej txuas tsis sib txuas.
Kauj ruam 3: Calibration
Txhawm rau ntsuas koj li shunt resistor nyeem, xaim RTD- mus rau shunt Analog hauv. Teeb koj lub lauj kaub tais kom cov mA tsim tawm yog 4mA. Yog tias koj lub cuab yeej mA tsis sib npaug ces hloov tus nqi thawj zaug hauv txoj cai ntawm kab 84. Ua kom tus nqi no yuav qis dua mA nyeem ntawv.
Tom qab ntawd teeb koj lub lauj kaub tais diav kom tsim tau 20mA. Yog tias koj lub cuab yeej mA tsis sib npaug ces hloov tus nqi thib ob hauv cov cai ntawm kab 84.
Yog li koj li 4-20mA tam sim no dhau los ua 0.6-3volts (theoretical). Ntau tshaj qhov txaus. Siv lub tsev qiv ntawv los ntawm eRCaGuy, kev txheeb xyuas ntau ntxiv yuav ua rau koj nyeem tau zoo dua thiab ruaj khov.
Vam tias koj nyeem qhov no. Nov yog kuv thawj qhov kev qhia, yog li thov coj nws yooj yim yog tias kuv tau ua yuam kev qhov chaw lossis tso qee yam tawm.
Txoj haujlwm no yog tej zaum tsis yog txoj hauv kev zoo tshaj rau nws, tab sis nws ua haujlwm rau kuv thiab lom zem ua nws.
Qee cov tswv yim kuv muaj ntxiv…
Ntxiv ib qho servo los tig lub lauj kaub tais diav hauv lub thawv.
Ntxiv cov laub khawm kom tig servo sab laug lossis sab xis.
Ntxiv lub ntsuas kub digital rau tus tswj hwm lub rhaub dej kub kom ceeb toom rau qhov phom sij txaus ntshai.
Kauj ruam 4: Programming Arduino
#suav nrog
// #suav nrog // Tsis pom zoo yog tias koj siv LCD nrog hloov npe.
#suav nrog
#suav nrog
#suav nrog
#suav nrog
A4 = (SDA)
A5 = (SCL)
Adafruit_INA219 ina219;
LiquidCrystal lcd (12, 11, 5, 4, 3, 2);
// LiquidCrystal_SR lcd (3, 4, 2); // Tsis pom zoo yog tias koj siv LCD nrog hloov npe.
// | ib | | _ Latch Pin
// | ib / _ Clock Pin
// / _ Data/Enable Pin
byte bitsOfResolution = 12; // hais kom saib xyuas qhov kev daws teeb meem
unsigned ntev numSamplesToAvg = 20; // tus naj npawb ntawm qhov piv txwv NTAWM QHOV KEV QHIA RESOLUTION uas koj xav coj thiab nruab nrab
ADC_prescaler_t ADCSpeed = ADC_DEFAULT;
unsigned ntev yav dhau losMillis = 0;
ntab shuntvoltage = 0.0; // Los ntawm INA219
ntab busvoltage = 0.0; // Los ntawm INA219
ntab current_mA = 0.0; // Los ntawm INA219
ntab loadvoltage = 0.0; // Los ntawm INA219
ntab arduinovoltage = 0.0; // Kev suav hluav taws xob los ntawm A0 tus pin
Tsis kos npe ntev A0analogReading = 0;
byte analogIn = A0;
ntab ma_mapped = 0.0; // Daim ntawv qhia qhov hluav taws xob los ntawm A0 txog 4-20mA
void teeb tsa () {
adc.setADCSpeed (ADCSpeed);
adc.setBitsOfResolution (bitsOfResolution);
adc.setNumSamplesToAvg (numSamplesToAvg);
uint32_t currentFrequency;
ina219.begin ();
ina219.setCalibration_32V_30mA (); // Hloov kho tsev qiv ntawv kom paub meej ntxiv ntawm mA
lcd.begin (20, 4); // pib lub LCD
lcd.clear ();
lcd.home (); // mus tsev
lcd.print ("********************");
ncua (2000);
lcd.clear ();
}
void lub voj ()
{
unsigned ntev currentMillis = millis ();
const ntev ncua = 100;
//&&&&&&&&&&&&&&&&&
Nyeem I2C cov cuab yeej ntawm ntu thiab ua qee qhov kev suav
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
yog (currentMillis - previousMillis> = ncua sijhawm) {
PreviousMillis = currentMillis;
Ntev ();
}
Luam_To_LCD (); // Kuv tej zaum tsis tas yuav hloov kho LCD qhov nrawm thiab tuaj yeem txav mus rau hauv qab Lub Sijhawm ()
}
tsis muaj dab tsi
Ntev () {
shuntvoltage = ina219.getShuntVoltage_mV ();
busvoltage = ina219.getBusVoltage_V ();
current_mA = ina219.getCurrent_mA ();
loadvoltage = (busvoltage + (shuntvoltage / 1000)) + 0.71; // +0.71 yog kuv qhov diode voltage poob
A0analogReading = adc.newAnalogRead (analogIn);
arduinovoltage = (5.0 * A0analogReading); // Suav rau mV
ma_mapped = daim ntawv qhia (arduinovoltage, 752, 8459, 30, 220) / 10.0; // Daim ntawv qhia tsis tuaj yeem siv ntab. Ntxiv 0 tom qab tus nqi mapped thiab faib los ntawm 10 kom tau txais ntab nyeem.
// Kav los ntawm kev suav hluav taws xob muab kev nyeem ruaj khov dua tom qab siv cov nyoos adc nyeem.
yog (shuntvoltage> = -0.10 && shuntvoltage <= -0.01) // Tsis muaj thauj khoom INA219 nyiam nyeem hauv qab -0.01, zoo li kuv ua.
{
current_mA = 0;
busvoltage = 0;
loadvoltage = 0;
shuntvoltage = 0;
}
}
tsis muaj dab tsi
Print_To_LCD () {
lcd.setCursor (0, 0);
yog (ma_mapped <1.25) {// Tsis muaj tam sim no qhov no yog kuv qhov kev nyeem mA, yog li kuv tsuas yog chuck nws tam sim ntawd.
lcd.print (" * 4-20mA Generator *");
}
lwm tus {
lcd.print ("** Analog Tester **");
}
lcd.setCursor (0, 1);
lcd.print ("Ntaus:");
lcd.setCursor (10, 1);
yog (ma_mapped <1.25) {
lcd.print ("tsis muaj cuab yeej");
}
lwm tus {
lcd.print (ma_mapped);
}
lcd.print ("mA");
lcd.setCursor (0, 2);
lcd.print ("Tsim:");
lcd.setCursor (10, 2);
lcd.print (tam sim no_mA);
lcd.print ("mA");
lcd.setCursor (0, 3);
lcd.print ("Muab khoom:");
lcd.setCursor (10, 3);
lcd.print (loadvoltage);
lcd.print ("V");
}
Kauj Ruam 5: Qee Cov Duab Ntxiv
Amplifier hais lus davhlau ya nyob twg. LED tsav los ntawm lub tshuab hluav taws xob tam sim no (RTD). Cov xov tooj hluav taws xob sib piv yuav hloov lub LED.
Lub davhlau ya nyob twg sab laug deb yog rau cov khoom siv nkag. Terminals ntawm sab xis yog rau cov cuab yeej siv tswv yim.
Kauj Ruam 6: Ua kom haum
Txhua yam zoo li haum. Kuv siv silicone los tuav qee yam khoom ua ke ib ntus. Lub lauj kaub tais diav yog siliconed rau sab xis. Ib lub qhov me me tau npaj ua ntej. Kuv tuaj yeem hloov kho tam sim no los ntawm sab saum toj ntawm lub npov.
Kauj Ruam 7: Tsuas yog Duab
Kauj Ruam 8: Cov Lus Kawg
Kuv tau sim cov cuab yeej no tso tawm nrog Allan Bradley PLC. Cov txiaj ntsig tau zoo heev. Kuv tau txais ntau yam. Kuv kuj tau sim cov cuab yeej no nrog 4-20mA lub ntsuas cua siab uas tau teeb tsa hauv LCD. Dua qhov tshwm sim tau zoo heev. Kuv qhov kev nyeem tau tawm los ntawm ob peb lub zauv.
Kuv sau kuv tus lej arduino hauv tabs. Hauv PLC lawv hu ua sub routines. Ua kom debugging yooj yim dua rau kuv.
Txuas nrog yog cov ntawv sau ntawm cov tabs.
Pom zoo:
Cov Khoom Siv Teeb Meem Siv Chaw Taws Teeb Siv Arduino: 7 Kauj Ruam
Cov Khoom Siv Teeb Meem Siv Khoom Siv Hluav Taws Xob Siv Arduino: Tam sim no, Cov Tsim, Cov tsim tawm tau nyiam Arduino rau kev txhim kho sai ntawm cov qauv ntawm cov phiaj xwm. Arduino yog lub platform siv hluav taws xob qhib raws qhov yooj yim-rau-siv-kho vajtse thiab software. Arduino muaj zej zog cov neeg siv zoo heev. Hauv qhov no
Arduino Roj Teeb Tester Nrog WEB Tus Neeg Siv Khoom Siv: 5 Kauj Ruam
Arduino Roj Teeb Tester Nrog WEB Tus Neeg Siv Khoom Sib Txuas: Hnub no, cov cuab yeej siv hluav taws xob siv roj teeb thaub qab kom txuag tau lub xeev uas cov haujlwm tau tso tseg thaum cov cuab yeej raug kaw lossis thaum twg, los ntawm kev sib tsoo, cov cuab yeej raug kaw. Tus neeg siv, thaum tig rau, rov qab mus rau qhov chaw uas nws nyob
Tsis Siv Neeg Kev Hla Hla Kev Siv Hluav Taws Xob Siv Arduino Raws Kev Nkag Nkag Platform: 9 Cov Kauj Ruam
Tsis Siv Neeg Kev Hla Hla Kev Siv Hluav Taws Xob Siv Arduino Raws Kev Nkag Siab Platform: Christmas tsuas yog ib lub lim tiam xwb! Txhua leej txhua tus tibneeg hu tauj coob nrog kev ua koob tsheej thiab tau txais khoom plig, uas, los ntawm txoj kev, tau txais txhua qhov nyuaj dua kom tau nrog qhov tsis muaj peev xwm nyob ib puag ncig peb. Yuav ua li cas mus los ntawm khoom plig qub thiab ntxiv qhov kov ntawm DIY rau
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
Generator - DC Generator Siv Reed Switch: 3 Kauj Ruam
Generator - DC Generator Siv Reed Hloov: Lub tshuab hluav taws xob yooj yim Dc Lub tshuab hluav taws xob tam sim no (DC) yog lub tshuab hluav taws xob uas hloov lub zog hluav taws xob mus rau hluav taws xob tam sim no. hloov