Cov txheej txheem:

Yuav Ua Li Cas Tsim Arduino Luj Nplai: 8 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Tsim Arduino Luj Nplai: 8 Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Tsim Arduino Luj Nplai: 8 Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Tsim Arduino Luj Nplai: 8 Kauj Ruam (nrog Duab)
Video: La Yang Ft. Phuab Vaj - Yuav Ua Li Cas [Official MV] 2024, Hlis ntuj nqeg
Anonim
Yuav Ua Li Cas Tsim Arduino Luj Nplai
Yuav Ua Li Cas Tsim Arduino Luj Nplai

Ntawm Txoj Haujlwm Rov Pib Ua Haujlwm hauv London peb tuav cov xwm txheej kho qhov chaw uas cov tswvcuab raug caw tuaj koom nqa txhua yam khoom siv hluav taws xob thiab khoom siv hluav taws xob los kho, thiaj li cawm tau lawv los ntawm qhov chaw pov tseg. Ob peb lub hlis dhau los (ntawm qhov xwm txheej kuv tsis tau koom nrog) ib tus neeg nqa qee qhov ua tsis raug hauv lub tsev hnyav uas teev uas tsis muaj leej twg tuaj yeem kho tau.

Tsis tau pom dua hauv ib qho kev ntsuas qhov hnyav digital thiab tsis paub tias lawv ua haujlwm li cas, Kuv coj nws los ua qhov nyuaj rau kev tshawb fawb lawv, hauv tus txheej txheem, tsim ob yam ntawm kuv tus kheej.

Yog tias koj xav tsim koj tus kheej qhov hnyav lossis suav nrog ua haujlwm hnyav hauv qhov haujlwm dav dua, koj tuaj yeem siv Cov Lus Qhia no ua lub hauv paus, txawm koj xav tau dab tsi, los ntawm qhov hnyav ib feem ntawm ntau gram mus rau ntau kilograms.

Yog li kuv yuav mloog zoo rau cov khoom siv hluav taws xob, software thiab cov hauv paus ntsiab lus. Yuav ua li cas koj paub koj tus kheej txoj haujlwm yog nyob ntawm koj.

Kuv tseem yuav qhia koj yuav ua li cas ntsuas lawv, txawm tias koj tsis muaj qhov hnyav li tus qauv.

Tau ua kuv qhov kev tshawb fawb thiab tau lees paub nws los ntawm kev tsim kuv tus kheej cov nplai, Kuv tau sau cov hauv paus ntsiab lus ntawm kev ntsuas cov nplai, suav nrog txhua yam uas kuv tuaj yeem txiav tawm txog kev ua txhaum, hauv Restart Project Wiki. Mus thiab saib!

Kauj Ruam 1: Xaiv Koj Cov Load Cells

Xaiv Koj Lub Cell Load
Xaiv Koj Lub Cell Load
Xaiv Koj Lub Cell Load
Xaiv Koj Lub Cell Load

Txhua qhov ntsuas hnyav digital tau tsim nyob ib puag ncig ntawm 4 lub davhlau ya nyob twg ntawm tes lossis plaub 3-lub davhlau ya nyob twg. Qhov twg kom tau txais yog nyob ntawm seb hom nplai koj xav ua. Lawv txhua tus sib xyaw hluav taws xob thiab pheej yig ncaj ncees yog li koj tuaj yeem hloov koj lub siab tom qab, lossis tau txais ntau dua ib hom los sim nrog.

Rau chav ua noj lossis nplai xa ntawv nrog qhov siab tshaj plaws nyob hauv thaj tsam ntawm 100g txog 10 kg, koj tuaj yeem tau txais 4 lub davhlau ya nyob twg thauj khoom uas muaj cov khoom siv txhuas. Qhov no tau teeb tsa kab rov tav, txhawb nqa ntawm ib kawg thiab txhawb nqa lub luj ntawm lwm qhov. Nws muaj 4 hom ntsuas ntsuas txuas rau nws. Kuv piav qhia tag nrho nws ua haujlwm li cas hauv kuv tsab xov xwm wiki yog li kuv tsis rov hais dua ntawm no.

Cov no tsis haum rau qhov hnyav dua xws li teev hauv chav dej, qhov twg tus neeg qhov hnyav tag nrho, tsis tas yuav nyob nruab nrab ntawm lub platform, tau txais kev txhawb nqa zoo dua los ntawm 4 lub xov tooj ntawm tes txhawb nqa 4 lub ces kaum ntawm lub platform.

Nov yog qhov twg plaub 3 lub davhlau ya nyob twg thauj khoom tau zoo dua. Cov neeg ntsuas ntawm 50kg txhua tus muaj dav, uas ua ke yuav hnyav txog 200kg.

Lwm tus nrog rau qhov ntsuas tau zoo dua tau tsim los ncua kev hnyav kom ntsuas tom qab kev zam ntawm lub nra ntawm lub nra

Kauj ruam 2: Lwm Yam Koj Xav Tau

Lwm Yam Koj Xav Tau
Lwm Yam Koj Xav Tau

Ntxiv rau koj lub cell load lossis load cells, koj yuav xav tau:

  • Ib Arduino. Koj tuaj yeem siv qhov zoo ib yam uas koj nyiam tab sis kuv siv Nano vim nws muaj USB interface sib xyaw ua ke thiab tseem tsuas yog nqi ob peb phaus.
  • HX711 tus qauv. Qhov no tuaj yeem tuaj koom nrog koj lub xov tooj ntawm tes tab sis muaj cov pheej yig heev raws li cov khoom sib cais los ntawm ntau qhov chaw.
  • Rau kev tsim qauv, 400 lub ntsiab lus qhob cij, cov jumper ua, tus pin thiab cov hlua ntsawb.

Koj tseem yuav xav tau ntoo, yas, ntsia hlau, kua nplaum, lossis xijpeem koj xav tau rau koj qhov tshwj xeeb ntawm txoj haujlwm.

Kauj Ruam 3: Npaj Tshooj

Npaj Cov Xeem
Npaj Cov Xeem
Npaj Cov Xeem
Npaj Cov Xeem

Txhawm rau siv HX711 tus qauv ntawm lub khob cij, siv lub 4-dav pinstrip rau tus pin interface (GND, DT, SCK, VCC) ntawm HX711.

Kom yooj yim kev sib txuas thiab kev sib txuas ntawm lub xov tooj ntawm tes (tshwj xeeb yog tias koj tab tom sim nrog ntau dua ib qho) sib dhos 6-thoob tus pin ntsawb sawb rau cov paum sib piv. (Koj tsuas xav tau E+, E-, A- thiab A+ pins tab sis kuv tau teeb tsa 6-daim kab xev nyob rau qhov xwm txheej kuv xav sim nrog lwm ob.)

Yog tias koj siv 4-xaim thauj khoom ntawm tes koj yuav tom qab ntawd yuav tsum tau muab cov kab 4 coj los ntawm lub xovtooj ntawm tes mus rau 4-tus lej xov tooj. Thawj ob tus pin yuav yog E+ thiab E- thiab lwm ob A- thiab A+. Kuv kaw daim kab xev txuas nrog daim kab xev PVC los tiv thaiv lawv. Ib lub cim ntawm ib kawg thiab lub cim sib thooj ntawm tus pin tus pin txhais tau tias kuv paub txoj kev puag ncig los txuas nws, txawm tias kuv tsis xav tias nws tseem ceeb.

Txo cov xov tooj ntawm tes sib txawv xim xim cov xov hlau sib txawv, tab sis nws yooj yim los qhia qhov twg yog qhov twg. Nrog lub ntsuas ntsuas ntawm qhov ntsuas tsis kam, ntsuas qhov tsis kam ntawm txhua khub ntawm cov xov hlau. Muaj 6 qhov ua tau ntawm 4 xov hlau tab sis koj tsuas yuav tau txais 2 qhov sib txawv nyeem. Yuav muaj 2 khub uas nyeem 33% ntau dua li lwm 4, hais, 1, 000Ω siv 750Ω. Ib ntawm cov khub ntawd yog E+ thiab E- thiab lwm qhov yog A+ thiab A- (tab sis nws tsis txawv qhov twg).

Thaum koj tau txais txhua yam ua haujlwm, yog tias qhov ntsuas nyeem qhov hnyav tsis zoo thaum koj tso qee yam rau nws, pauv E+ thiab E-. (Los yog A+ thiab A- yog tias nws yooj yim dua. Tab sis tsis yog ob qho tib si!)

Kauj Ruam 4: Yuav Siv Li Cas 3-xaim Load Cells

Yuav Ua Li Cas Siv 3-xaim Load Cells
Yuav Ua Li Cas Siv 3-xaim Load Cells

Yog tias koj siv plaub 3-xaim thauj cov cell koj yuav tau xaim lawv ua ke nrog ib daim kab xev, thiab nqa E+, E-, A+ thiab A- txuas los ntawm kev sib txuas.

Txij li cov xim hlau ntawm koj li yuav txawv ntawm kuv, cia peb hu 3 xaim xim ntawm txhua lub xov tooj ntawm tes A, B thiab C.

Nrog lub ntsuas ntsuas ntawm qhov ntsuas tsis kam, ntsuas qhov tsis kam ntawm txhua khub ntawm cov xov hlau. Muaj 3 khub ua tau, tab sis koj tsuas yog ntsuas 2 qhov sib txawv nyeem. Txheeb xyuas tus khub uas nyeem ob zaug ib qho ntawm ob qho ntxiv. Hu rau tus khub A thiab C. Tus uas koj tso tawm yog B.

Cov lus yooj yim, koj yuav tsum xaim 4 lub xov tooj ntawm tes nyob hauv ib lub xwmfab, nrog A xov tooj ntawm txhua txuas nrog A hlau ntawm nws cov neeg nyob sib ze, thiab C xaim mus rau C hlau ntawm nws cov neeg nyob sib ze ntawm lwm sab. Cov xov hlau B ntawm ob lub xovtooj ntawm ob sab sib luag ntawm lub xwmfab yog E+ thiab E-, thiab B xov ntawm lwm tus khub yog A+ thiab A-

Kauj Ruam 5: Txuas Txuas Lub Breadboard

Txuas Txuas Lub Breadboard
Txuas Txuas Lub Breadboard

Kev xaim lub khob cij yog yooj yim heev, xav tau tsuas yog 4 tus dhia. Lub tsev qiv ntawv Fritzing tsuas yog muab kuv qhov sib txawv me ntsis ntawm HX711 tus qauv los ntawm kuv tus kheej tab sis cov xov hlau zoo ib yam. Koj tuaj yeem ua raws daim duab, lossis yog tias koj siv Arduino sib txawv, xaim nws raws li hauv cov lus hauv qab no:

Arduino Pin HX711 Pin 3V3 VCC GND GND A0 SCK A1 DT

Kauj Ruam 6: Mounting Load Cells

Mounting Load Cells
Mounting Load Cells
Mounting Load Cells
Mounting Load Cells

Aluminium bar hom ntawm load cell muaj ob qhov xov hauv txhua qhov kawg. Koj tuaj yeem siv ib khub los teeb tsa nws ntawm lub hauv paus haum nrog lub spacer nyob nruab nrab. Lwm tus khub koj tuaj yeem siv tib txoj hauv kev txhawm rau txhawm rau hnyav lub platform, dua, nrog lub qhov taub. Tsuas yog rau kev sim ua lub hom phiaj koj tuaj yeem siv cov ntoo seem lossis cov yas uas koj yuav tsum tau muab rau, tab sis rau cov khoom lag luam zoo kawg koj yuav xav tau saib xyuas ntau dua.

Txoj hauv kev yooj yim tshaj plaws txhawm rau txhawm rau plaub plaub 3-xaim load hlwb yog nruab nrab ntawm ob daim ntawm chipboard. Kuv siv lub router ua 4 qhov khawb qhov tob hauv lub hauv paus txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm Hauv kuv qhov xwm txheej qhov xav tau xav tau me ntsis tob hauv nruab nrab kom ob lub rivets hauv qab tsis so ntawm lub hauv paus.

Kuv siv rab yaj phom yaj yaj kub los tuav cov cell thauj khoom hauv qhov chaw ntawm lub hauv paus thiab tseem txhim kho kab txaij mus rau lub hauv paus hauv nruab nrab. Kuv tom qab ntawd nias lub platform hnyav hnyav rau ntawm lawv kom cov pob ntxau rau saum lub nra ntawm lub hlwb ua rau me me. Kuv ua kom tob dua cov no nrog lub router thiab tshawb xyuas lawv tseem ua tau zoo nrog lub hlwb thauj khoom. Tom qab ntawd kuv muab cov kua nplaum kub yaj tso rau thiab ib ncig ntawm txhua qhov chaw nkag thiab nrawm nrawm lub ntsuas qhov hnyav mus rau lub hlwb thauj khoom ua ntej cov kua nplaum tawv.

Kauj Ruam 7: Programming Arduino

Kuv xav tias koj muaj Arduino IDE teeb tsa hauv koj lub computer thiab paub siv nws li cas. Yog tias tsis yog, txheeb xyuas ib qho ntawm ntau qhov kev qhia Arduino - uas tsis yog kuv lub hom phiaj ntawm no.

Los ntawm IDE cov ntawv qhia zaub mov nco, xaiv Sketch - Xws li Lub Tsev Qiv Ntawv - Tswj Tsev Qiv Ntawv …

Ntaus hx711 hauv lub thawv tshawb nrhiav. Nws yuav tsum nrhiav HX711-tus tswv. Nyem Nruab.

Rub tawm cov ntawv txuas HX711.ino piv txwv kos duab. Los ntawm IDE File drop-down menu, qhib cov ntawv koj nyuam qhuav rub tawm. IDE yuav hais tias nws yuav tsum tau nyob hauv daim nplaub tshev - tso cai rau nws muab tso rau hauv ib qho.

Sib sau ua ke thiab xa cov duab kos, tom qab ntawv nyem rau ntawm Serial Monitor hauv IDE.

Hauv qab no yog qee qhov piv txwv tso tawm. Hauv thawj theem pib nws nthuav tawm qhov nruab nrab ntawm 20 qhov kev nyeem nyoos los ntawm HX711, tom qab ntawd teeb tsa tare (piv txwv li xoom point). Tom qab qhov no nws muab ib qho nyeem nkaus xwb, qhov nruab nrab ntawm 20 thiab qhov nruab nrab ntawm 5 tsawg dua qhov tare. Thaum kawg, qhov nruab nrab ntawm 5 tsawg dua qhov tare thiab faib los ntawm qhov ntsuas ntsuas kom muab ntsuas ntsuas hauv grams.

Rau txhua qhov nyeem nws muab qhov ntsuas nruab nrab ntawm 20, thiab tus qauv sib txawv. Tus txheej txheem sib txawv yog npau taws ntawm qhov muaj txiaj ntsig nyob rau hauv uas 68% ntawm txhua qhov kev ntsuas xav tias yuav dag. 95% yuav nyob tsis pub dhau ob zaug ntawm qhov no thiab 99.7% hauv peb zaug ntawm qhov ntau.

Hauv qhov ua piv txwv no, tom qab nyeem thawj zaug kuv tau tso nyiaj npib tshiab rau ntawm lub platform, uas yuav tsum hnyav li 8.75g.

HX711 DemoInitializing the scale Raw ave (20): 1400260 Tom qab teeb tsa nplai: Raw: 1400215 Raw ave (20): 1400230 Raw ave (5) - tare: 27.00 Calibrated ave (5): 0.0 Nyeem: Txhais, Std Dev ntawm 20 nyeem: -0.001 0.027 Sijhawm siv: 1.850Secs Txhais, Std Dev ntawm 20 nyeem: 5.794 7.862 Lub sijhawm siv: 1.848Secs Txhais, Std Dev ntawm 20 nyeem: 8.766 0.022 Lub sijhawm siv: 1.848Secs Txhais, Std Dev ntawm 20 nyeem: 8.751 0.034 Sijhawm Siv: 1.849Secs Mean, Std Dev ntawm 20 nyeem: 8.746 0.026 Lub sijhawm siv: 1.848Secs

Kauj ruam 8: Calibration

Calibration
Calibration

Arduino kos duab hauv cov kauj ruam dhau los muaj ob qhov ntsuas ntsuas (lossis ntsuas qhov ntsuas) cuam tshuam txog kuv 1kg thiab kuv teeb ntawm plaub 50kg 3-xaim thauj cov cell. Cov no nyob ntawm kab 19 thiab 20. Koj yuav tsum tau ua koj tus kheej ntsuas, pib nrog ib qho kev txiav txim siab yam tsis zoo xws li 1 (ntawm kab 21).

Kuv tsis muaj tus qauv hnyav, yog li rau 1kg load cell kuv tau siv £ 1 npib tshiab, uas hnyav 8.75g. Qhov zoo tshaj koj yuav tsum siv qee yam hnyav yam tsawg ib feem kaum ntawm qhov ntsuas siab tshaj plaws.

Nrhiav ib yam dab tsi - txhua yam - ntawm qhov hnyav tsim nyog. Coj nws mus rau koj lub chaw xa ntawv hauv zos, ua piv txwv tias koj yuav tsum tshaj tawm nws, thiab muab nws tso rau ntawm qhov ntsuas thiab ua tib zoo ceeb toom ntawm qhov hnyav. Lossis koj tuaj yeem coj nws mus rau tus tub luam xws li tus phooj ywg ntsuab ntsuab hauv zos. Ib tus neeg lag luam uas muaj npe zoo yuav tsum muaj lawv cov ntsuas ntsuas tsis tu ncua kom ua raws li cov qauv kev lag luam.

Tam sim no koj muaj lub hom phiaj ntawm qhov hnyav paub. Muab nws tso rau ntawm koj cov nplai thiab nco ntsoov nyeem ntawv. Muab koj tus lej ntsuas tam sim no los ntawm kev nyeem ntawv uas koj tau txais thiab faib qhov txiaj ntsig los ntawm qhov kev nyeem ntawv yuav tsum yog li cas, tsis hais hauv grams, phaus, phaus, ntxhw me me lossis lwm yam uas koj xaiv. Qhov tshwm sim yog koj qhov ntsuas ntsuas tshiab. Sim koj qhov hnyav dua, thiab yog tias tsim nyog, rov ua cov txheej txheem.

Pom zoo: