Cov txheej txheem:

Ntse Buoy [GPS, Xov Tooj Cua (NRF24) thiab SD Card Module]: 5 Kauj Ruam (nrog Duab)
Ntse Buoy [GPS, Xov Tooj Cua (NRF24) thiab SD Card Module]: 5 Kauj Ruam (nrog Duab)

Video: Ntse Buoy [GPS, Xov Tooj Cua (NRF24) thiab SD Card Module]: 5 Kauj Ruam (nrog Duab)

Video: Ntse Buoy [GPS, Xov Tooj Cua (NRF24) thiab SD Card Module]: 5 Kauj Ruam (nrog Duab)
Video: DAB Radio - Ian Mackenzie VK2ZIM - Manly-Warringah Radio Society lecture 2024, Kaum ib hlis
Anonim
Image
Image

Qhov Smart Buoy series kab ntawv no peb (mob siab rau) npaj tsim lub thawb kev tshawb fawb uas tuaj yeem ntsuas ntsuas muaj txiaj ntsig txog hiav txwv siv cov khoom lag luam tawm ntawm lub txee. Nov yog kev qhia ob ntawm plaub - xyuas kom tseeb tias koj tau hloov kho tshiab, thiab yog tias koj xav tau kev qhia nrawm rau txoj haujlwm, txheeb xyuas peb cov ntsiab lus.

Ntu 1: Kev ntsuas yoj thiab ntsuas kub

Hauv qhov kev qhia no, peb nthuav qhia koj yuav ua li cas kom tau txais GPS cov ntaub ntawv, khaws nws ntawm daim npav SD thiab xa nws mus rau qhov chaw uas siv xov tooj cua.

Peb tau ua qhov no yog li peb tuaj yeem taug qab qhov chaw ntawm peb tus seaborne Buoy. Lub xov tooj cua txhais tau tias peb tuaj yeem saib nws nyob deb thiab daim npav SD txhais tau tias yog lub sijhawm tsis muaj qee yam tawg thiab nws mus ncig, peb tuaj yeem rub tawm cov ntaub ntawv nws sau thaum lub sijhawm nws tsis tau npaj tseg - yog tias peb puas tuaj yeem khaws nws!

Khoom siv

GPS module - Amazon

SD daim npav module - Amazon

SD daim npav - Amazon

2 X Xov tooj cua modules (NRF24L01+) - Amazon

2 X Arduino - Amazon

Kauj ruam 1: Tau GPS Cov Ntaub Ntawv

Xa GPS Cov Ntaub Ntawv Ntawm Xov Tooj Cua
Xa GPS Cov Ntaub Ntawv Ntawm Xov Tooj Cua

Cov cuab yeej ntse ua ntsuas ntsuas thaum nws zaum hauv hiav txwv, suav nrog GPS qhov chaw thiab hnub tim. Ua tibzoo saib cov schematic uas qhia tias peb teeb tsa lub Circuit Court li cas. GPS module sib txuas lus ntawm kev txuas txuas, yog li peb siv Arduino software cov tsev qiv ntawv txuas nrog rau lub tsev qiv ntawv me me GPS los sib tham nrog nws. Cov tsev qiv ntawv no ua txhua yam yooj yim heev. Cia peb coj koj los ntawm txoj cai…

#suav nrog

#include // Lub TinyGPS ++ kwv TinyGPSPlus gps; // Qhov txuas txuas mus rau GPS ntaus ntawv SoftwareSerial ss (4, 3); struct dataStruct {ob latitude; ob kab ntev; unsigned ntev hnub; tsis kos npe ntev; } gpsData; teeb tsa tsis muaj dab tsi () {Serial.begin (115200); pib (9600); } void loop () {thaum (ss.available ()> 0) {yog (gps.encode (ss.read ())) {getInfo (); printRes ผลลัพธ์ (); }}} tsis muaj dab tsi getInfo () {yog (gps.location.isValid ()) {gpsData.latitude = gps.location.lat (); gpsData.longitude = gps.location.lng (); } lwm {Serial.println ("Qhov chaw tsis raug"); } yog (gps.date.isValid ()) {gpsData.date = gps.date.value (); } lwm {Serial.println ("Hnub tsis raug"); } yog (gps.time.isValid ()) {gpsData.time = gps.time.value (); } lwm {Serial.println ("Lub sijhawm tsis raug"); }} void printResults () {Serial.print ("Qhov chaw:"); Serial.print (gpsData.latitude, 6); Serial.print (","); Serial.print (gpsData.longitude, 6); Serial.print ("Hnub tim:"); Serial.print (gpsData.date); Serial.print ("Sijhawm:"); Serial.print (gpsData.time); Serial.println (); }

(Txheeb tawm cov vis dis aus rau tus lej no ntawm

Kauj Ruam 2: Xa GPS Cov Ntaub Ntawv Ntawm Xov Tooj Cua

Xa GPS Cov Ntaub Ntawv Ntawm Xov Tooj Cua
Xa GPS Cov Ntaub Ntawv Ntawm Xov Tooj Cua

Piv txwv tias lub nkoj nyob hauv hiav txwv ntsuas, tab sis peb xav pom cov ntaub ntawv yam tsis tau ua kom peb txhais taw ntub lossis nqa lub nkoj hla ntug hiav txwv. Txhawm rau kom tau txais kev ntsuas nyob deb, peb siv lub xov tooj cua txuas nrog Arduino ntawm ob sab ntawm kev sib txuas lus. Yav tom ntej, peb yuav hloov tus txais-sab Arduino nrog raspberry pi. Lub xov tooj cua ua haujlwm zoo ib yam nrog ob qho kev cuam tshuam no yog li sib pauv lawv yog qhov yooj yim heev.

Cov xov tooj cua sib txuas lus siv SPI, uas xav tau ob peb qhov txuas ntau dua li I2C tab sis tseem siv tau yooj yim heev vim yog NRF24 lub tsev qiv ntawv. Siv GPS module rau ntsuas ntsuas, peb xa nws cov ntaub ntawv los ntawm ib qho Arduino mus rau lwm qhov. Peb tab tom yuav txuas GPS thiab xov tooj cua rau Arduino thiab ntawm sab tod Arduino nrog lub xov tooj cua module - saib ntawm cov phiaj xwm.

Tshaj Tawm

#suav nrog

#suav nrog #suav nrog #suav nrog #suav nrog TinyGPSPlus gps; SoftwareSerial ss (4, 3); RF24 xov tooj cua (8, 7); // CE, CSN struct dataStruct {ob latitude; ob kab ntev; unsigned ntev hnub; tsis kos npe ntev; } gpsData; teeb tsa tsis muaj dab tsi () {Serial.begin (115200); pib (9600); Serial.println ("Teeb tsa xov tooj cua"); // Teeb tsa tus xa xov tooj cua radio.begin (); xov tooj cua.openWritingPipe (0xF0F0F0F0E1LL); xov tooj cua.setChannel (0x76); radio.setPALevel (RF24_PA_MAX); xov tooj cua.setDataRate (RF24_250KBPS); xov tooj cua.stopListening (); xov tooj cua.enableDynamicPayloads (); xov tooj cua.powerUp (); Serial.println ("Pib xa"); } void loop () {thaum (ss.available ()> 0) {yog (gps.encode (ss.read ())) {getInfo (); xov tooj cua.write (& gpsData, sizeof (gpsData)); }}} void getInfo () {if (gps.location.isValid ()) {gpsData.longitude = gps.location.lng (); gpsData.latitude = gps.location.lat (); } lwm {gpsData.longitude = 0.0; gpsData.latitude = 0.0; } yog (gps.date.isValid ()) {gpsData.date = gps.date.value (); } lwm {gpsData.date = 0; } yog (gps.time.isValid ()) {gpsData.time = gps.time.value (); } lwm {gpsData.time = 0; }}

YUAV SIV

#suav nrog

#suav nrog #suav nrog RF24 xov tooj cua (8, 7); // CE, CSN struct dataStruct {ob latitude; ob kab ntev; unsigned ntev hnub; tsis kos npe ntev; } gpsData; teeb tsa tsis muaj dab tsi () {Serial.begin (115200); // Teeb tus txais xov tooj cua radio.begin (); xov tooj cua.openReadingPipe (1, 0xF0F0F0F0E1LL); xov tooj cua.setChannel (0x76); radio.setPALevel (RF24_PA_MAX); xov tooj cua.setDataRate (RF24_250KBPS); xov tooj cua.startListening (); xov tooj cua.enableDynamicPayloads (); xov tooj cua.powerUp (); } void loop () {yog (radio.available ()) {radio.read (& gpsData, sizeof (gpsData))); Serial.print ("Qhov chaw:"); Serial.print (gpsData.latitude, 6); Serial.print (","); Serial.print (gpsData.longitude, 6); Serial.print ("Hnub tim:"); Serial.print (gpsData.date); Serial.print ("Sijhawm:"); Serial.print (gpsData.time); Serial.println ();}}

(Txheeb tawm cov vis dis aus rau tus lej no ntawm

Kauj Ruam 3: Khaws Cov Ntaub Ntawv Siv SD Card Module

Khaws Cov Ntaub Ntawv Siv Tus Qauv SD Card
Khaws Cov Ntaub Ntawv Siv Tus Qauv SD Card

Lub xov tooj cua module yog qhov ntseeg tau heev, tab sis qee zaum koj xav tau txoj phiaj xwm cuam tshuam thaum muaj lub zog txiav ntawm tus txais lossis yog tias lub xov tooj cua txav mus deb. Peb txoj kev npaj rau qhov xwm txheej yog SD daim npav module uas tso cai rau peb khaws cov ntaub ntawv peb khaws. Qhov ntau ntawm cov ntaub ntawv khaws tseg tsis loj heev, yog li txawm tias daim npav SD me me tuaj yeem yooj yim tuaj yeem khaws cov ntaub ntawv ib hnub.

#suav nrog

#suav nrog #suav nrog #suav nrog TinyGPSPlus gps; SoftwareSerial ss (4, 3); struct dataStruct {ob latitude; ob kab ntev; unsigned ntev hnub; tsis kos npe ntev; } gpsData; teeb tsa tsis muaj dab tsi () {Serial.begin (115200); pib (9600); yog (! SD.begin (5)) {Serial.println ("Daim npav ua tsis tiav, lossis tsis nyob tam sim no"); rov qab; } Serial.println ("pib daim npav."); Cov ntaub ntawv dataFile = SD.open ("gps_data.csv", FILE_WRITE); yog (dataFile) {dataFile.println ("Latitude, Ntev ntev, Hnub, Sijhawm"); dataFile.close (); cov } lwm {Serial.println ("tsis tuaj yeem qhib cov ntaub ntawv"); }} void loop () {thaum (ss.available ()> 0) {yog (gps.encode (ss.read ()))) {getInfo (); printRes ผลลัพธ์ (); saveInfo (); }}} tsis muaj dab tsi getInfo () {yog (gps.location.isValid ()) {gpsData.latitude = gps.location.lat (); gpsData.longitude = gps.location.lng (); } lwm {Serial.println ("Qhov chaw tsis raug"); } yog (gps.date.isValid ()) {gpsData.date = gps.date.value (); } lwm {Serial.println ("Hnub tsis raug"); } yog (gps.time.isValid ()) {gpsData.time = gps.time.value (); } lwm {Serial.println ("Lub sijhawm tsis raug"); }} void printResults () {Serial.print ("Qhov chaw:"); Serial.print (gpsData.latitude, 6); Serial.print (","); Serial.print (gpsData.longitude, 6); Serial.print ("Hnub tim:"); Serial.print (gpsData.date); Serial.print ("Sijhawm:"); Serial.print (gpsData.time); Serial.println (); } void saveInfo () {Cov ntaub ntawv dataFile = SD.open ("gps_data.csv", FILE_WRITE); yog (dataFile) {dataFile.print (gpsData.latitude); dataFile.print (","); dataFile.print (gpsData.longitude); dataFile.print (","); dataFile.print (gpsData.date); dataFile.print (","); dataFile.println (gpsData.time); dataFile.close (); cov } lwm {Serial.println ("tsis muaj cov ntaub ntawv"); }}

(Peb tham los ntawm cov cai no hauv video

Kauj Ruam 4: Xa thiab khaws Cov Ntaub Ntawv GPS

Xa thiab khaws cov ntaub ntawv GPS
Xa thiab khaws cov ntaub ntawv GPS
Xa thiab khaws cov ntaub ntawv GPS
Xa thiab khaws cov ntaub ntawv GPS

Kauj ruam 5: Tsaug

Ua tsaug!
Ua tsaug!

Sau npe rau Peb Cov Npe Xa Ntawv!

Ntu 1: Ua Wave Thiab Ntsuas Kub

Ntu 2: GPS NRF24 Xov Tooj Cua thiab SD Card

Ntu 3: Teem Sij Hawm Rau Buoy

Ntu 4: Siv Lub Buoy

Pom zoo: