Cov txheej txheem:

Ua kom tiav Arduino-based Tsheb GPS+GPRS Anti-theft System: 5 Cov Kauj Ruam (nrog Duab)
Ua kom tiav Arduino-based Tsheb GPS+GPRS Anti-theft System: 5 Cov Kauj Ruam (nrog Duab)

Video: Ua kom tiav Arduino-based Tsheb GPS+GPRS Anti-theft System: 5 Cov Kauj Ruam (nrog Duab)

Video: Ua kom tiav Arduino-based Tsheb GPS+GPRS Anti-theft System: 5 Cov Kauj Ruam (nrog Duab)
Video: How I Made this Electric Car that can go Anywhere 2024, Hlis ntuj nqeg
Anonim
Image
Image
Kho vajtse
Kho vajtse

Nyob zoo sawv daws!

Kuv xav tsim kom tiav kev daws teeb meem rau GPS tsheb tiv thaiv tub sab nyiag khoom, uas yuav yog:

pheej yig li sai tau

kom tiav li sai tau

raws li nws-tsuas yog ua haujlwm-tsis muaj-tsis muaj dab tsi-ntxiv-rau-ua raws li ua tau

Yog li kuv xaus kev tsim Arduino-based kev daws teeb meem uas ua rau kuv tag nrho ntawm 25 $, ntau dua lossis tsawg dua.

Raws li koj tuaj yeem pom los ntawm cov vis dis aus, nws tsuas yog ua haujlwm! Koj pib lub tsheb, koj tau txais ntawv ceeb toom ntawm koj lub xov tooj ntawm tes tias lub tsheb tab tom txav mus, tom qab ntawd koj qhib lub mobile app thiab koj tuaj yeem pom lub tsheb txav mus raws sijhawm (nrog 10 vib nas this hloov kho tshiab).

Phau ntawv qhia no yuav coj koj mus txog txhua qib, nco ntsoov muaj ntau lub hauv paus hauv kev daws teeb meem:

1) kho vajtse (raws li Arduino)

2) software (Arduino program)

3) software ntau dua (server-side tau txais qhov chaw GPS)

4) software ntau dua (mobile app)

Cia peb pib..

Kauj ruam 1: Kho vajtse

Kho vajtse
Kho vajtse

Cov npe khoom:

1) Arduino Uno R3 lossis clone. Kuv siv "DCcEle DCcduino uno" clone, uas zoo li tsis muaj ntxiv lawm. Nov yog qhov sib npaug: ntawm Aliexpress - 3.75 $

2) GPS chav rau Arduino (GY-NEO6MV2 GPS tshiab module nrog Kev Tswj Dav Hlau Dav Hlau Tswj EEPROM MWC APM2.5 tus kav hlau loj NEO6MV2). Kuv siv qhov no: ntawm Aliexpress - 6.66 $

3) GPRS / GSM chav rau Arduino (SIM800L V2.0 5V Wireless GSM GPRS MODULE Quad-Band W / Antenna Cable Cap). Kuv siv qhov no: ntawm Aliexpress - 6.71 $

4) Spare dupont cables zoo li no: ntawm Aliexpress - 0.89 $

5) IoT cov ntaub ntawv sim daim npav (lossis lwm daim npav SIM nrog cov ntaub ntawv sib txuas). Kuv siv qhov no: los ntawm Hologram.io. Kuv tau txais tus tsim tawm dawb ib qho, tsuas yog them nqi thauj khoom - 7.50 $

Tag nrho: 25.51 $, tab sis kuv muaj cov cables twb yog li nws tsawg dua 25 $!

Ob daim duab qhia cov khoom ua ntej sib dhos, thiab cov khoom kawg. Cov kev sib txuas koj yuav tsum ua yog:

Arduino - SIM800L

10 - RESET

GND - GND (2 ntawm lawv)

5v -5v

7 - SIM_TXD

8 - SIM_RXD

Arduino-GY-NEO6MV2

GND - NCO

5 v - VCC

3 - RXJ

4 - TXC

Txuas tag nrho cov xov tooj thiab cov kav hlau txais xov thiab xyuas kom koj lub zog nce Arduino los ntawm cov peev txheej uas muaj peev xwm muab rau koj ntawm 2A. Lub khoos phis tawj usb tsis tshua zoo (Kuv tab tom siv MacBook Pro), lub xov tooj them "random" yuav tsis txaus. Feem ntau lub tsheb usb qhov hluav taws xob kuj tseem tsawg dua 1A. Yog tias yog koj li, koj kuj xav tau 12v lub tsheb 5v lub zog xa khoom nrog tsawg kawg 2A.

Ntxig daim npav SIM. Yog tias koj siv Hologram.io sim daim npav, nco ntsoov koj sau npe ntawm lawv lub dashboard thiab qhib daim npav SIM (nws yuav siv ob peb feeb / teev).

Kauj Ruam 2: Software (Arduino Program)

Lub Software (Arduino Program)
Lub Software (Arduino Program)

Kuv yuav xav tias koj tau paub nrog Arduino programming. Txwv tsis pub, thov pib nrog phau ntawv qhia no: ntawm Cov Ntawv Qhia.

Koj tsuas xav tau ib lub tsev qiv ntawv sab nraud, Kuv yuav tsum tau nruab nws manually. Mus ntawm no: TinyGPS, xa cov tsev qiv ntawv, thiab teeb nws hauv koj lub zos Arduino nplaub tshev.

Los ntawm qhov ntawd, peb yuav "nyiag" qee qhov chaws los ntawm lawv cov piv txwv yooj yim, thiab hloov kho nws rau peb lub hom phiaj.

Peb tab tom yuav "nyiag" los ntawm phau ntawv qhia no thiab hloov kho txoj cai ntxiv rau peb lub hom phiaj.

Qhov tshwm sim yog txuas nrog.ino program.

Muaj ob peb yam uas koj tuaj yeem tau thiab YUAV TSHUAJ:

"SECONDS" txhais, thiab "SERVER" txhais.

Kuv tau teeb tsa SECONDS rau 10 thiab ntawm no yog vim li cas: Hologram.io tus tsim tawm program muab rau koj 1mb ntawm cov ntaub ntawv pub dawb hauv ib hlis. Uas txhais tau tias, peb xav kom txo cov bytes xa mus, tab sis kuj peb yuav tsum hloov kho peb txoj haujlwm tsuas yog ntau zaus. Peb tab tom yuav siv tus qauv AT modem cov lus txib kom xa UDP pob ntawv rau peb cov neeg siv khoom tau txais cov lus, nrog lat/lon, txhua tus siv 4 bytes, thiab nrawm siv 1 byte. Yog li tag nrho gps hloov tshiab yog 20 bytes (IP header) ntxiv rau 8 bytes (UDP header) ntxiv rau 9 bytes (them nyiaj). Nws yog 37 bytes. Piv txwv tias kuv lub tsheb ua haujlwm tsis ntau tshaj 2 teev hauv ib hnub, Kuv tuaj yeem them taus qhov hloov tshiab txhua 10 vib nas this thiab siv tsuas yog 806kb ib hlis (31 hnub). Qhov ntawd ua rau kuv 218kb rau lub sijhawm tsav tsheb hla kuv tus kheej, uas yog, tsheb tub sab. Uas muab rau kuv 16.76 teev ntawm kev saib xyuas gps sab nraum kuv lub sijhawm tsav tsheb, nrog ib qho hloov tshiab txhua 10 vib nas this.

Tam sim no, cov ntawv UDP no yuav tsum mus qhov twg. Kuv tab tom siv Ubuntu server tuav ntawm CloudAtCost huab, uas kuv yuav rau 8 $ nrog tus nqi 80%, thiab uas tau ua haujlwm rau kuv lwm lub hom phiaj, yog li tsis mus rau hauv kev suav tus nqi. Yog tias koj tsis xav them rau tus neeg rau zaub mov, koj tuaj yeem tau txais dawb Amazon AWS piv txwv rau 12 hlis, thiab nruab Ubuntu rau nws. Thaum koj muaj koj lub server teeb tsa (saib cov kauj ruam tom ntej), tau txais nws tus IP zoo li qub, thiab muab tso rau ib sab ntawm SERVER txhais.

Kauj Ruam 3: Ntau Software (server-side Txais Gps Locations)

Ob qho tib si CloudAtCost thiab Amazon tuaj nrog kev teeb tsa ua ntej Ubuntu duab (CloudAtCost nyob ntawm Ubuntu 14.04). Yog li kuv tsis mus dhau cov kauj ruam rau nruab Ubuntu, zoo li koj yuav tsis tau. Yog tias koj siv CloudAtCost, koj yuav xav hloov kho rau Ubuntu 16.04, uas ua tiav nrog a

sudo apt-tau hloov tshiab && sudo apt-tau hloov kho & sudo apt-tau txais kev hloov kho tshiab

Tom qab ntawd koj yuav tsum teeb tsa LAMP (xa mus rau phau ntawv qhia no: ntawm no), txawm hais tias peb yuav tsis siv PHP.

Nruab Python nrog

sudo apt-tau nruab nruab nab hab sej-tsawg pip

Tom qab ntawd ntxiv ob peb ntawm cov qauv:

pip nruab --user urllib3 thov

Peb yuav tsum teeb tsa /var /www sau los ntawm koj, yog li cia peb ua:

sudo adduser YOUR_USER www-datasudo chown -R www-data: www-data /var /www

sudo chmod -R g+rwX /var /www

Tam sim no, peb xav tau "server" rau i) tau txais UDP pob ntawv, ii) tsim txoj hauv kev, iii) xa ntawv ceeb toom rau peb lub xov tooj ntawm tes, thiab "server" los pab tsim gps khiav (qhov no yuav yog apache).

Rau thawj tus neeg rau zaub mov, luam theej duab nab nab. Koj yuav tsum teeb tsa cov hauv qab no:

iftttuser = "Koj tus neeg siv IFTTT"

iftttpass = "Koj IFTTT PASSWORD"

iftttappletid = "Koj li IFTTT ceeb toom APPLET"

iftttkey = "Koj IFTTT KEY"

iftttevent = "Koj li IFTTT EVENT"

Raws li koj yuav tau kwv yees, peb tab tom siv IFTTT rau server lub sijhawm ceeb toom rau peb lub xov tooj ntawm tes. Ua raws li phau ntawv qhia no: ntawm no tab sis tsis txhob xaiv "xa sms rau kuv", xaiv "xa ntawv ceeb toom app". Tau txais koj li applet id (nqes rau hauv qab ntawm lub applet teeb tsa kom pom nws) thiab siv qhov ntawd saum toj no. Siv kuj yog tus yuam sij tsim hauv qhov teeb tsa saum toj no. Qhov kev tshwm sim IFTTT yog lub npe koj muab rau koj li applet, kuv muab nws "carmoving".

Tam sim no, tsis muaj lub sijhawm ceeb toom tiag tiag lub platform pub dawb, AFAIK. Yog koj paub ib tus, qhia rau kuv paub. IFTTT muaj kev ncua. Qhov kev ncua no tuaj yeem txo qis mus rau ob peb feeb yog tias koj siv email ua rau. Hmoov tsis zoo, qhov no tsis ntseeg tau. Qhov nyuam qhuav tsim webhook muaj ncua 15 feeb. Tab sis peb tsis xav tos 15 feeb kom paub tias peb lub tsheb raug nyiag, puas yog? Ntawd yog lo lus zais nug koj kom teeb tsa txhua qhov teeb tsa saum toj no. Yog tias koj rub tus nab npawb nab npawb, koj pom muaj ob peb kab, uas yog 45-53, kom siv lub tshuab "tshuaj xyuas tam sim no" ua haujlwm ntawm IFTTT, uas yuam kom tshawb xyuas qhov tshwm sim sai, thiab ua rau ceeb toom tsis pub dhau 1 vib nas this! Koj nyob nraum zoo:)

Thaum koj tau teeb tsa koj tus nab npawb nab npawb qhov chaw, cia li khiav nws. Yog tias koj yog tus siv pro, kom nws pib ntawm server boot. Xa mus rau tons ntawm cov lus qhia dawb hauv online yuav ua li cas, piv txwv li qhov no.

Kauj Ruam 4: Txawm Muaj Ntau Yam Software (Mobile App)

Txawm Ntau Software (Mobile App)
Txawm Ntau Software (Mobile App)
Txawm Ntau Software (Mobile App)
Txawm Ntau Software (Mobile App)
Txawm Ntau Software (Mobile App)
Txawm Ntau Software (Mobile App)
Txawm Ntau Software (Mobile App)
Txawm Ntau Software (Mobile App)

Peb xav tau txoj hauv kev nrawm thiab yooj yim kom pom tau qhov gps taug qab uas cov neeg rau zaub mov ntawm cov kauj ruam dhau los yog ua kom tiav. Muaj peev xwm, nws yuav tsum ua haujlwm ntawm txhua hom smartphone.

Cia wb mam siv tus ntoo khaub lig-platform mobile app suite, zoo li Ionic/Cordova. Kuv siv Ionic v1, tsis txhob cuam tshuam nrog Ionic Native, lossis Ionic v2, uas yog qhov sib txawv.

Ua raws cov kauj ruam yooj yim no kom pib koj thawj qhov haujlwm hauv Ionic: ntawm no.

Tom qab ntawd, koj yuav tsum pib qhov haujlwm tshiab raws li google maps sdk, zoo li no:

ionic pib myapp maps

Mus rau hauv "cov peev txheej" nplaub tshev thiab luam daim duab lub tsheb loj ntawm no ua "icon.png". Hloov qhov cim me me li "car2.png" thiab "start.png" qhov chaw ntawm koj lub server, zoo li https://yourserver/car2.png. Koj yuav xav tau cov no raws li cov cim hauv koj app.

Siv cov ntawv txuas txuas ntxiv.html (hloov npe index.html.txt rau index.html), cov lus qhia.js, thiab cov tswj hwm.js cov ntaub ntawv, thiab muab tso rau hauv www (index.html), www/js (tag nrho js).

ntxiv koj lub platform zoo li no:

ionic ntxiv plaftorm hauv

tsim zoo li no:

ionic tsim hauv

ces ionic yuav qhia koj qhov twg nws tsim koj.apk uas koj tuaj yeem teeb tsa ntawm koj lub xov tooj ntawm tes.

Txhawm rau tsim rau iOS, koj yuav xav tau Mac, thiab Xcode. ionic tuaj yeem txuag txoj haujlwm Xcode, uas koj tuaj yeem qhib hauv Xcode thiab tsim rau koj lub xov tooj. Yog tias koj tsis muaj tus lej tsim tawm iOS, tom qab ntawd koj yuav tsum txuas koj lub xov tooj rau Xcode thiab teeb tsa koj lub xov tooj rau kev txhim kho kom muaj peev xwm teeb tsa lub app nyob ntawd. Qhov no yog sab nrauv ntawm qhov qhia tau.

Hauv ntau yam ntaub ntawv js, koj yuav tsum pom cov kab sib xws rau "car2.png" thiab "start.png" thiab hloov kho lawv nrog txoj hauv kev ntawm koj cov duab. Tib yam rau "plan.json".

Qhov ntawd yog nws !!

Kauj Ruam 5: Ua Haujlwm Yav Tom Ntej

1) Kuv tau muab txhua yam tso rau hauv lub thawv ntawv uas kuv tuaj yeem nkaum qhov twg nyob ze ntawm lub qhov hluav taws xob usb. Qhov zoo tshaj plaws yuav tsum yog teeb rooj zoo dua hauv qab lub tsheb ntawm lub tsheb, nrog 12v-> 5v hloov pauv.

2) Nrog lub bluetooth sensor, koj tuaj yeem ua tau "nkag siab" yog tias koj nyob hauv tsheb, yog li gps system yuav tsis qhib.

3) Tsuas yog them rau daim phiaj sim cov ntaub ntawv thiab teeb SECONDS rau 1 kom txaus siab rau kev taug qab lub sijhawm tiag tiag:)

Vam tias koj nyiam qhov kev qhia ua ntej ntawm kuv!

Pom zoo: