Cov txheej txheem:

Txuag Koj Lub Neej Nrog Lub Tsev Saib Xyuas Kev Nyuaj Siab: 8 Kauj Ruam
Txuag Koj Lub Neej Nrog Lub Tsev Saib Xyuas Kev Nyuaj Siab: 8 Kauj Ruam

Video: Txuag Koj Lub Neej Nrog Lub Tsev Saib Xyuas Kev Nyuaj Siab: 8 Kauj Ruam

Video: Txuag Koj Lub Neej Nrog Lub Tsev Saib Xyuas Kev Nyuaj Siab: 8 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Txuag Koj Lub Neej Nrog Lub Tsev Collapse Monitor
Txuag Koj Lub Neej Nrog Lub Tsev Collapse Monitor

Txheeb xyuas cov pob zeb, hlau, cov qauv ntoo rau khoov thiab cov ces kaum thiab ceeb toom yog tias lawv tau hloov pauv los ntawm txoj haujlwm qub.

Kauj ruam 1: Taw qhia

Taw qhia
Taw qhia

Nrog rau kev txhim kho kev tsim vaj tsev hauv zej zog, peb tuaj yeem txheeb xyuas ntau yam kev tsim vaj tsev nyob txhua qhov chaw. Cov txheej txheem hlau, Cov kab teeb ua vaj tse, Lub tsev ntau lub platform yog qee qhov ntawm lawv. Ntxiv mus, peb feem coob tau siv nyob hauv ib lub tsev lossis tsev thaum lub sijhawm feem ntau ntawm hnub ntawd. Tab sis peb yuav ua li cas thiaj paub tseeb tias lub tsev muaj kev nyab xeeb txaus nyob? Yuav ua li cas yog tias muaj qhov tawg me me lossis nqaj hla dhau hauv koj lub tsev? Nws yuav muaj kev phom sij ntau pua lub neej.

Av qeeg, Av tawv, Tornadoes thiab ntau yam ntxiv, tuaj yeem yog yam rau kev tawg sab hauv thiab qhov txawv ntawm cov qauv lossis kab teeb los ntawm txoj haujlwm nruab nrab. Feem ntau peb tsis paub txog qhov xwm txheej ntawm cov qauv ib puag ncig. Tej zaum qhov chaw niaj hnub uas peb taug kev tau muaj cov kab nrib pleb tawg thiab tuaj yeem tawg thaum twg los tau. Tab sis yam tsis paub nws peb tuaj yeem nkag mus sab hauv. Raws li kev daws teeb meem rau qhov no, peb xav tau txoj hauv kev zoo los tshuaj xyuas cov pob zeb, ntoo, kab hlau ntawm kev tsim vaj tsev uas peb mus tsis tau.

Kauj ruam 2: Kev daws teeb meem

Tshuaj
Tshuaj
Tshuaj
Tshuaj

"Tus Qauv Tshuaj Ntsuam Xyuas" yog lub cuab yeej nqa tau uas tuaj yeem ntsia tau rau ntawm cov nqaj hlau, cov qauv hlau, cov pob zeb thiab lwm yam. Cov cuab yeej no siv lub ntsuas cua/ Gyroscope los ntsuas lub kaum sab xis hauv x, y, z lub dav hlau thiab kho lub ntsej muag txhawm rau saib xyuas qhov khoov. Txhua cov ntaub ntawv nyoos tau ua tiav thiab cov ntaub ntawv raug xa mus rau lub mobile app.

Kauj ruam 3: Circuit Court

Circuit Court
Circuit Court
Circuit Court
Circuit Court
Circuit Court
Circuit Court
Circuit Court
Circuit Court

Sau cov khoom hauv qab no.

  • Arduino 101 Pawg Thawj Coj
  • 2 X Flex sensors
  • 2 X 10k Resistors

Txhawm rau txo tus naj npawb ntawm cov khoom siv Arduino 101 pawg thawj coj tau siv ntawm no vim nws muaj cov ntsuas qhov ntsuas thiab BLE tus qauv. Flex sensors tau siv los ntsuas tus nqi ntawm dabtsi yog khoov thaum nws hloov nws qhov kev tiv thaiv thaum khoov. Lub Circuit Court yog ib qho me me li tsuas yog 2 resistors thiab 2 flex sensors xav tau txuas. Cov duab hauv qab no qhia pom yuav ua li cas txuas lub sensor hloov pauv mus rau Arduino board.

Ib tus pin ntawm tus tiv thaiv txuas nrog A0 tus pin ntawm Arduino board. Ua raws tib txoj hauv kev txhawm rau txuas qhov ntsuas thib ob. Siv A1 tus pin los txuas tus tiv thaiv.

Txuas lub buzzer ncaj qha rau D3 tus pin thiab Gnd tus pin.

Kauj ruam 4: Tiav Cov Ntaus

Tiav Cov Ntaus
Tiav Cov Ntaus
Tiav Cov Ntaus
Tiav Cov Ntaus

Tom qab ua lub Circuit Court, nws yuav tsum tau kho nyob rau hauv ib qho thaiv. Raws li tus qauv 3D saum toj no, 2 lub ntsuas hluav taws xob hloov pauv yuav tsum tau muab tso rau sab nraud ntawm lub thawv. Ua qhov chaw rau USB chaw nres nkoj los teeb tsa lub rooj tsavxwm thiab muab lub zog. Raws li cov cuab yeej no xav tau los siv rau lub sijhawm ntev, txoj hauv kev zoo tshaj plaws los muab lub zog yog siv lub hwj huam ruaj khov.

Kauj ruam 5: Mobile App

Txawb App
Txawb App
Txawb App
Txawb App
Txawb App
Txawb App

Rub tawm thiab teeb tsa Blynk los ntawm Android Play Store. Pib txoj haujlwm tshiab rau Arduino 101. Xaiv txoj kev sib txuas lus ua BLE. Ntxiv 1 lub davhlau ya nyob twg, 2 khawm thiab BLE rau lub interface. Cov duab hauv qab no qhia koj yuav ua li cas los ua tus interface.

Kauj Ruam 6: Blynk Code Cov Ntaub Ntawv

Tom qab ua lub interface ntawm Blynk koj yuav tau txais cov cai tso cai. Sau qhov chaws ntawm qhov chaw hauv qab no.

#include #include char auth = "**************"; // Blynk Tso Cai

WidgetTerminal davhlau ya nyob twg (V2);

BLEPeripheral blePeripheral;

Hauv cov txheej txheem ntsuas, qhov ntsuas tam sim no tau txais kev cawmdim hauv EEPROM.

qhov tseem ceeb (); EEPROM.write (0, flx1);

EEPROM.write (1, flx2);

EEPROM.write (2, x);

EEPROM.write (3, y);

EEPROM.write (4, z);

terminal.print ("Calibration Succesful");

Tom qab ntsuas ntsuas, lub cuab yeej yuav sib piv qhov sib txawv nrog tus nqi pib thiab ua rau lub suab nrov nrov yog tias lawv dhau tus nqi.

qhov tseem ceeb (); yog (abs (flex1-m_flx1)> 10 lossis abs (flex2-m_flx2)> 10) {

terminal.println ("Hla Khoov");

suab (buzzer, 1000);

}

if (abs (x-m_x)> 15 lossis abs (y-m_y)> 15 lossis abs (z-m_z)> 15) {

terminal.println ("Tshaj Tawm");

suab (buzzer, 1000);

}

Kauj Ruam 7: Kev ua haujlwm

Kev ua haujlwm
Kev ua haujlwm

Khaws lub cuab yeej rau ntawm tus qauv xav tau los saib xyuas. Khaws lub 2 flex sensors ib yam nkaus. Muab lub zog rau lub rooj tsavxwm siv USB cable.

Qhib Blynk interface. Txuas nrog lub cuab yeej los ntawm kov lub cim Bluetooth. Nias lub calibration khawm. Tom qab ntsuas qhov davhlau ya nyob twg yuav qhia cov lus li "Ua tiav Calibrated." Pib dua lub cuab yeej. Tam sim no nws yuav saib xyuas tus qauv thiab ceeb toom koj los ntawm lub tswb nrov yog tias nws hloov pauv ntawm kev hloov pauv. Koj tuaj yeem tshawb xyuas lub kaum sab xis thiab khoov qhov muaj txiaj ntsig txhua lub sijhawm los ntawm kev nias lub pob xwm txheej. Qhov no yuav zoo li lub cuab yeej me me. Tab sis nws cov kev siv tsis muaj nuj nqis. Qee lub sij hawm peb tsis nco qab txheeb xyuas qhov xwm txheej ntawm peb lub tsev, chaw ua haujlwm thiab lwm yam, nrog peb cov sijhawm tsis khoom. Tab sis yog tias muaj teeb meem me me, nws yuav xaus zoo li daim duab saum toj no.

Tab sis nrog cov cuab yeej no, ntau pua lub neej tuaj yeem raug cawm los ntawm kev qhia txog teeb meem me tab sis txaus ntshai hauv kev tsim vaj tsev.

Kauj Ruam 8: Arduino101 Code File

#define BLYNK_PRINT Serial

#define flex1 A0

#define flex2 A1 // Txheeb xyuas qhov ntsuas lub zog thiab lub suab nrov

#define lub suab nrov 3

#suav nrog "CurieIMU.h"#suav nrog "BlynkSimpleCurieBLE.h"

#suav nrog "CurieBLE.h"

#suav nrog "Wire.h"

#suav nrog "EEPROM.h"

#suav nrog "SPI.h"

char auth = "**************"; // Blynk Tso Cai Code WidgetTerminal davhlau ya nyob twg (V2);

BLEPeripheral blePeripheral;

int m_flx1, m_flx2, m_x, m_y, m_z; // qhov tseem ceeb khaws tseg hauv nco

int flx1, flx2, x, y, z; // Kev nyeem tam sim no

void values () {rau (int i = 0; i <100; i ++) {

flx1 = analogRead (flex1); // Tau txais kev nyeem nyoos los ntawm cov ntsuas

flx2 = analogRead (flex2);

x = CurieIMU.readAccelerometer (X_AXIS)/100;

y = CurieIMU.readAccelerometer (Y_AXIS)/100;

z = CurieIMU.readAccelerometer (Z_AXIS)/100;

ncua (2);

}

flx1 = flx1/100; flx2 = flx2/100;

x = x/100; // Tau txais qhov nruab nrab qhov tseem ceeb ntawm kev nyeem

y = y/100;

z = z/100;

}

teeb tsa tsis muaj dab tsi () {// pinMode (3, OUTPUT);

pinMode (flex1, INPUT);

pinMode (flex2, INPUT); // Teeb tsa tus qauv pin tus qauv

Serial.begin (9600);

blePeripheral.setLocalName ("Arduino101Blynk"); blePeripheral.setDeviceName ("Arduino101Blynk");

blePeripheral.setAppearance (384);

Blynk.begin (auth, blePeripheral);

blePeripheral.begin ();

m_flx1 = EEPROM.read (0); m_flx2 = EEPROM.read (1);

m_x = EEPROM.read (2); // Nyeem ua ntej tau txais txiaj ntsig qhov ntsuas qhov ntsuas los ntawm EEPROM

m_y = EEPROM.read (3);

m_z = EEPROM.read (4);

}

lub voj void () {Blynk.run ();

blePeripheral.poll ();

qhov tseem ceeb ();

yog (abs (flex1-m_flx1)> 10 lossis abs (flex2-m_flx2)> 10) {terminal.println ("Hla Khoov");

suab (buzzer, 1000);

}

yog (abs (x-m_x)> 15 lossis abs (y-m_y)> 15 lossis abs (z-m_z)> 15) {terminal.println ("Over Inclined");

suab (buzzer, 1000);

}

suab (buzzer, 0);

}

/*VO qhia txog hom kev ntsuas. Hauv hom no qhov txiaj ntsig ntawm cov ntsuas * tau txais kev cawmdim hauv EEPROM

*/

BLYNK_WRITE (V0) {int pinValue = param.asInt ();

yog (pinValue == 1) {

qhov tseem ceeb ();

EEPROM.write (0, flx1); EEPROM.write (1, flx2);

EEPROM.write (2, x);

EEPROM.write (3, y);

EEPROM.write (4, z);

terminal.print ("Calibration Succesful");

}

}

/ * Peb tuaj yeem thov kom muaj qhov sib txawv tam sim no * los ntawm nias lub pob V1

*/

BLYNK_WRITE (V1) {

int pinValue = param.asInt ();

yog (pinValue == 1) {

qhov tseem ceeb (); terminal.print ("X kaum qhov sib txawv-");

terminal.print (abs (x-m_x));

terminal.println ();

terminal.print ("Y lub kaum deviation-");

terminal.print (abs (y-m_y));

terminal.println ();

terminal.print ("Z lub kaum deviation-");

terminal.print (abs (z-m_z));

terminal.println ();

terminal.print ("Flex 1 deviation-");

terminal.print (abs (flx1-m_flx1));

terminal.println ();

terminal.print ("Flex 2 deviation-");

terminal.print (abs (flx2-m_flx2));

terminal.println ();

}

}

BLYNK_WRITE (V2) {

}

Pom zoo: