Cov txheej txheem:

RAWS LI COV NTAUB NTAWV NTSEEG NTAWV NTAWV MUAJ NTAWV TSHUAJ NTAWV TSO CAI RAU RASPBERRY PI: 6 Kauj Ruam (nrog Duab)
RAWS LI COV NTAUB NTAWV NTSEEG NTAWV NTAWV MUAJ NTAWV TSHUAJ NTAWV TSO CAI RAU RASPBERRY PI: 6 Kauj Ruam (nrog Duab)

Video: RAWS LI COV NTAUB NTAWV NTSEEG NTAWV NTAWV MUAJ NTAWV TSHUAJ NTAWV TSO CAI RAU RASPBERRY PI: 6 Kauj Ruam (nrog Duab)

Video: RAWS LI COV NTAUB NTAWV NTSEEG NTAWV NTAWV MUAJ NTAWV TSHUAJ NTAWV TSO CAI RAU RASPBERRY PI: 6 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Txuas nrog ntau lub ntsuas hluav taws xob rau RASPBERRY PI
Txuas nrog ntau lub ntsuas hluav taws xob rau RASPBERRY PI

Hauv txoj haujlwm no, peb yuav txuas peb ntawm Atlas Scientific's EZO sensors (pH, yaj cov pa thiab kub) mus rau Raspberry Pi 3B+. Hloov chaw ntawm txuas cov kab hluav taws xob mus rau Raspberry Pi, peb yuav siv Whitebox Labs Tentacle T3 daim ntaub thaiv. Cov ntaub thaiv npog ruaj khov no ntsaws rau hauv tus pin ntawm Pi tom qab uas EZO cov hluav taws xob thiab tshawb xyuas txuas mus rau daim ntaub thaiv. Kev sib cuam tshuam nrog lub ntsuas hluav taws xob tau ua tiav siv lub dav hlau hais kom ua hauv Raspbian.

ADVANTAGES:

  • Tsis muaj xov hlau, tsis muaj cov laug cam thiab tsis muaj qhov yuav tsum tau siv.
  • Ua tiav cov ntaub thaiv npog yooj yim nce mus rau Raspberry Pi.
  • Kev cais tawm ua ke tiv thaiv cov sensors los ntawm kev cuam tshuam.
  • Txuas ntau lub ntsuas hluav taws xob mus rau Raspberry Pi.
  • Ua haujlwm nrog EZO cov ntsuas hluav taws xob hauv qab no: pH, salinity, yaj oxygen, oxidation-txo peev xwm, kub, peristaltic twj tso kua mis, thiab carbon dioxide.

Cov ntaub ntawv

  • Raspberry Pi 3B+
  • Raspberry Pi fais fab mov
  • 8GB micro SD daim npav
  • Whitebox Labs T3 ntaub thaiv npog
  • pH Circuit & sojntsuam
  • yaj cov pa oxygen & sojntsuam
  • ntsuas kub & sojntsuam

Khoom siv

USB keyboard, USB nas, Saib nrog lub peev xwm HDMI, USB micro SD daim npav nyeem ntawv

Kauj ruam 1: DOWNLOAD THIAB INSTALL RASPBIAN ONTO SD CARD

a) Rub tawm Raspbian zip file rau hauv koj lub computer los ntawm qhov txuas hauv qab no. "Raspbian Buster nrog lub desktop thiab pom zoo software" tau siv hauv txoj haujlwm no.

b) Txhawm rau nruab Raspbian mus rau SD daim npav xav tau cov cuab yeej sau ntawv xws li Etcher. Rub tawm thiab teeb tsa Etcher rau hauv koj lub computer.

c) Ntxig daim npav micro SD rau hauv USB daim npav nyeem ntawv thiab ntsaws tus nyeem ntawv rau hauv koj lub computer. Yog tias koj daim npav SD xav tau kev teeb tsa koj tuaj yeem siv SD Formatter program.

d) Qhib lwm qhov program.

  • Xaiv Raspbian cov ntawv rub tawm los ntawm kauj ruam a.
  • Xaiv koj daim npav SD.
  • Nyem rau ntawm "Flash!" tab kom pib sau ntawv rau SD daim npav

Kauj Ruam 2: Khau raj RASPBERRY PI thiab teeb tsa teeb tsa

Khau raj RASPBERRY PI thiab teeb tsa teeb tsa
Khau raj RASPBERRY PI thiab teeb tsa teeb tsa
Khau raj RASPBERRY PI thiab teeb tsa teeb tsa
Khau raj RASPBERRY PI thiab teeb tsa teeb tsa
Khau raj RASPBERRY PI thiab teeb tsa teeb tsa
Khau raj RASPBERRY PI thiab teeb tsa teeb tsa
Khau raj RASPBERRY PI thiab teeb tsa teeb tsa
Khau raj RASPBERRY PI thiab teeb tsa teeb tsa

a) Txuas tus saib, keyboard, thiab nas rau koj li Raspberry Pi.

b) Tom qab Raspbian duab teeb tsa ntawm SD daim ntawv tiav, tshem nws los ntawm lub khoos phis tawj thiab ntxig nws rau hauv Raspberry Pi. Qhib lub zog rau Pi.

Default raspberry credentials: neeg siv lub npe yog pi thiab lo lus zais yog raspberry

c) Txij li qhov no yog thawj zaug khau raj Raspbian, koj yuav raug hais kom hloov kho qee qhov chaw xws li cov lus, thaj tsam sijhawm thiab ntxiv kev sib txuas hauv is taws nem. Nco ntsoov txuas mus rau is taws nem vim qhov no yuav xav tau hauv cov theem tom ntej.

Hloov kho thiab txhim kho pob

d) Qhib lub davhlau ya nyob twg los ntawm Raspbian desktop. Hloov kho kab ke cov npe khoom los ntawm kev nkag mus rau cov lus txib hauv qab no sudo apt-tau hloov tshiab

e) Txhim kho cov pob khoom teeb tsa rau lawv cov ntawv tshiab kawg nrog cov lus txib sudo apt-tau hloov kho

DOWNLOAD SAMPLE CODE

f) Hauv lub davhlau ya nyob twg khiav cov lus txib hauv qab no:

cd ~ ib

git clone

Qhov no yuav ntxiv qhov chaw cia ntawm cov qauv piv txwv los ntawm Atlas Scientific rau Raspberry Pi. Tsuas yog tus lej i2c xav tau rau txoj haujlwm no.

I2C kev teeb tsa

g) Nruab thiab qhib lub I2C npav ntawm Raspberry Pi. Khiav cov lus txib hauv qab no:

sudo apt-tau nruab python-smbus

sudo apt-tau nruab i2c-cuab yeej

h) Tom ntej no, qhib lub qhov rai teeb tsa los ntawm kev nkag mus sudo raspi-teeb tsa

Xaiv "Kev xaiv cuam tshuam" (duab 1 saum toj no).

i) Xaiv "I2C" (duab 2 saum toj no).

j) Koj yuav raug nthuav qhia nrog lo lus nug "Koj puas xav kom ARM I2C interface tau qhib?" Xaiv "Yog" (daim duab 3 saum toj no).

k) Ntaus "Ok" (duab 4 saum toj no). Tom qab ntawd reboot Pi nrog hais kom ua sudo reboot

Kauj Ruam 3: Teem SENSORS rau I2C MODE

Tentacle T3 ntaub thaiv npog yog I2C sib xws nkaus xwb. Xws li EZO sensor yuav tsum nyob hauv I2C thiab tsis yog UART hom. Yog tias koj muaj ntau yam ntawm tib lub ntsuas (piv txwv li 2 pH) nco ntsoov muab qhov tshwj xeeb I2C chaw nyob rau txhua tus. Kev ua tsis tiav yuav ua rau muaj kev sib cav sib ceg.

Txog cov lus qhia yuav hloov pauv ntawm cov kev cai thiab muab I2C chaw nyob, xa mus rau qhov txuas hauv qab no.

Kauj Ruam 4: MOUNT SHIELD thiab SENSORS rau RASPBERRY PI

MOUNT SHIELD thiab SENSORS rau RASPBERRY PI
MOUNT SHIELD thiab SENSORS rau RASPBERRY PI
MOUNT SHIELD thiab SENSORS rau RASPBERRY PI
MOUNT SHIELD thiab SENSORS rau RASPBERRY PI
MOUNT SHIELD thiab SENSORS rau RASPBERRY PI
MOUNT SHIELD thiab SENSORS rau RASPBERRY PI

a) Xyuas kom lub zog rau Raspberry Pi raug tua.

b) Mount lub tsev pheeb suab ntaub tiv thaiv tus pin ntawm tus Pi.

c) Ntxig rau EZO cov kab hluav taws xob mus rau daim ntaub thaiv. Nco ntsoov kom phim cov pins kom raug.

d) Txuas cov kev soj ntsuam mus rau tus poj niam BNC txuas ntawm daim ntaub thaiv.

Kauj Ruam 5: TEST SETUP

TEST SETUP
TEST SETUP

a) Qhib lub zog rau Pi.

b) Qhib lub davhlau ya nyob twg thiab nkag mus sudo i2cdetect -y 1

Qhov kev zov me nyuam yuav tshaj tawm cov ntaub ntawv hais txog txhua qhov khoom siv I2C txuas nrog. Duab 5 saum toj no muab ua piv txwv. Cov sawv cev hex ntawm I2C chaw nyob tau qhia. (yaj oxygen = 0x61, pH = 0x63, kub = 0x66)

Kauj Ruam 6: Saib xyuas kev nyeem ntawv thiab cuam tshuam nrog lub ntsej muag

MONITOR nyeem thiab cuam tshuam nrog SENSORS
MONITOR nyeem thiab cuam tshuam nrog SENSORS
MONITOR nyeem thiab cuam tshuam nrog SENSORS
MONITOR nyeem thiab cuam tshuam nrog SENSORS
MONITOR nyeem thiab cuam tshuam nrog SENSORS
MONITOR nyeem thiab cuam tshuam nrog SENSORS
MONITOR nyeem thiab cuam tshuam nrog SENSORS
MONITOR nyeem thiab cuam tshuam nrog SENSORS

a) Qhib cov npe uas muaj cov qauv piv txwv cd ~/Raspberry-Pi-sample-code

b) Khiav I2C tsab ntawv sudo nab hab sej i2c.py

Txhua lub sijhawm sau tsab ntawv, tus neeg siv tau nthuav tawm nrog cov ntawv qhia zaub mov qhia hauv piv txwv 1 saum toj no.

Piv txwv 2: Sau qhov chaw nyob ntawm cov ntsuas sib txuas thiab nug txhua tus rau cov ntaub ntawv xov tooj.

Piv txwv 3: Tsis tu ncua ntsuas qhov ntsuas pH

Piv txwv 4: Txheeb xyuas seb lub ntsuas pa oxygen puas tau ntsuas.

Xa mus rau daim ntawv teev cov ntaub ntawv rau txhua cov lus txib tsim nyog. (pH daim ntawv, cov ntawv pov thawj cov pa oxygen, cov ntawv ntsuas kub)

Pom zoo: