Cov txheej txheem:

Raspberry Pi NFC Khaub Ncaws Tracker: 5 Kauj Ruam (nrog Duab)
Raspberry Pi NFC Khaub Ncaws Tracker: 5 Kauj Ruam (nrog Duab)

Video: Raspberry Pi NFC Khaub Ncaws Tracker: 5 Kauj Ruam (nrog Duab)

Video: Raspberry Pi NFC Khaub Ncaws Tracker: 5 Kauj Ruam (nrog Duab)
Video: Xamarin, the way to make NFC Apps 2024, Kaum ib hlis
Anonim
Raspberry Pi NFC Khaub Ncaws Tracker
Raspberry Pi NFC Khaub Ncaws Tracker

Yog tias koj zoo li kuv, tom qab ntawd koj muaj pawg me me ntawm cov khaub ncaws hauv pem teb uas yuav lossis tsis yog qias neeg. Qhov no tuaj yeem suav nrog ris ntauv txhav, tsho hnav, thiab hnav luv luv. Yog li koj tuaj yeem qhia cov khaub ncaws twg uas huv lossis qias neeg? Kuv tuaj nrog txoj hauv kev los taug qab ntau yam khoom ntawm khaub ncaws siv NFC thiab Raspberry Pi. Koj yooj yim ntxig daim npav NFC rau hauv hnab tshos thiab tom qab ntawv luam theej duab, uas coj cov ntaub ntawv hais txog cov khaub ncaws ntawd nrog rau kev muaj peev xwm hloov pauv nws.

Kauj Ruam 1: Sib Sau Ua Ke

Sib sau ua ke
Sib sau ua ke
Sib sau ua ke
Sib sau ua ke
Sib sau ua ke
Sib sau ua ke
Sib sau ua ke
Sib sau ua ke

DFRobot tau hu rau kuv los txhawb txoj haujlwm no, yog li lawv tau xa Raspberry Pi 3 thiab PN532 NFC Module, nrog rau 5 daim npav NFC. NFC tus qauv siv UART los sib tham nrog tus tswv cuab, yog li kuv tau sim siv Raspberry Pi thaum xub thawj, tab sis kuv tau khiav mus rau ntau qhov teeb meem. Cov tsev qiv ntawv tau nyuaj thiab nyuaj rau cuam tshuam nrog Python, yog li kuv tau xaiv los siv Arduino Mega rau kev sib txuas lus nrog NFC module. Arduino Mega yog qhov tsim nyog vim tias nws siv ob lub UART chaw nres nkoj, ib qho rau NFC module thiab ib qho rau tso tawm cov ntaub ntawv.

Kauj ruam 2: Teeb tsa Pi

Teeb tsa Pi
Teeb tsa Pi

Kuv tau mus rau nplooj Raspberry Pi Downloads thiab rub tawm qhov tshiab tshaj plaws ntawm Raspbian. Tom qab ntawd kuv rho tawm cov ntawv thiab muab tso rau hauv cov npe yooj yim. Koj tsis tuaj yeem tsuas yog luam/muab cov ntawv.img tso rau hauv SD daim npav, koj yuav tsum "hlawv nws" mus rau daim npav. Koj tuaj yeem rub tawm cov khoom siv hluav taws xob zoo li Etcher.io kom yooj yim hloov OS cov duab. Tom qab cov ntaub ntawv.img nyob ntawm kuv daim npav SD kuv tso nws rau hauv Raspberry Pi thiab muab lub zog rau nws. Tom qab kwv yees li 50 vib nas this kuv tshem lub qaum thiab tshem daim npav SD. Tom ntej no kuv muab daim npav SD rov qab rau hauv kuv lub PC thiab mus rau phau ntawv "khau raj". Kuv tau qhib Notepad thiab khaws nws ua cov ntawv tsis muaj npe hu ua "ssh" nrog TSIS txuas ntxiv. Kuj tseem muaj cov ntawv kuv ntxiv hu ua "wpa_supplicant.conf" thiab muab cov ntawv no tso rau hauv nws: network = {ssid = psk =} Tom qab ntawd kuv tau khaws thiab tshem daim npav thiab muab rov qab rau hauv Raspberry Pi 3. Tam sim no yuav tsum tso cai rau kev siv SSH thiab txuas rau WiFi.

Kauj Ruam 3: Kev thaiv kab hlau

Thaiv
Thaiv

Kev txuas rau qhov no yog qhov yooj yim zoo nkauj. Kuv txuas tus Rx tus pin rau Tx1 ntawm Mega, thiab Tx tus pin rau Rx1 tus pin ntawm Mega. 5v mus rau 5v, thiab GND mus rau GND. Kuv kuj tseem txuas Arduino Mega rau Raspberry Pi 3 ntawm USB me me.

Kauj ruam 4: Programming

Muaj ob daim ntawv, ib qho rau Arduino Mega thiab ib qho rau Raspberry Pi. Arduino Mega xub xa tawm qhov kev thov tuav tes mus rau tus qauv thiab tom qab ntawd tos rau cov lus teb. Thaum cov lus teb tau muab rau Mega pib pov npav lub cuab yeej los saib seb puas muaj daim npav raug luam tawm. Yog tias yog, daim npav ID tau nyeem. Txhawm rau xa cov ntaub ntawv qhia meej rau Pi, Kuv tau siv pseudo-checksum algorithm los ua ke tsib bytes rau hauv ib tus lej. Thawj plaub bytes tau ntxiv ua ke ib zaug, thiab zaum kawg byte tau ntxiv ob zaug. Kuj tseem muaj kab uas muaj cov lej ntawm txhua daim npav. Thaum daim npav tau luam theej duab nws daim tshev tau muab piv rau cov uas nyob hauv kab ntawv thiab tom qab ntawd sib phim. Thaum kawg cov ntaub ntawv no tau xa mus ntau dua rau Raspberry Pi rau kev ua ntxiv.

Raspberry Pi tos rau cov ntaub ntawv xov xwm tshiab thiab tom qab ntawd luam tawm nws. Phau ntawv txhais lus raug tsim thaum pib ntawm txoj cai uas piav qhia tias txhua yam khoom siv khaub ncaws zoo li cas rau txhua daim npav. Txhua tus muaj lub npe, tus lej npav, xim, thiab xwm txheej (huv lossis qias neeg). Muaj qhov kev xaiv pauv qhov xwm txheej thaum cov khoom siv khaub ncaws raug luam tawm.

Kauj ruam 5: Siv Tus Ntaus

Image
Image

Kuv pib los ntawm ntxig daim npav rau hauv kuv lub khaub ncaws thiab tshawb xyuas lawv tus ID, sau cov ntaub ntawv rau hauv phau ntawv txhais lus. Yog tias kuv xav pom seb lawv puas huv lossis qias neeg Kuv tsuas yog tuav lawv mus rau RFID nyeem ntawv uas tom qab ntawd qhia cov ntaub ntawv ntawm SSH.

Pom zoo: