Cov txheej txheem:
- Kauj Ruam 1: Txoj Kev Xav Tom Qab Lub Ntaus Ntawv
- Kauj ruam 2: Siv Device
- Kauj Ruam 3: Cov Ntaub Ntawv Yuav Tsum Tau
- Kauj ruam 4: Sib dhos
- Kauj Ruam 5: Tsab Ntawv MicroPython
- Kauj Ruam 6: Qhov Yooj Yim Yooj Yim: MakeCode/JavaScript Code
- Kauj Ruam 7: Enviro: ntsis Version
- Kauj ruam 8: Cable thiab Sensor sojntsuam Version
Video: Micro: ntsis Dive-O-Meter: 8 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:28
Lub caij ntuj sov nyob ntawm no, nws lub sijhawm ua luam dej!
Lub sijhawm zoo los coj koj tus kheej thiab koj lub micro: me ntsis sab nraud rau, thiab hauv qhov no txawm tias mus rau hauv, pas dej da.
Lub micro: me ntsis dhia dej-o-meter piav qhia ntawm no yog qhov yooj yim DIY qhov ntsuas qhov tob uas tso cai rau koj ntsuas seb koj tob npaum li cas, lossis puas yog, dhia dej. Nws suav nrog tsuas yog micro: me ntsis, pob roj teeb lossis LiPo, txuas txuas rau micro: me ntsis, BMP280 lossis BME280 barometric siab sensor thiab qee lub jumper cables. Siv Pimoroni enviro: me ntsis ua rau txhua yam yooj yim dua. Txhua yam no tau ntim rau hauv ob txheej txheej ntawm cov hnab yas uas tsis muaj dej los yog silicone, nrog qee qhov hnyav ntxiv txhawm rau txhawm rau txhawm rau txhawb lub zog.
Nws yog daim ntawv thov ntawm micro: me ntsis lub siab ntsuas lub cuab yeej kuv tau piav qhia hauv cov lus qhia yav dhau los.
Koj tuaj yeem siv lub cuab yeej e. g. rau kev sib tw dhia nrog cov phooj ywg thiab tsev neeg, lossis kom paub tias lub pas dej tob tob npaum li cas tiag. Kuv sim nws siv lub pas dej tob tshaj plaws hauv kuv lub zej zog, thiab pom tias nws ua haujlwm yam tsawg kawg mus rau qhov tob ntawm 3.2 meter. Txog tsib meter yog qhov theoretical siab tshaj plaws. Txog tam sim no kuv tseem tsis tau sim nws qhov tseeb hauv txhua yam, tab sis cov xov tooj tau tshaj tawm tsawg kawg hauv qhov kev cia siab.
Qee cov lus hais: Qhov no tsis txhais tau tias yog lub cuab yeej rau cov neeg sib tw tiag. Koj lub micro: me ntsis yuav puas yog tias nws ntub. Koj siv cov lus qhia no ntawm koj tus kheej txoj kev pheej hmoo.
Hloov Kho Lub Tsib Hlis 27: Tam sim no koj tuaj yeem pom MakeCode HEX-tsab ntawv koj tuaj yeem thauj ncaj qha rau koj lub micro: me ntsis. Saib cov kauj ruam 6. Update Lub Rau Hli 13: Ib qho Enviro: ntsis thiab txuas kab ntawv txuas ntxiv. Saib cov kauj ruam 7 & 8
Kauj Ruam 1: Txoj Kev Xav Tom Qab Lub Ntaus Ntawv
Peb tab tom nyob hauv qab dej hiav txwv ntawm huab cua. Lub siab nyob ntawm no yog li 1020 hPa (hectoPascal) raws li qhov hnyav ntawm cov pa cua hauv daim ntawv ntawm no mus rau qhov chaw yog li 1 kg ib square centimeter.
Cov dej ntom ntom yog ntau dua, raws li ib litre ntawm huab cua hnyav li 1.2 g thiab ib litre dej 1 kg, piv txwv li txog 800-fold. Yog li qhov poob ntawm qhov ntsuas qhov ntsuas siab yog kwv yees li 1 hPa rau txhua 8 metres hauv qhov siab, qhov nce siab yog 1 hPa rau txhua centimeter hauv qab dej saum npoo av. Ntawm qhov tob txog 10 m, lub siab yog 2000 hPa, lossis ob qhov chaw cua.
Lub siab ntsuas siv ntawm no muaj qhov ntsuas ntau ntawm 750 thiab 1500 hPa ntawm kev daws teeb meem txog ib hPa. Qhov no txhais tau tias peb tuaj yeem ntsuas qhov tob txog 5 meters ntawm kev daws teeb meem txog 1 cm.
Cov cuab yeej yuav yog Boyle Marriotte yam ntsuas qhov tob. Nws lub rooj sib txoos yog qhov yooj yim heev thiab tau piav qhia hauv qib tom ntej. Lub sensor siv I2C raws tu qauv, yog li tus ntug txuas rau micro: me ntsis los ua ke. Qhov tseem ceeb tshaj plaws yog lub hnab ntim dej, vim tias cov av noo yuav ua rau lub micro: me ntsis, lub ntsuas cua, lossis lub roj teeb. Raws li qee qhov huab cua yuav raug kaw hauv lub hnab, qhov sib ntxiv ntawm qhov hnyav pab txhawm rau txhawm rau txhawm rau txhawb nqa lub zog.
Kauj ruam 2: Siv Device
Tsab ntawv, raws li tau qhia ntxaws nyob rau qib tom ntej, yog qhov sib txawv ntawm tsab ntawv kuv tau tsim ua ntej rau lub ntsuas ntsuas. Txhawm rau ntsuas lub cuab yeej, koj tuaj yeem siv chav ntsuas yooj yim piav qhia nyob rau ntawd.
Rau lub hom phiaj dhia dej nws qhia qhov tob hauv meters, raws li kev ntsuas los ntawm kev ntsuas siab, txawm tias yog kab duab kab hauv 20 cm cov kauj ruam lossis, thaum thov, ua lej.
Siv lub pob A ntawm lub micro: me ntsis, koj yuav teeb tsa lub zog tam sim no raws li qhov ntsuas siab. Kom paub meej tias nkag mus, matrix ntsais ib zaug.
Koj tuaj yeem siv qhov no los saib seb koj dhia tob npaum li cas, lossis sau cia tias koj dhia dej tob npaum li cas.
Hauv thawj kis teeb tsa huab cua sab nraud tam sim no raws li siv. Hauv qhov xwm txheej thib ob teeb tsa lub siab ntawm qhov tob tshaj plaws koj nyob qhov twg raws li kev siv siab, uas tom qab ntawd tso cai rau koj los qhia tias koj tau tob npaum li cas thaum koj rov qab los saum npoo av. Khawm B qhia qhov tob, xam los ntawm qhov sib txawv ntawm qhov sib txawv, raws li tus lej tus lej hauv meters.
Kauj Ruam 3: Cov Ntaub Ntawv Yuav Tsum Tau
Ib micro: me ntsis. Piv txwv li ntawm 13 GBP/16 Euro ntawm Pimoroni UK/DE.
Ib qho txuas txuas (Kitronic lossis Pimoroni), 5 GBP. Kuv tau siv Kitronic version.
BMP/BME280 sensor. Kuv siv lub ntsuas BMP280 los ntawm Banggood, 4.33 Euro rau peb chav nyob.
Jumper cables txuas lub sensor thiab ntug txuas.
Ib qho kev xaiv zoo tshaj plaws rau qhov txuas txuas/ntsuas ua ke saum toj no tuaj yeem yog Pimoroni enviro: me ntsis (tsis kuaj tam sim no, saib cov kauj ruam kawg).
Lub roj teeb lossis LiPo rau micro: me ntsis.
Ib lub hwj huam txuas nrog lub hloov (xaiv tau tab sis pab tau). Clear cov hnab ntim dej tsis huv. Kuv siv lub hnab ntim silicone rau lub xov tooj ntawm tes thiab ib lossis ob lub hnab me me ziploc. Muaj kom ntseeg tau tias cov khoom tuab txaus, yog li cov pins ntawm ntug txuas yuav tsis puas lub hnab.
Qee qhov hnyav. Kuv siv cov khoom hnyav uas yog siv rau nuv ntses.
Arduino IDE, thiab ntau lub tsev qiv ntawv.
Kauj ruam 4: Sib dhos
Nruab Arduino IDE thiab cov tsev qiv ntawv xav tau. Cov ntsiab lus tau piav qhia ntawm no.
(Tsis tas yuav tsum tau ua tsab ntawv MakeCode.) Muab rau koj siv Kitronik ntug txuas, txuas tus pas rau I2C chaw nres nkoj 19 & 20. Qhov no tsis xav tau rau Pimoroni ntug txuas. Solder lub taub hau rau lub sensor tawg tawm thiab txuas lub sensor thiab ntug txuas siv jumper cables. Txuas VCC mus rau 3V, GND rau 0 V, SCL mus rau chaw nres nkoj 19 thiab SDA mus rau chaw nres nkoj 20. Xwb txuas cov kab ncaj qha mus rau qhov tawg. Txuas lub micro: ntsis rau peb lub computer los ntawm USB cable. Qhib cov ntawv muab thiab nyem nws mus rau micro: me ntsis. Siv lub ntsuas saib lossis tus kws tshuaj xyuas, xyuas seb lub ntsuas cua puas muab cov ntaub ntawv tsim nyog. Txuas lub micro: me ntsis ntawm koj lub computer. Txuas lub roj teeb lossis LiPo rau micro: me ntsis. Nias khawm B, nyeem tus nqi Nyem khawm A. Nyem khawm B, nyeem tus nqi. Muab lub cuab yeej tso rau hauv ob txheej txheej ntawm lub hnab airtight, tawm tsuas yog huab cua tsawg heev hauv lub hnab. Nyob rau hauv rooj plaub, tso qhov hnyav kom them nyiaj quab yuam. Txheeb xyuas tias txhua yam yog dej tsis huv. Mus ua luam dej thiab ua si.
Kauj Ruam 5: Tsab Ntawv MicroPython
Tsab ntawv tsuas yog siv tus nqi siab los ntawm lub ntsuas pa, sib piv nws rau tus nqi siv, thiab tom qab ntawd suav qhov tob los ntawm qhov sib txawv. Txhawm rau tso tawm qhov tseem ceeb raws li kab duab kab, qhov sib ntxiv thiab seem ntawm qhov tob tob tau muab. Thawj zaug piav qhia qhov siab ntawm kab. Qhov seem tau tawg ua tsib lub thoob, uas piav qhia qhov ntev ntawm cov tuav. Qib sab saum toj yog 0 - 1 m, qis tshaj 4 - 5 m. As tau hais ua ntej, nias lub pob A teeb tsa qhov kev siv siab, khawm B qhia qhov "txheeb ze qhov tob" hauv metres, tso tawm ua tus lej. Txog tam sim no, qhov tsis zoo thiab qhov txiaj ntsig tau nthuav tawm raws li kab lus ntawm LED matrix tib yam nkaus. Koj tuaj yeem unmute qee cov kab los nthuav qhia qhov tseem ceeb ntawm tus saib xyuas lossis cov phiaj xwm ntawm Arduino IDE. Txhawm rau ua raws txoj haujlwm, koj tuaj yeem tsim lub cuab yeej uas kuv tau piav qhia hauv cov lus qhia yav dhau los.
Kuv tsis tau sau ib feem ntawm tsab ntawv uas nyeem lub sensor. Kuv tsis paub meej txog qhov chaw, tab sis kuv nyiam ua tsaug rau cov sau ntawv. Ib qho kev kho lossis lus qhia rau kev ua kom zoo siab txais tos.
#suav nrog
#suav nrog Adafruit_Microbit_Matrix microbit; #define BME280_ADDRESS 0x76 unsigned long int hum_raw, temp_raw, pres_raw; kos npe ntev int t_fine; uint16_t dig_T1; int16_t dig_T2; int16_t dig_T3; uint16_t dig_P1; int16_t dig_P2; int16_t dig_P3; int16_t dig_P4; int16_t dig_P5; int16_t dig_P6; int16_t dig_P7; int16_t dig_P8; int16_t dig_P9; int8_t dig_H1; int16_t dig_H2; int8_t dig_H3; int16_t dig_H4; int16_t dig_H5; int8_t dig_H6; ob npaug nias_norm = 1015; // tus nqi pib ob qhov tob; // xam qhov tob // -------------------------------------------- ----------------------------------------------------------------------- ---------------------- tsis muaj teeb meem teeb tsa () {uint8_t osrs_t = 1; // Kev ntsuas kub ntau x 1 uint8_t osrs_p = 1; // Siab oversampling x 1 uint8_t osrs_h = 1; // Vaum kev txheeb xyuas x 1 uint8_t hom = 3; // Hom qub uint8_t t_sb = 5; // Tstandby 1000ms uint8_t lim = 0; // Lim tawm uint8_t spi3w_en = 0; // 3-wire SPI Disable uint8_t ctrl_meas_reg = (osrs_t << 5) | (osrs_p << 2) | hom; uint8_t config_reg = (t_sb << 5) | (lim << 2) | spi3w_en; uint8_t ctrl_hum_reg = osrs_h; pinMode (PIN_BUTTON_A, INPUT); pinMode (PIN_BUTTON_B, INPUT); Serial.begin (9600); // teeb tsa qhov chaw nres nkoj ceev Serial.print ("Siab [hPa]"); // header rau cov lej tso tawm Wire.begin (); writeReg (0xF2, ctrl_hum_reg); writeReg (0xF4, ctrl_meas_reg); writeReg (0xF5, config_reg); readTrim (); // microbit.begin (); // microbit.print ("x"); ncua (1000); } // ------------------------------------------------------- ---------------------------------------------- tsis muaj lub voj () {ob npaug temp_act = 0.0, press_act = 0.0, hum_act = 0.0; kos npe ntev int temp_cal; unsigned ntev int press_cal, hum_cal; tus N; tus M; ob npaug nias_delta; // txheeb ze siab int tob_m; // qhov tob hauv metres, ib feem ob qhov tob_cm; // seem hauv cm readData (); // temp_cal = calibration_T (temp_raw); press_cal = calibration_P (pres_raw); // hum_cal = calibration_H (hum_raw); // temp_act = (ob npaug) temp_cal / 100.0; press_act = (ob npaug) press_cal / 100.0; // hum_act = (ob npaug) hum_cal / 1024.0; microbit.clear (); // rov pib dua LED matrix // Khawm A teeb tsa tus nqi tiag tiag raws li siv (P xoom) // Khawm B tso tawm tus nqi tam sim no raws li qhov tob hauv meters (suav los ntawm qhov sib txawv sib txawv) yog (! digitalRead (PIN_BUTTON_A)) {// teeb tsa huab cua ib txwm muaj li xoom press_norm = press_act; // microbit.print ("P0:"); // microbit.print (press_norm, 0); // microbit.print ("hPa"); microbit.fillScreen (LED_ON); // ntsais ib zaug kom paub meej ncua (100); } lwm tus yog (! digitalRead (PIN_BUTTON_B)) {// tso qhov tob hauv meters microbit.print (qhov tob, 2); microbit.print ("m"); // Serial.println (""); } lwm tus {// xam qhov tob los ntawm qhov sib txawv sib txawv press_delta = (press_act - press_norm); // xam qhov txheeb ze qhov tob = (press_delta/100); // qhov tob hauv meters qhov tob_m = int (abs (qhov tob))); // qhov tob im meters qhov tob_cm = (abs (qhov tob) - qhov tob_m); // seem /* // siv rau kev txhim kho Serial.println (qhov tob); Serial.println (qhov tob_m); Serial.println (tob_cm); */ // Cov kauj ruam rau kab lus yog (qhov tob_cm> 0.8) {// teeb tsa qhov ntev ntawm kab (N = 4); } lwm yog (qhov tob_cm> 0.6) {(N = 3); } lwm yog (qhov tob_cm> 0.4) {(N = 2); } lwm yog (tob_cm> 0.2) {(N = 1); } lwm {(N = 0); }
yog (qhov tob_m == 4) {// teeb tsa theem == meter
(M = 4); } lwm yog (depth_m == 3) {(M = 3); } lwm yog (tob_m == 2) {(M = 2); } lwm yog (tob_m == 1) {(M = 1); } lwm {(M = 0); // sab saud} /* // siv rau kev txhim kho lub hom phiaj Serial.print ("m:"); Serial.println (qhov tob_m); Serial.print ("cm:"); Serial.println (tob_cm); Serial.print ("M:"); Serial.println (M); // rau kev txhim kho lub hom phiaj Serial.print ("N:"); Serial.println (N); // rau kev txhim kho lub hom phiaj ncua (500); */ // kos kab lus microbit.drawLine (0, M, N, M, LED_ON); }
// xa tus nqi mus rau qhov chaw nres nkoj txuas rau cov phiaj xwm
Serial.print (nias_delta); // kos cov kab cim qhia thiab kho kom pom ntau yam Serial.print ("\ t"); Serial.print (0); Serial.print ("\ t"); Serial.print (-500); Serial.print ("\ t"); Serial.println (500); ncua (500); // Ntsuas ob zaug ib pliag} // ----------------------------------------- ----------------------------------------------------------------------- ----------------------------------------------------------------------- -------- // cov hauv qab no xav tau rau bmp/bme280 sensor, khaws raws li nws tsis muaj dab tsi readTrim () {uint8_t cov ntaub ntawv [32], i = 0; // Kho 2014/Wire.beginTransmission (BME280_ADDRESS); Hlau.write (0x88); Wire.endTransmission (); Wire.requestFrom (BME280_ADDRESS, 24); // Kho 2014/thaum (Wire.available ()) {data = Wire.read (); kuv ++; } Wire.beginTransmission (BME280_ADDRESS); // Ntxiv 2014/Wire.write (0xA1); // Ntxiv 2014/Wire.endTransmission (); // Ntxiv 2014/Wire.requestFrom (BME280_ADDRESS, 1); // Ntxiv 2014/cov ntaub ntawv = Wire.read (); // Ntxiv 2014/i ++; // Ntxiv 2014/Wire.beginTransmission (BME280_ADDRESS); Hlau.write (0xE1); Wire.endTransmission (); Wire.requestFrom (BME280_ADDRESS, 7); // Kho 2014/thaum (Wire.available ()) {data = Wire.read (); kuv ++; } dig_T1 = (data [1] << 8) | cov ntaub ntawv [0]; dig_P1 = (data [7] << 8) | cov ntaub ntawv [6]; dig_P2 = (cov ntaub ntawv [9] << 8) | cov ntaub ntawv [8]; dig_P3 = (data [11] << 8) | cov ntaub ntawv [10]; dig_P4 = (data [13] << 8) | cov ntaub ntawv [12]; dig_P5 = (data [15] << 8) | cov ntaub ntawv [14]; dig_P6 = (data [17] << 8) | cov ntaub ntawv [16]; dig_P7 = (cov ntaub ntawv [19] << 8) | cov ntaub ntawv [18]; dig_T2 = (cov ntaub ntawv [3] << 8) | cov ntaub ntawv [2]; dig_T3 = (cov ntaub ntawv [5] << 8) | cov ntaub ntawv [4]; dig_P8 = (cov ntaub ntawv [21] << 8) | cov ntaub ntawv [20]; dig_P9 = (cov ntaub ntawv [23] << 8) | cov ntaub ntawv [22]; dig_H1 = cov ntaub ntawv [24]; dig_H2 = (cov ntaub ntawv [26] << 8) | cov ntaub ntawv [25]; dig_H3 = cov ntaub ntawv [27]; dig_H4 = (data [28] << 4) | (0x0F & cov ntaub ntawv [29]); dig_H5 = (cov ntaub ntawv [30] 4) & 0x0F); // Txhim kho 2014/dig_H6 = cov ntaub ntawv [31]; // Kho 2014/} tsis muaj dab tsi sauReg (uint8_t reg_address, uint8_t cov ntaub ntawv) {Wire.beginTransmission (BME280_ADDRESS); Hlau.write (reg_address); Wire.write (cov ntaub ntawv); Wire.endTransmission (); } tsis muaj dab tsi readData () {int i = 0; uint32_t cov ntaub ntawv [8]; Wire.beginTransmission (BME280_ADDRESS); Hlau.write (0xF7); Wire.endTransmission (); Wire.requestFrom (BME280_ADDRESS, 8); thaum (Wire.available ()) {data = Wire.read (); kuv ++; } pres_raw = (cov ntaub ntawv [0] << 12) | (cov ntaub ntawv [1] 4); temp_raw = (cov ntaub ntawv [3] << 12) | (cov ntaub ntawv [4] 4); hum_raw = (cov ntaub ntawv [6] 3) - ((kos npe ntev int) dig_T1 11; var2 = (((((adc_T >> 4) - - (kos npe ntev int) dig_T1)) * ((adc_T >> 4) - ((kos npe ntev int) dig_T1))) >> 12) * ((kos npe ntev int) dig_T3)) >> 14; t_fine = var1 + var2; T = (t_fine * 5 + 128) >> 8; rov T; } unsigned ntev int calibration_P (kos npe ntev int adc_P) {kos npe ntev int var1, var2; unsigned ntev int P; var1 = (((kos npe ntev int) t_fine) >> 1) - (kos npe ntev int) 64000; var2 = (((var1 >> 2) * (var1 >> 2)) >> 11) * ((kos npe ntev int) dig_P6); var2 = var2 + ((var1 * ((kos npe ntev int) dig_P5)) 2) + (((kos npe ntev int) dig_P4) 2) * (var1 >> 2)) >> 13)) >> 3) + ((((kos npe ntev int) dig_P2) * var1) >> 1)) >> 18; var1 = ((((32768+var1)))*((kos npe ntev int) dig_P1)) >> 15); yog (var1 == 0) {rov qab 0; } P = (((unsigned ntev int) (((kos npe ntev int) 1048576) -adc_P)-(var2 >> 12)))*3125; yog (P <0x80000000) {P = (P << 1) / ((unsigned ntev int) var1); } lwm {P = (P / (unsigned ntev int) var1) * 2; } var1 = (((kos npe ntev int) dig_P9) * ((kos npe ntev int) (((P >> 3) * * (P >> 3)) >> 13))) >> 12; var2 = (((kos npe ntev int) (P >> 2)) * ((kos npe ntev int) dig_P8)) >> 13; P = (unsigned ntev int) ((kos npe ntev int) P + ((var1 + var2 + dig_P7) >> 4)); rov P; } unsigned ntev int calibration_H (kos npe ntev int adc_H) {kos npe ntev int v_x1; v_x1 = (t_fine - ((kos npe ntev int) 76800)); v_x1 = ((((adc_H << 14) -((kos npe ntev int) dig_H4) 15) * ((((((v_x1 * ((kos npe ntev int) dig_H6)) >> 10) * (((v_x1 * ((kos npe ntev int) dig_H3)) >> 11) + ((kos npe ntev int) 32768))) >> 10) + ((kos npe ntev int) 2097152)) * ((kos npe ntev int) dig_H2) + 8192) >> 14)); v_x1 = (v_x1 - ((((((v_x1 >> 15) * * (v_x1 >> 15)) >> 7) * ((kos npe ntev int) dig_H1)) >> 4)); v_x1 = (v_x1 419430400? 419430400: v_x1); rov qab (unsigned ntev int) (v_x1 >> 12);
Kauj Ruam 6: Qhov Yooj Yim Yooj Yim: MakeCode/JavaScript Code
Thaum lub Tsib Hlis xyoo 2018, Pimoroni tau tshaj tawm qhov enviro: me ntsis, uas los nrog BME280 siab/av noo/ntsuas qhov ntsuas, TCS3472 lub teeb thiab xim xim thiab MEMS lub microphone. Ib qho ntxiv lawv tau muab lub tsev qiv ntawv JavaScript rau MakeCode tus kho thiab MicroPython lub tsev qiv ntawv rau cov ntsuas no.
Kuv tau siv lawv lub tsev qiv ntawv MakeCode los tsim cov ntawv sau rau kuv lub cuab yeej. Txuas nrog koj pom cov ntaub ntawv hex, uas koj tuaj yeem luam ncaj qha rau koj lub micro: me ntsis.
Hauv qab no koj pom cov lej JavaScript sib thooj. Kev xeem hauv pas dej ua haujlwm tau zoo nrog tsab ntawv ua ntej, yog li kuv xav tias lawv yuav ua haujlwm ib yam. Ntxiv nrog rau qhov yooj yim, kab lus kab lus, kuj tseem muaj cov ntoo khaub lig kab (X) thiab L-version, npaj kom nyeem tau yooj yim dua, tshwj xeeb tshaj yog nyob rau qhov teeb pom kev qis. Xaiv qhov koj nyiam.
cia Kab = 0
cia Meter = 0 cia nyob twj ywm = 0 cia Row = 0 cia Delta = 0 cia Ref = 0 cia Yog = 0 Yog = 1012 basic.showLeds (` # # # # # # …. # #. #. #…. # # # # # # # `) Ref = 1180 basic.clearScreen () basic.forever (() => {basic.clearScreen () yog (input.buttonIsPressed (Button. A)) {Ref = envirobit.getPressure () basic.showLeds (` #. #. #. #. #. #. #. #. #. #. #. #. #. #. #. #` `basic.pause (1000)} lwm tus yog (input.buttonIsPressed (Button B.)) {basic.showString ("" + Kab + "." + nyob twj ywm + "m") basic.pause (200) basic.clearScreen ()} lwm qhov {Yog = envirobit.getPressure () Delta = Yog - Ref Meter = Lej.abs (Delta) if (Meter> = 400) {Row = 4} else if (Meter> = 300) {Kab = 3} else if (Meter> = 200) {Row = 2} else if (Meter> = 100)) {Kab = 1} lwm {Kab = 0} nyob = Meter - Kab * 100 yog (tseem nyob = = 80) {Kab ntawv = 4} lwm qhov yog (tseem nyob> = 60) {Kab = 3} ntxiv yog (tseem nyob = = 40) {Kab ntawv = 2} lwm qhov yog (tseem nyob> = 20) {Kab ntawv = 1} lwm qhov {Kab ntawv = 0} rau (cia ColA = 0; ColA <= Kab ntawv; ColA ++) {led.plot (C olA, Kab)} basic.pause (500)}})
Kauj Ruam 7: Enviro: ntsis Version
Lub sijhawm no kuv tau txais tus enviro: ntsis (20 GBP) thiab lub zog: ntsis (6 GBP), ob qho tib si los ntawm Pimoroni.
Raws li tau hais ua ntej, qhov xwm txheej: me ntsis los nrog BME280 siab, av noo thiab ntsuas kub, tab sis kuj yog lub teeb thiab xim xim (saib daim ntawv thov ntawm no) thiab MEMS lub microphone.
Lub zog: me ntsis yog qhov kev daws teeb meem zoo rau lub zog micro: me ntsis thiab los nrog kev hloov/qhib.
Qhov zoo tshaj plaws yog tias nws ob qho tib si tsuas yog nyem thiab siv, tsis muaj qhov txuas, cov xov hlau, cov laug cam. Ntxiv cov enviro: ntsis rau micro: ntsis, ntsaws koj cov cai rau micro: ntsis, siv nws.
Hauv qhov no kuv tau siv micro, lub zog thiab lub zog: me ntsis, muab tso rau hauv lub hnab Ziploc, muab tso rau hauv lub hnab dej ntshiab ntim cov hnab yas rau cov xov tooj ntawm tes, npaj tau. Kev daws sai heev thiab huv si. Saib cov duab. Qhov hloov pauv loj txaus siv nws los ntawm kev tiv thaiv txheej.
Nws tau raug sim hauv dej, ua haujlwm tau zoo. Ntawm qhov tob ntawm kwv yees li 1.8 m tus nqi ntsuas yog kwv yees li 1.7 m. Tsis zoo rau kev yoo mov & pheej yig daws, tab sis deb ntawm qhov ua tau zoo. Nws yuav siv sijhawm me ntsis los kho, yog li koj yuav tsum tau nyob ntawm qhov tob ntawm li 10-15 feeb.
Kauj ruam 8: Cable thiab Sensor sojntsuam Version
Qhov no yog thawj lub tswv yim uas tau muaj rau micro: qhov tob tob ntsuas, qhov kawg yuav tsum tau tsim.
Ntawm no kuv tau siv lub ntsuas BMP280 rau 5m ntawm 4-xaim cable thiab tso poj niam jumper ntawm lwm qhov kawg. Txhawm rau tiv thaiv lub ntsuas hluav taws xob los ntawm dej, txoj hlua tau khiav los ntawm kev siv cawv cork. Qhov kawg ntawm lub cork raug kaw nrog cov kua nplaum kub. Ua ntej kuv tau txiav ob lub thais rau hauv lub cork, ob qho tib si mus ncig nws. Tom qab ntawd kuv ntim lub ntsuas mus rau hauv lub pob daim txhuam cev, tso ib lub zais pa nyob ib puag ncig nws thiab kho qhov kawg ntawm lub zais pa ntawm lub cork (qis qis dua). tom qab ntawd kuv tau tso 3 40 g cov hmoov txhuas hnyav rau hauv lub zais pa thib ob, qhwv nws ib puag ncig thawj qhov, qhov hnyav tau muab tso rau sab nraud, thiab kho qhov kawg ntawm lub zais pa ntawm qhov thib ob. Cov cua tau raug tshem tawm ntawm lub zais pa thib ob, tom qab ntawd txhua yam raug kho nrog kab xev. Saib cov duab, cov ncauj lus kom ntxaws yuav ua raws.
Cov dhia tau txuas nrog lub micro: me ntsis ntawm qhov txuas txuas, lub cuab yeej hloov pauv thiab siv qhov ntsuas siab tau teeb tsa. Tom qab ntawd lub taub hau sensor tau tso tawm qeeb rau hauv qab ntawm lub pas dej (10 m dhia ntauwd, txog 4.5 m tob).
Cov txiaj ntsig:
Ua rau kuv xav tsis thoob, nws ua haujlwm txawm tias nrog cov kab ntev no. Ntawm qhov tod tes, tab sis tsis xav tsis thoob, qhov ntsuas yuam kev zoo li ua rau loj dua ntawm kev sib zog siab, thiab kwv yees qhov tob ntawm 4 m tau tshaj tawm txog li 3 m.
Tej zaum daim ntawv thov:
Nrog qee qhov kev kho yuam kev, lub cuab yeej tuaj yeem siv los ntsuas qhov tob txog 4 m.
Ua ke nrog Arduino lossis Raspberry Pi, qhov no tuaj yeem siv los ntsuas thiab tswj cov chaw ntim ntawm lub pas dej lossis lub taub dej, e, g. kom tshaj tawm ceeb toom yog tias cov qib dej mus siab dua lossis qis dua qee qhov pib
Khiav Tawm Hauv Kev Tawm Tsam Sab Nraud Sab Nraud
Pom zoo:
Yuav Ua Li Cas Siv Servo Motors Siv Moto: ntsis Nrog Micro: ntsis: 7 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Siv Servo Motors Siv Moto: ntsis Nrog Micro: ntsis: Ib txoj hauv kev txuas ntxiv kev ua haujlwm ntawm micro: ntsis yog siv lub rooj tsav xwm hu ua moto: ntsis los ntawm SparkFun Electronics (kwv yees li $ 15-20). Nws zoo li nyuaj thiab muaj ntau yam ntxwv, tab sis nws tsis nyuaj rau kev ua haujlwm servo motors los ntawm nws. Moto: me ntsis tso cai rau koj
Kauj Ruam Tus Kheej - Micro: Ntsis: 12 Kauj Ruam (nrog Duab)
Step Counter - Micro: Bit: Txoj haujlwm no yuav yog cov kauj ruam ntsuas. Peb yuav siv lub ntsuas qhov ntsuas cua uas tau tsim rau hauv Micro: Bit los ntsuas peb cov kauj ruam. Txhua lub sijhawm Micro: Me ntsis co peb yuav ntxiv 2 rau suav thiab tso tawm ntawm lub vijtsam
Micro: ntsis - Micro Drum Machine: 10 Kauj Ruam (nrog Duab)
Micro: ntsis - Micro Drum Machine: Nov yog lub tshuab micro: me ntsis lub tshuab nruas, uas tsis yog tsuas yog tsim lub suab, ua suab nrov. Nws yog qhov kev tshoov siab hnyav los ntawm luav los ntawm micro: me ntsis orchestra. Nws coj kuv qee lub sijhawm los nrhiav qee qhov solenoids uas yooj yim siv nrog mocro: ntsis
Kev ntsuas lub teeb thiab xim Nrog Pimoroni Enviro: ntsis rau Micro: ntsis: 5 Kauj Ruam
Kev ntsuas lub teeb thiab xim Nrog Pimoroni Enviro: me ntsis rau Micro: me ntsis: Kuv tau ua haujlwm ntawm qee lub cuab yeej uas tso cai ntsuas lub teeb thiab xim yav dhau los thiab koj yuav pom ntau txog qhov kev xav tom qab kev ntsuas ntsuas cov lus qhia ntawm no thiab ntawm no.Pimoroni muaj tsis ntev los no tso tawm enviro: me ntsis, ntxiv rau
DIY MusiLED, Music Synchronized LEDs Nrog Ib-nias Windows & Linux Application (32-ntsis & 64-ntsis). Yooj Yim Rov Ua Dua, Siv Yooj Yim, Yooj Yim rau Chaw Nres Nkoj: 3 Kauj Ruam
DIY MusiLED, Music Synchronized LEDs Nrog Ib-nias Windows & Linux Application (32-ntsis & 64-ntsis). Yooj Yim Rov Ua Dua, Siv Yooj Yim, Yooj Yim rau Chaw Nres Nkoj: Qhov haujlwm no yuav pab koj txuas 18 LEDs (6 Liab + 6 Xiav + 6 Daj) rau koj lub Rooj Tswjhwm Saib Arduino thiab txheeb xyuas koj lub khoos phis tawj Lub Suab Suab Lub suab lub sijhawm tiag tiag thiab xa lawv mus rau cov LEDs kom pom lawv raws li qhov cuam tshuam (Snare, High Hat, Kick)