Cov txheej txheem:

Hnab Hnab Ntse Nrog Gps Nrhiav thiab Teeb Tsis Siv Neeg: 15 Kauj Ruam
Hnab Hnab Ntse Nrog Gps Nrhiav thiab Teeb Tsis Siv Neeg: 15 Kauj Ruam

Video: Hnab Hnab Ntse Nrog Gps Nrhiav thiab Teeb Tsis Siv Neeg: 15 Kauj Ruam

Video: Hnab Hnab Ntse Nrog Gps Nrhiav thiab Teeb Tsis Siv Neeg: 15 Kauj Ruam
Video: Часы G Shock до 100 долларов-15 лучших часов Casio G Shock до 100 дол... 2024, Hlis ntuj nqeg
Anonim
Hnab Hnab Ntse Nrog Gps Nrhiav thiab Teeb Tsis Siv Neeg
Hnab Hnab Ntse Nrog Gps Nrhiav thiab Teeb Tsis Siv Neeg

Hauv cov lus qhia no peb yuav ua lub hnab ntim ntse uas tuaj yeem taug qab peb txoj haujlwm, nrawm thiab muaj teeb pom kev zoo uas tuaj yeem ua rau peb nyab xeeb thaum hmo ntuj.

Kuv siv 2 lub ntsuas txhawm rau txheeb xyuas yog tias nws nyob ntawm koj lub xub pwg kom paub tseeb tias nws tsis ploj mus thaum nws tsis tas yuav, lub ntsuas ntsuas rub (uas kuv tau ua kuv tus kheej) kom pom tias cov hlua raug rub thiab lub ntsuas ultrasonic uas pom yog tias ib yam dab tsi nyob ze nws sab nraum qab. Tsawg kawg kuv kuj siv LDR los saib seb puas tsaus ntuj lossis pom kev.

Kuj tseem muaj leds sab hauv lub teeb ci thaum koj qhib lub hnab ev kom pom sab hauv. Nws tau tshwm sim los ntawm kev hloov reed uas hloov pauv nrog cov hlau nplaum tsim los ntawm cov hlau nplaum.

GPS module yog siv los taug qab koj txoj haujlwm.

LCD module siv los tso saib tus IP chaw nyob.

Kuv tau tsim lub xaib uas koj tuaj yeem tso rau koj tus raspberry pi uas tso cai rau koj pom txoj hauv kev uas koj tau coj, txuag lawv rau tom qab siv, thiab tswj qee qhov chaw.

Cov lus qhia no TSIS YOG rau cov neeg uas tsis muaj kev txawj ua haujlwm nrog Raspberry pi

Khoom siv

  • Raspberry Pi 3 qauv B+
  • Raspberry PI T-cobbler
  • Hlau (Kuv siv 10 metres koj yuav siv tsawg dua)
  • Resistors 6 x 220 Ohm, 1 x 10k Ohm, 1 x 1k Ohm
  • Trimmer 10k Ohm (Tsis pub twg paub)
  • Hnab ev ntawv
  • Powerbank
  • LDR
  • 4 Leds liab thiab 2 dawb 5mm
  • Ultrasonic Sensor HC-SR04
  • Levelshifter
  • 10 ntsis ADC MCP3008
  • GPS Module nrog tus kav hlau txais xov GY-NEO6Mv2
  • LCD zaub
  • Lub caij nplooj ntoo hlav tuaj yeem txav tau (uas tsis deform)
  • Txoj hlua
  • 1 Hex txiv ntseej (lossis ib yam dab tsi ua los ntawm cov hlau coj nrog lub qhov)
  • Cov yeeb nkab yas (ib ncig 4-3 cm txoj kab uas hla)
  • Cov phaj hlau (uas tuaj yeem npog cov yeeb nkab kawg)
  • Reed swb
  • Cov hlau nplaum me me
  • Nyias MDF/lwm cov ntoo/yas phaj (ncig 5 hli)
  • Phaj tawv ua npuas ncauj (tsawg kawg 2cm tuab)
  • Velcro (rau kev ntim cov khoom ntim rau hauv rooj plaub thiab lub hau. Koj tuaj yeem siv cov kua nplaum hloov yog tias koj xav ua nws mus tas li)
  • 5 Nias studs nrog 5mm qhov nyob hauv nruab nrab rau tus coj, yog tias nws tsawg dua koj tuaj yeem laum nws tom qab.

Rau kev sim ntawm lub khob cij:

  • Breadbord
  • Dhia xov hlau

Cov cuab yeej xav tau:

  • Soldering hlau
  • Kub kua nplaum phom
  • Pom
  • Txiab
  • Riam
  • Koob thiab xov
  • Laum (Yog xav tau saib qib 10)

koj tuaj yeem pom daim ntawv teev npe tiav ntawm kev tsim cov khoom nrog tus nqi hauv daim ntawv txuas nrog

Kauj Ruam 1: Tsim Circuit Court ntawm Breadboard

Tsim Circuit Court ntawm Breadboard
Tsim Circuit Court ntawm Breadboard

Txuas txhua yam zoo li ntawm schematic saum toj no

Kuj tseem muaj daim ntawv pdf txuas nrog yog li koj tuaj yeem nthuav dav cov phiaj xwm.

Kauj Ruam 2: Tsim Cov Ntes Rub

Tsim lub Rub Ntes
Tsim lub Rub Ntes
Tsim lub Rub Ntes
Tsim lub Rub Ntes
Tsim lub Rub Ntes
Tsim lub Rub Ntes

Thawj zaug siv lub caij nplooj ntoo hlav los ntawm txoj hlua thiab kua nplaum/khi lawv rau ib leeg.

Tom qab ntawd nqa cov txiv ntoo thiab kua nplaum nws tsuas yog nyob rau lub caij nplooj ntoo hlav. (Kuv siv cov hlau me me ntawm cov yeeb nkab hloov cov txiv ntoo).

Tom qab ntawd muab cov xaim txuas rau sab hauv qab ntawm cov txiv ntoo (sab qhov twg yog lub caij nplooj ntoo hlav).

Tom qab ntawd lo cov phaj hlau, lub caij nplooj ntoo hlav thiab cov xaim mus rau ib sab ntawm cov yeeb nkab. (xyuas kom cov hlau muaj qhov ntev txaus sab hauv rau lub caij nplooj ntoo hlav ncab mus rau lwm sab ntawm cov yeeb nkab).

Tom qab ntawd lo cov phaj hlau mus rau cov yeeb nkab ntawm lwm sab zoo li ntawm daim duab, xyuas kom cov hlua tawm ntawm cov yeeb nkab kom koj tuaj yeem rub nws.

Thaum kawg muab xaim rau lub phaj uas cov txiv ntoo tsoo thaum rub.

Thaum kawg koj tuaj yeem ntsuas nws nrog lub ntsuas cua yog tias lub kaw lus kaw ntawm ob lub xov hlau thaum koj rub txoj hlua.

Kauj Ruam 3: Txuas lub Rub Ntes

Txuas lub Rub Ntes
Txuas lub Rub Ntes

Txuas ib kawg ntawm lub ntsuas ntsuas rub mus rau tus pin GPIO 18 nrog 1K Ohm resistor ntawm.

Txuas lwm qhov kawg rau GND.

Kauj Ruam 4: Pab kom Serial thiab SPI hauv Raspi-teeb tsa

Pab kom Serial thiab SPI hauv Raspi-teeb tsa
Pab kom Serial thiab SPI hauv Raspi-teeb tsa
  1. Qhib koj lub Raspberry pi davhlau ya nyob twg thiab ntaus hauv: sudo raspi-config
  2. Nkag mus nrog cov yuam sij xub mus rau Kev Xaiv Ua Haujlwm, ntaus Enter
  3. Xaiv Serial
  4. Koj yuav tau txais: "Koj puas xav kom lub plhaub nkag mus kom nkag mus tau ntau dua?" Ntaus Tsis
  5. "Koj puas xav kom lub khoos phis tawj chaw nres nkoj txuas kom qhib?" Ntaus YES
  6. "Koj puas xav rov pib dua tam sim no?" Ntaus "TSIS"
  7. Rov mus dua rau Kev Xaiv Ua Haujlwm
  8. Xaiv SPI
  9. "Koj puas xav kom SPI interface raug qhib?" Ntaus YES
  10. Rov pib dua

Kauj ruam 5: Database

Database
Database

Ua ntej peb yuav nruab cov software software uas peb xav tau.

Qhib koj lub rpi davhlau ya nyob twg thiab ntaus hauv:

sudo apt-tau hloov tshiab

sudo apt-tau nruab mysql-server-kho-ploj –y> sudo reboot

Tos kom txog thaum koj rpi rov pib dua, tom qab ntawv nkag mus thiab ntaus cov kab ntawd

sudo mysql_secure_installation

Sau tus password tam sim no rau hauv paus (nkag rau tsis muaj): hauv paus Hloov tus lej zais hauv paus? [Y/n] Y lo lus zais tshiab: root123 Tshem cov neeg siv tsis qhia npe? [Y/n] y Disallow root login remotely? [Y/n] y Tshem tawm cov ntawv xeem thiab nkag mus rau nws? [Y/n] y Rov qab muaj lub rooj tshwj xeeb tam sim no? [Y/n] y

Peb tseem yuav ua tus neeg siv hu ua 'mct' nrog tus password 'mct'.

sudo mysql -u hauv paus

MariaDB [(tsis muaj)]> ZOO TSHAJ PLAWS YOOJ YIM RAU*.* TO 'mct'@'%' IDENTIFIED BY 'mct' NROG QHOV TSEEB; MariaDB [(tsis muaj)]> KEV NYUAJ SIAB NTAWV; MariaDB [(tsis muaj)]> Tawm;

Tam sim no peb yuav ntshuam cov qauv ntaub ntawv

Koj yuav tsum rub tawm cov ntawv txuas thiab xa nws mus rau tus neeg siv nplaub tshev/tsev // ntawm koj li rpi siv FTP/SFTP.

Tom qab ntawd ntaus cov kab hauv qab no:

mysql -u hauv paus -p

mysql> Tsim DATABASE Smartpack; Tam sim no tawm ntawm lub plhaub sql los ntawm nias CTRL + D> mysql -u mct -p Smartpack </home//data-dump.sql> sudo reboot

Tom qab koj rpi rov pib dua cov ntaub ntawv yuav tsum tau nce thiab khiav

Kauj Ruam 6: Xeem

Ua ntej peb yuav xav tau nruab apache webserver

Ntaus cov cai hauv qab no rau hauv davhlau ya nyob twg:

sudo apt -tau nruab apache2 -y

sudo rov pib dua

Tam sim no theej cov ntaub ntawv los ntawm phau ntawv teev npe ntawm yav dhau los ntawm github repository rau hauv/var/www/html/directory ntawm koj rpi.

Tom qab ntawd theej tag nrho cov ntaub ntawv los ntawm BACK directory ntawm Github repository rau hauv cov neeg siv hauv zos nplaub tshev ntawm koj rpi/home // smartpack

Yog tias koj siv tus lej sib txawv ntau dua li hauv cov txheej txheem, koj yuav tsum tau kho lawv hauv /home//smartpack/main.py, lawv tau teev tseg saum toj no hauv daim ntawv.

Tam sim no qhib davhlau ya nyob twg thiab khiav cov ntawv

python3.5 /home/username/smartpack/main.py

Koj tuaj yeem nthwv mus rau tus ip uas yuav tshwm rau ntawm lub vijtsam lcd txhawm rau nkag mus rau lub vev xaib peb nyuam qhuav teeb tsa.

Xyuas kom txhua yam ua haujlwm tau zoo ua ntej mus rau qib tom ntej!

Kauj Ruam 7: Tsim Vaj Tsev rau Cov Khoom Siv Hluav Taws Xob

Tsim Ib Lub Tsev rau Cov Khoom Siv Hluav Taws Xob
Tsim Ib Lub Tsev rau Cov Khoom Siv Hluav Taws Xob
Tsim Ib Lub Tsev rau Cov Khoom Siv Hluav Taws Xob
Tsim Ib Lub Tsev rau Cov Khoom Siv Hluav Taws Xob
Tsim Ib Lub Tsev rau Cov Khoom Siv Hluav Taws Xob
Tsim Ib Lub Tsev rau Cov Khoom Siv Hluav Taws Xob
Tsim Ib Lub Tsev rau Cov Khoom Siv Hluav Taws Xob
Tsim Ib Lub Tsev rau Cov Khoom Siv Hluav Taws Xob

Peb yuav ua rooj plaub rau peb rpi, powerbank thiab qee yam khoom siv hluav taws xob.

Kuv txhawb koj kom ua koj tus kheej cov ntaub ntawv ntawm rooj plaub vim tias kuv tsis zoo ntawm kev ua cov khoom ntawd

  1. Txiav koj cov yas/ntoo phaj rau hauv 2 daim ntsuas 29 cm x 15, 5 cm (Nco ntsoov tias qhov ntev tshaj plaws haum rau hauv koj lub hnab ev khoom)
  2. Txiav 2 daim tawv tawv ntsuas 29 cm x 3 cm thiab 2 daim ntxiv ntsuas 9.5 cm x 3cm
  3. Muab cov nplaum tso rau ntawm ib sab phaj.
  4. Tom qab nws ua tiav txiav lub qhov zoo li ntawm daim duab: Koj yuav tsum ntsuas koj tus kheej li cas qhov dav yuav tsum yog. Lub qhov hauv qab yog rau Ultrasonic sensor, thiab sab saum toj loj yog rau cov hlua.

Kauj Ruam 8: Txhuam Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables

Luag Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables
Luag Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables
Luag Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables
Luag Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables
Luag Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables
Luag Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables
Luag Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables
Luag Txhua Yam Nrog Cov Hluav Taws Xob Tsis txhob dhia Cables

Luag txhua yam nrog cov xov hlau ib txwm tsuas yog ob qho dawb thiab liab leds, LDR thiab reed hloov.

Koj tuaj yeem siv lub thawv ntawv rau qee yam xws li IC's, tab sis kuv tus kheej tsis pom zoo nws.

GPS thiab LCD cov qauv yuav tsum nkag mus rau hauv lub qhov peb txiav rau lawv hauv cov kauj ruam dhau los.

Nco ntsoov siv kev rho tawm txhua qhov vim tias luv luv tuaj yeem tsoo koj li Rpi.

Kauj Ruam 9: Hlawv Qhov rau Leds thiab Ultrasonic Sensor

Hlawv Qhov rau Leds thiab Ultrasonic Sensor
Hlawv Qhov rau Leds thiab Ultrasonic Sensor
Hlawv Qhov rau Leds thiab Ultrasonic Sensor
Hlawv Qhov rau Leds thiab Ultrasonic Sensor

Hlawv? Yog! Hlawv

Peb yuav siv cov hlau txuas los hlawv peb lub qhov. Qhov no vim tias hnab ev khoom feem ntau tsis muaj dej, uas txhais tau tias cov khoom uas lawv tau ua yog yas lossis roj hmab. Yog li yog tias peb hlawv nws tsis txhob txiav, cov npoo ntawm peb lub qhov yuav zoo yaj thiab nrog qhov ntawd nws yuav tsis tshua muaj kua muag.

Hlawv 4 lub qhov me me nyob qhov twg koj xav tau rau lub leds liab tsis siv neeg. Xyuas kom lawv nyob hauv txoj haujlwm pom. (Muaj twb tau nias lub pob hauv lub qhov ntawm daim duab saum toj no)

Kuj tseem hlawv lub qhov rau lub ntsuas hluav taws xob ultrasonic nyob hauv qab ntawm lub hnab ev ntawv, ntawm sab uas tawm sab nraub qaum mus thiab lub qhov me me nyob ib sab ntawm nws rau txoj hlua uas tawm ntawm

Thaum kawg hlawv lub qhov rau cov hlua uas yuav mus rau ntu tseem ceeb ntawm koj lub hnab ev khoom, ua nws tsuas yog saum lub qhov peb tau ua rau cov hlua hauv tsev yog tias koj yuav muab tso rau hauv lub hnab.

Kauj Ruam 10: Muab Nias Studs Los Ntawm Lub Qhov thiab Cov Nplaum Leds

Muab Nias Studs Los Ntawm Lub Qhov thiab Cov Kua Leds
Muab Nias Studs Los Ntawm Lub Qhov thiab Cov Kua Leds
Muab Nias Studs Los Ntawm Lub Qhov thiab Cov Kua Leds
Muab Nias Studs Los Ntawm Lub Qhov thiab Cov Kua Leds

Xyuas kom tseeb tias lub qhov nyob rau hauv cov studs yog 5mm !! yog tias tsis yog koj tuaj yeem sim thiab laum lawv nrog 5mm laum.

Thawb cov xovxwm txuas mus rau 4 qhov koj tau hlawv thiab nyem lawv ua ke.

Muab 4 leds tso rau hauv cov xovxwm thiab muab lo rau lawv, xyuas kom tseeb tias cov hlau tsis tau kov lub pob.

Kauj ruam 11: Reed Hloov

Reed Hloov
Reed Hloov
Reed Hloov
Reed Hloov

Reed cov hloov pauv tau yooj yim heev, yog li kuv tau muab kuv tso rau hauv lub raj yas thiab lub raj yas dua hauv cov raj hlau, thiab tom qab ntawd kuv tau kaw txhua yam nrog kua nplaum.

Koj yuav ua li cas nws yog nyob ntawm koj, tab sis kuv pom zoo kom ua qee yam rau nws kom nws tsis tawg.

Yog tias ua tiav txhua yam rau saum toj ntawm ntu tseem ceeb ntawm lub hnab ev ntawv. Ib sab ntawm nws, nyob rau lwm sab ntawm lub zipper lo lub zog muaj zog txaus yog li nws yuav hloov thaum koj qhib nws. Kuv tau tso kuv li ntawm txheej sab hauv thiab sab nrauv ntawm cov ntaub ntawv yog li nws tsis pom.

Kauj Ruam 12: Kaw Cov Leds Dawb Sab Hauv Lub Hnab

Kua nplaum Dawb Leds Sab Hauv Lub Hnab
Kua nplaum Dawb Leds Sab Hauv Lub Hnab
Kua nplaum Dawb Leds Sab Hauv Lub Hnab
Kua nplaum Dawb Leds Sab Hauv Lub Hnab

Kua nplaum rau lawv kom lawv pom kev sab hauv thaum nyob.

Koj tuaj yeem xaiv qhov twg muab tso rau lawv, tab sis hauv kuv lub tswv yim qhov chaw zoo tshaj yog nyob rau saum cov ntawv mus rau lub laj kab hloov.

Kauj Ruam 13: Kaw Lub Tsev thiab Muab Sab Hauv Hnab

Kaw lub tsev thiab muab tso rau hauv lub hnab
Kaw lub tsev thiab muab tso rau hauv lub hnab
Kaw lub tsev thiab muab tso rau hauv lub hnab
Kaw lub tsev thiab muab tso rau hauv lub hnab

Ua ntej koj lo nws kaw kom paub tseeb tias nws tseem ua haujlwm raug.

Tom qab ntawd muab cov kua nplaum kaw rau ntawm qhov seem ntawm lub tsev, saib xyuas cov kab hluav taws xob uas yuav tau nruab nrab ntawm lub phaj thiab sab ntawm lub tsev, nws nyuaj heev los lo nws yam tsis muaj cov kab hluav taws xob nyob nruab nrab ntawm nws.

Tom qab ntawd muab nws tso rau hauv koj lub hnab ev ntawv, kom paub tseeb tias lub ntsuas hluav taws xob ultrasonic tau ntsib lub qhov uas peb tau ua yav dhau los.

Koj yuav zaum xav tau kom ruaj ntseg lub tsev nyob ib puag ncig lub ntsuas cua ultrasonic mus rau lub hnab ev ntawv yog li nws yuav tsis npog nws.

Kauj Ruam 14: Kho Rc.local los Khiav Tsab Ntawv ntawm Kev Pib

Qhib lub davhlau ya nyob twg thiab ntaus hauv:

sudo nano /etc/rc.local

ntxiv cov kab hauv qab no thaum kawg, tsuas yog saum toj no tawm 0

nab hab sej 3.5 /home//Smartpack/main.py &

nias CTRL + X thiab 2x Enter

Tam sim no tsab ntawv yuav pib ntawm khau raj.

Kauj Ruam 15: Tiav Touches

Tiav Touches
Tiav Touches
Tiav Touches
Tiav Touches

Koj tuaj yeem xaws tag nrho cov kab txuas ua ke thiab tseem rau lub hnab ev ntawv nrog rab koob thiab xov.

Koj tseem tuaj yeem ua lub npog rau cov leds liab los ntawm ib daim tawv/textile.

Pom zoo: