Cov txheej txheem:
- Kauj Ruam 1: Khoos Phis Tawj Peb Xav Tau
- Kauj Ruam 2: Txuas Cov Khoom Kho Vajtse
- Kauj Ruam 3: Python Coding rau Raspberry Pi
- Kauj Ruam 4: Txoj Cai Siv Txoj Cai
- Kauj Ruam 5: Cov ntawv thov thiab Nta
- Kauj Ruam 6: Xaus
Video: Saib Xyuas Kev Siv Sijhawm Siv Raspberry Pi thiab AIS328DQTR Siv Python: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Kev nrawm yog qhov kawg, Kuv xav raws li qee txoj cai ntawm Physics.- Terry Riley
Tus cheetah siv qhov ua kom nrawm nrawm thiab hloov pauv nrawm thaum caum. Tus tsiaj nrawm tshaj plaws nyob ntawm ntug hiav txwv ib zaug hauv ib lub sijhawm siv nws qhov nrawm tshaj plaws kom ntes tau cov tsiaj txhu. Cov tsiaj tau txais qhov nrawm dua los ntawm kev siv yuav luag tsib lub zog ntau dua li ntawm Usain Bolt thaum nws cov ntaub ntawv-tsoo 100m khiav.
Hauv lub sijhawm tam sim no, tib neeg tsis tuaj yeem xav txog lawv lub neej yam tsis muaj kev hloov pauv tshiab. Nyob ib puag ncig peb cov kev hloov pauv tshiab sib txawv yog pab tib neeg kom ua raws lawv lub neej nrog ntau qhov tsis txaus ntseeg. Raspberry Pi, lub mini, ib lub rooj tsavxwm Linux PC, muab lub hauv paus pheej yig thiab hwm rau cov khoom siv hluav taws xob thiab kev nce qib zoo li IoT, Lub Nroog Ntse, thiab Tsev Kawm Ntawv Kev Kawm. Raws li lub khoos phis tawj thiab cov khoom siv kiv cua, peb tau ua qhov ntsuas ntau nrog Raspberry Pi thiab xaiv los sib xyaw peb cov kev nyiam. Yog li cov txiaj ntsig tau tuaj yeem ua dab tsi uas peb tuaj yeem ua yog tias peb muaj Raspberry Pi thiab 3-axis Accelerometer nyob ze? Hauv txoj haujlwm no, peb yuav suav nrog AIS328DQTR, digital 3-axis MEMS linear accelerometer sensor, txhawm rau ntsuas nrawm hauv 3 cov lus qhia, X, Y, thiab Z, nrog Raspberry Pi siv Python. Qhov ntawd tsim nyog saib mus rau hauv.
Kauj Ruam 1: Khoos Phis Tawj Peb Xav Tau
Cov teeb meem tau tsawg dua rau peb vim peb muaj qhov ntsuas loj ntawm cov khoom ib puag ncig los ua haujlwm los ntawm. Txawm li cas los xij, peb paub tias nws muaj teeb meem li cas rau lwm tus kom tso tseg txoj cai hauv lub sijhawm zoo los ntawm qhov chaw muaj zog thiab uas tau tiv thaiv kev them nyiaj ceeb toom me ntsis rau txhua npib. Yog li peb yuav pab koj.
1. Raspberry Pi
Thawj kauj ruam tau txais Raspberry Pi board. Raspberry Pi yog pawg thawj coj saib xyuas Linux raws PC. Lub PC me me no tau ntim rau hauv kev sau npe lub zog, siv ua ib qho ntawm cov khoom siv hluav taws xob, thiab PC ua haujlwm zoo li daim ntawv nthuav dav, ua cov lus, ua haujlwm hauv web, thiab email, thiab ua si. Koj tuaj yeem yuav ib qho ntawm txhua lub tshuab hluav taws xob lossis khw nyiam ua haujlwm.
2. I2C Shield rau Raspberry Pi
Thawj qhov kev txhawj xeeb Raspberry Pi yog qhov tsis tuaj tiag yog I2C chaw nres nkoj. Yog li ntawd, TOUTPI2 I2C txuas ua rau koj nkag siab siv Raspberry Pi nrog ib qho ntawm I2C li. Nws muaj nyob ntawm DCUBE Store
3. 3-Axis accelerometer, AIS328DQTR
Koom nrog STMicroelectronics lub zog ntsuas lub cev, AIS328DQTR yog lub zog qis tshaj plaws ua tau zoo 3-axis linear accelerometer nrog digital serial interface SPI tus qauv tso tawm. Peb tau txais qhov ntsuas no los ntawm DCUBE Store
4. Txuas Cable
Peb tau txais I2C Txuas txuas los ntawm DCUBE Store
5. Micro USB cable
Qhov txaj muag tshaj plaws, tab sis tseem nruj tshaj rau qib kev xav tau yog Raspberry Pi! Txoj hauv kev yooj yim tshaj plaws los daws cov phiaj xwm kev ua si yog los ntawm kev siv Micro USB cable. GPIO pins lossis USB chaw nres nkoj tuaj yeem siv tau zoo li muab lub zog txaus.
6. Web Access yog Qhov Xav Tau
Tau txais koj li Raspberry Pi cuam tshuam nrog Ethernet (LAN) cable thiab cuam tshuam nws rau koj lub network. Ntawm qhov tod tes, luam theej duab rau WiFi txuas thiab siv ib qho ntawm USB chaw nres nkoj kom tau mus rau lub network deb. Nws yog qhov kev txiav txim siab ntse, qhov tseem ceeb, me me thiab yooj yim!
7. HDMI Cable/Kev Nkag Mus Rau Tej Chaw
Raspberry Pi muaj qhov chaw nres nkoj HDMI uas koj tuaj yeem cuam tshuam tshwj xeeb rau Saib lossis TV nrog HDMI cable. Xaiv, koj tuaj yeem siv SSH coj los nrog koj li Raspberry Pi los ntawm Linux PC lossis Macintosh los ntawm lub davhlau ya nyob twg. Tsis tas li, PuTTY, pub dawb thiab qhib-qhov davhlau ya nyob twg emulator suab zoo li tsis yog txhua qhov kev xaiv tsis zoo.
Kauj Ruam 2: Txuas Cov Khoom Kho Vajtse
Ua kom lub Circuit Court raws li qhia los ntawm schematic tau tshwm sim. Hauv kab ntawv, koj yuav pom ntau qhov chaw, lub zog tawg, thiab I2C sensor.
Raspberry Pi thiab I2C Shield Txuas
Qhov tseem ceeb tshaj plaws ntxiv, coj Raspberry Pi thiab pom I2C Shield rau nws. Nias lub Shield ua tib zoo hla GPIO pins ntawm Pi thiab peb tau ua tiav nrog cov kauj ruam no ncaj qha raws li ncuav qab zib (saib qhov snap).
Raspberry Pi thiab Kev Sib Txuas Sensor
Coj lub sensor thiab cuam tshuam nrog I2C cable nrog nws. Txog qhov tsim nyog ua haujlwm ntawm cov kab no, thov tshuaj xyuas I2C Cov Zais Tawm Ib txwm siv nrog I2C Kev Tawm Tswv Yim. Ib yam yuav tsum tau ua tom qab rau Raspberry Pi nrog I2C daim ntaub thaiv npog hla GPIO pins.
Peb txhawb kom siv I2C cable raws li nws tsis pom zoo qhov yuav tsum tau txhawm rau txhawm rau txhawm rau pinouts, nyab xeeb, thiab thab plaub ua tiav los ntawm kev txaj muag tshaj plaws. Nrog qhov kev koom tes tseem ceeb thiab ua si cable, koj tuaj yeem nthuav qhia, pauv qhov tsis sib haum, lossis ntxiv ntau yam khoom siv rau hauv daim ntawv thov uas tsim nyog. Qhov no txhawb nqa qhov hnyav ua haujlwm mus txog qib siab.
Nco tseg: Cov xaim xim av yuav tsum tau ua raws li hauv av (GND) kev sib txuas ntawm cov khoom siv ntawm ib lub cuab yeej thiab cov tswv yim ntawm lwm lub cuab yeej
Web Network yog Qhov Tseem Ceeb
Txhawm rau kom peb qhov kev sim yeej, peb xav tau Web txuas rau peb Raspberry Pi. Txog qhov no, koj muaj kev xaiv zoo li cuam tshuam Ethernet (LAN) koom nrog hauv tsev network. Ntxiv mus, raws li kev xaiv, chav kawm txaus siab yog siv WiFi USB txuas. Feem ntau hais lus rau qhov no, koj xav tau tus tsav tsheb kom nws ua haujlwm. Yog li cia siab rau ib qho nrog Linux hauv kev piav qhia.
Hwj chim Mov
Txuas lub Micro USB cable rau hauv lub hwj chim nkaus ntawm Raspberry Pi. Xuas nrig thiab peb npaj txhij.
Kev Sib Txuas rau Screen
Peb tuaj yeem txuas HDMI cable txuas nrog lwm Tus Saib Xyuas. Qee zaum, koj yuav tsum tau mus rau Raspberry Pi yam tsis cuam tshuam nws mus rau lub vijtsam lossis koj yuav xav tau saib cov ntaub ntawv los ntawm nws los ntawm lwm qhov. Muaj peev xwm, muaj tswv yim thiab fiscally txoj hauv kev los daws nrog ua txhua yam uas tau txiav txim siab. Ib ntawm lawv yog siv - SSH (cov chaw taws teeb hais kom ua kab nkag). Koj kuj tseem tuaj yeem siv PuTTY software rau qhov ntawd.
Kauj Ruam 3: Python Coding rau Raspberry Pi
Koj tuaj yeem saib Python Code rau Raspberry Pi thiab AIS328DQTR Sensor hauv peb Github Chaw Tso Khoom.
Ua ntej txuas mus rau txoj cai, xyuas kom koj nyeem cov cai tau muab hauv Readme cov ntawv khaws tseg thiab teeb tsa koj li Raspberry Pi raws li nws. Nws yuav cia li so rau ib pliag kom ua txhua yam xav tau.
Tus ntsuas hluav taws xob yog lub tshuab hluav taws xob siv hluav taws xob uas yuav ntsuas lub zog nrawm. Cov hwj huam no tej zaum yuav zoo li qub, zoo ib yam li lub zog nqus ntawm koj ob txhais taw, lossis lawv tuaj yeem hloov pauv tau - coj los ntawm kev txav lossis ua kom lub nrawm nrawm.
Kev mus nrog yog tus nab npawb nab npawb thiab koj tuaj yeem clone thiab hloov cov cai hauv txhua txoj hauv kev uas koj nkag mus.
# Faib nrog daim ntawv tso cai yuav dawb.# Siv nws txhua txoj hauv kev koj xav tau, muaj txiaj ntsig lossis pub dawb, muab nws haum rau hauv daim ntawv tso cai ntawm nws cov haujlwm ua haujlwm. # AIS328DQTR # Cov lej no tau tsim los ua haujlwm nrog AIS328DQTR_I2CS I2C Mini Module muaj los ntawm dcubestore.com # https://dcubestore.com/product/ais328dqtr-high-performance-ultra-low-power-3-axis-accelerometer-with -digital-output-for-automotive-applications-i%C2%B2c-mini-module/
ntshuam smbus
lub sij hawm ntshuam
# Tau I2C npav
npav = smbus. SMBus (1)
# AIS328DQTR chaw nyob, 0x18 (24)
# Xaiv tswj kev sau npe 1, 0x20 (32) # 0x27 (39) Hwj chim ON hom, Cov ntaub ntawv xaiv tus nqi = 50Hz # X, Y, Z-Axis tau qhib bus.write_byte_data (0x18, 0x20, 0x27) # AIS328DQTR chaw nyob, 0x18 (24) # Xaiv tswj kev sau npe 4, 0x23 (35) # 0x30 (48) Hloov tshiab tas li, Kev xaiv tag nrho = +/- 8G npav.write_byte_data (0x18, 0x23, 0x30)
sijhawm.s pw (0.5)
# AIS328DQTR chaw nyob, 0x18 (24)
# Nyeem cov ntaub ntawv rov qab los ntawm 0x28 (40), 2 bytes # X-Axis LSB, X-Axis MSB data0 = bus.read_byte_data (0x18, 0x28) data1 = bus.read_byte_data (0x18, 0x29)
# Hloov cov ntaub ntawv
xAccl = data1 * 256 + data0 yog xAccl> 32767: xAccl -= 65536
# AIS328DQTR chaw nyob, 0x18 (24)
# Nyeem cov ntaub ntawv rov qab los ntawm 0x2A (42), 2 bytes # Y-Axis LSB, Y-Axis MSB data0 = bus.read_byte_data (0x18, 0x2A) data1 = bus.read_byte_data (0x18, 0x2B)
# Hloov cov ntaub ntawv
yAccl = data1 * 256 + data0 yog yAccl> 32767: yAccl -= 65536
# AIS328DQTR chaw nyob, 0x18 (24)
# Nyeem cov ntaub ntawv rov qab los ntawm 0x2C (44), 2 bytes # Z-Axis LSB, Z-Axis MSB data0 = bus.read_byte_data (0x18, 0x2C) data1 = bus.read_byte_data (0x18, 0x2D)
# Hloov cov ntaub ntawv
zAccl = data1 * 256 + data0 yog zAccl> 32767: zAccl -= 65536
# Cov ntaub ntawv tso tawm rau lub vijtsam
luam "Ua kom nrawm hauv X-Axis: %d" %xAccl luam "Ua kom nrawm hauv Y-Axis: %d" %yAccl luam "Ua kom nrawm hauv Z-Axis: %d" %zAccl
Kauj Ruam 4: Txoj Cai Siv Txoj Cai
Rub tawm (lossis git rub) cov cai los ntawm Github thiab qhib nws hauv Raspberry Pi.
Khiav cov lus txib kom sau thiab xa cov cai hauv lub davhlau ya nyob twg thiab pom cov txiaj ntsig ntawm Screen. Ua raws li ob peb feeb, nws yuav nthuav tawm txhua qhov ntawm qhov ntsuas. Tom qab lees tias txhua yam ua haujlwm tau yooj yim, koj tuaj yeem siv qhov kev nqis peev no txhua hnub lossis ua qhov kev nqis peev no me ntsis ntawm txoj haujlwm ntau dua. Xijpeem koj xav tau koj tam sim no muaj ib qho kev txwv ntau ntxiv hauv koj qhov kev tsub nqi.
Kauj Ruam 5: Cov ntawv thov thiab Nta
Tsim los ntawm STMicroelectronics, ultra compact low-power high performance 3 axes linear accelerometer teej tug mus rau cov lus tsa suab sensor. AIS328DQTR yog qhov tsim nyog rau kev siv xws li Telematics thiab Cov Thawv Dub, Hauv-Tsheb Tsheb Qhia, Kev Ntsuas / Kev Ntsuas Ntsuas, Kev Tiv Thaiv Tub Sab, Kev Txawj Ntse Txuag Txiaj Ntsig, Kev Pom Kev Nkag Mus thiab Kev Them Nqi thiab Kev Ua Haujlwm.
Kauj Ruam 6: Xaus
Yog tias koj tau xav txog txhawm rau tshawb xyuas lub ntiaj teb ntawm Raspberry Pi thiab I2C cov cim, tom qab ntawd koj tuaj yeem ua rau koj tus kheej poob siab los ntawm kev siv kho vajtse pib, coding, teeb tsa, tso cai, thiab lwm yam Hauv txoj hauv kev no, tej zaum yuav muaj ob peb txoj haujlwm uas yuav yog qhov ncaj, thaum qee qhov yuav sim koj, txav koj mus. Hauv txhua qhov xwm txheej, koj tuaj yeem ua txoj hauv kev thiab tsis muaj qhov tsis zoo los ntawm kev hloov pauv thiab tsim kev tsim ntawm koj li.
Piv txwv li, Koj tuaj yeem pib nrog kev xav ntawm Tus Cwj Pwm Tracker Prototype los tshuaj xyuas thiab piav qhia txog kev txav lub cev thiab lub cev ntawm cov tsiaj nrog AIS328DQTR thiab Raspberry Pi siv Python. Hauv txoj haujlwm saum toj no, peb tau siv cov kev suav sau tseem ceeb ntawm lub ntsuas cua. Cov txheej txheem yog los tsim cov txheej txheem ntawm kev ntsuas nrawm nrog rau ib qho Gyrometer thiab GPS, thiab kev saib xyuas (tshuab) kev kawm paub daws teeb meem (txhawb nqa lub tshuab vector (SVM)) rau kev coj tus cwj pwm zoo ntawm tus tsiaj. Qhov no yuav tsum ua raws los ntawm kev sau cov ntsuas ntsuas sib luag thiab ntsuas qhov ntsuas los ntawm kev siv kev txhawb nqa tshuab tshuab (SVM) kev faib tawm. Siv qhov sib txawv ua ke ntawm kev ntsuas ywj pheej (zaum, taug kev lossis khiav) rau kev qhia thiab siv tau los txiav txim siab qhov muaj zog ntawm cov qauv. Peb yuav sim ua qhov kev ua haujlwm ntawm cov qauv no sai dua li tom qab, kev teeb tsa, cov cai, thiab qauv ua haujlwm rau ntau tus cwj pwm. Peb ntseeg tias koj txhua tus nyiam nws!
Txhawm rau kom koj xis nyob, peb muaj cov vis dis aus ntxim nyiam hauv YouTube uas tuaj yeem pab koj tshuaj xyuas. Ntseeg qhov kev sim siab no txhawb nqa kev tshawb fawb ntxiv. Pib qhov twg koj nyob. Siv qhov koj muaj. Ua li koj ua tau.
Pom zoo:
IoT Raws Li Cov Av Ntub Dej Kev Saib Xyuas thiab Tswj Kev Siv NodeMCU: 6 Cov Kauj Ruam
IoT Raws Li Kev Saib Xyuas Av Qaum thiab Kev Tswj Xyuas Kev Siv NodeMCU: Hauv qhov kev qhia no peb tab tom yuav siv IoT raws li Kev Nyab Xeeb Kev Nyab Xeeb Av thiab Kev Tswj Xyuas siv ESP8266 WiFi Module piv txwv li NodeMCU. INR) Relay Module- Amazon (130/- INR
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
Kev Saib Xyuas Kev Noj Qab Haus Huv Ntawm Cov Txheej Txheem Hauv Tib Neeg Siv Wireless Kev Ruaj Ntseg Sensors: 8 Cov Kauj Ruam
Kev Saib Xyuas Kev Noj Qab Haus Huv Ntawm Cov Txheej Txheem Hauv Tsev Siv Wireless Kev Ruaj Ntseg: Qhov tsis zoo ntawm lub tsev qub thiab kev tsim kho pej xeem tuaj yeem ua rau tuag taus thiab xwm txheej txaus ntshai. Kev saib xyuas tas li ntawm cov qauv no yog qhov yuav tsum tau ua. Kev saib xyuas kev noj qab haus huv hauv tsev yog ib txoj hauv kev tseem ceeb heev hauv kev ntsuas
Kev Saib Xyuas Cog thiab Kev Ceeb Toom Nrog ESP8266 thiab AskSensors IoT Huab: 6 Cov Kauj Ruam
Kev Saib Xyuas Cov Cog thiab Kev Ceeb Toom Nrog ESP8266 thiab AskSensors IoT Cloud: Txoj haujlwm no muaj lub hom phiaj txhawm rau txhim kho cov txheej txheem cog cog ntse siv ESP8266 thiab AskSensors IoT Platform. uas pab ua kom dej nyab
Kev Nyuaj Siab: Kev Saib Xyuas thiab Saib Xyuas Ntxiv rau Kev Teeb Meem: 9 Cov Kauj Ruam
Hard Drive: Kev Saib Xyuas thiab Kev Saib Xyuas Ntxiv Teeb Meem: Daim duab saum toj no yog Hard Drive ib txwm muaj. Cov no yog cov tsav tsheb feem ntau siv niaj hnub no, tab sis tsis tas yuav nrawm tshaj. Tib neeg siv tus tsav no rau nws tus nqi qis dua gigabyte thiab lub neej ntev dua. Phau ntawv qhia no yuav qhia koj txog qhov sib txawv