Cov txheej txheem:

Sib tham sib Glowing Mushroom: 10 Kauj Ruam (nrog Duab)
Sib tham sib Glowing Mushroom: 10 Kauj Ruam (nrog Duab)

Video: Sib tham sib Glowing Mushroom: 10 Kauj Ruam (nrog Duab)

Video: Sib tham sib Glowing Mushroom: 10 Kauj Ruam (nrog Duab)
Video: Muab hwm ntoo laus muag mus kho poj ruam 9/10/2023 2024, Kaum ib hlis
Anonim
Image
Image
Sib tham sib Glowing Mushroom
Sib tham sib Glowing Mushroom
Sib tham sib Glowing Mushroom
Sib tham sib Glowing Mushroom

Cov lus qhia no yuav qhia koj yuav ua li cas ua cov nceb uas yuav ci hauv qhov tsaus ntuj. Koj tuaj yeem tua cov nceb ib leeg thiab rov ua dua los ntawm nias saum toj.

Kuv pib qhov haujlwm no rau kev ua haujlwm hauv tsev kawm ntawv uas peb yuav tsum tsim qee yam siv Arduino Uno.

Kuv xav tsim qee yam zoo nkauj thiab ntxim nyiam thiab txiav txim siab sai tias kuv xav ua cov nceb ci. Thaum xub thawj, kuv xav tsis tsuas yog ua rau lawv ci, tab sis kuj tseem kom lawv txav mus thiab ua suab paj nruag. Txawm li cas los xij, vim yog lub sijhawm kawg rau txoj haujlwm, kuv yuav tsum muab cov tswv yim ntawd pov tseg.

Txoj haujlwm no tau tshoov siab los ntawm DIY perks 'video:

Ntawm no koj yuav pom cov txheej txheem kuv tau hla los tsim cov teeb no, nrog rau cov lus qhia yuav ua li cas.

Rau qhov haujlwm no, koj yuav xav tau:

  • Ib Arduino Uno;
  • Ib lub khob cij;
  • Ib daim txiag ntoo;
  • 5 LEDs los ntawm neopixel LEDstrip;
  • 5 siab Sensors;
  • Lub teeb sensor;
  • A 470Ω resistor;
  • 6 resistors ntawm txhua tus nqi;
  • Nyuaj hlau (tsis yog-coj!);
  • Pob tshab silicone sealer;
  • Xim dej xim;
  • Cling zaj duab xis
  • Ntoo cav;
  • Laum;
  • Chisel thiab rauj;
  • Cov xov hlau hauv ob peb xim;
  • Daim kab xev hluav taws xob;
  • Lwm yam, daim kab xev muaj zog;
  • Kub kua nplaum;
  • Ntsws lub raj;
  • Rab phom cua sov;
  • Lub chaw nres tsheb soldering;
  • Pliers;
  • ntaub so ntswg;
  • Tes ruaj khov thiab siv sijhawm ntau thiab ua siab ntev;

Kauj Ruam 1: Tswv Yim Tsim

Tswv Yim Tsim
Tswv Yim Tsim
Tswv Yim Tsim
Tswv Yim Tsim

Kuv yuav luag tam sim paub tias kuv xav ua dab tsi rau txoj haujlwm no. Txij li thaum kuv tau xav ua cov nceb ci rau ib pliag, kuv xav tias qhov no yog lub sijhawm zoo tshaj plaws los ua li ntawd. Kom tau txais lub tswv yim me ntsis ntawm cov thev naus laus zis tom qab cov nceb, Kuv tau kos tawm seb kuv yuav ua li cas. Nov yog ib kauj ruam tseem ceeb hauv kuv txheej txheem, vim li no kuv thiaj tuaj yeem pom qhov kho vajtse thiab txheeb cov khoom hauv kuv lub taub hau. Thaum kawg, tus qauv hloov pauv me ntsis (Kuv tso lub LED saum lub siab ntsuas, ntxiv xaim xaim nias rau ntawm lub sensor thiab tuav lub nceb saum toj kawg nkaus thiab kuv tshem tawm cov khoom txav thiab lub suab).

Ua ntej pib txoj haujlwm no kuv tsis muaj kev paub dhau los nrog Arduino thiab tsuas yog paub yuav ua li cas tus lej me ntsis hauv Python, yog li kuv tau ua qee qhov kev tshawb fawb. Kuv kwv yees paub tias kuv yuav xav tau dab tsi rau kuv qhov haujlwm, yog li kuv tau tshawb hauv internet thiab pib sim nrog cov cai. Kuv tau khiav nrawm mus rau teeb meem nrog kuv cov servo's (uas kuv xav siv los ua kom cov nceb txav mus), yog li kuv txiav txim siab tso lub tswv yim ntawd. Tom qab ntawd, thaum kuv pom kuv xav tau sijhawm ntau dua li kuv xav thawj zaug los txiav txim siab yuav ua li cas thiaj li yuav tsum tau ua dab tsi kuv xav tau thiab hollow tawm tsob ntoo cav, Kuv kuj txiav txim siab tso lub suab paj nruag lub tswv yim thiab tsuas yog lo nrog cov nceb xwb.

Kuv kuj tau pom tias nws yuav yog lub tswv yim zoo los tso lub siab ntsuas hauv qab LED, yog li tsis muaj lub teeb yuav raug thaiv los ntawm lub ntsuas.

Kauj ruam 2: Npaj Log

Npaj Cov Log
Npaj Cov Log
Npaj Cov Log
Npaj Cov Log
Npaj Cov Log
Npaj Cov Log

Ib qho ntawm cov haujlwm uas siv sijhawm ntau tshaj plaws ntawm txoj haujlwm no yog hollowing tawm lub cav. Kuv xav qhia ib qho los ntawm ib hom ntoo uas yooj yim ua haujlwm (tsis zoo li kuv), lossis yuav ib lub cav uas twb tau hollowed tawm lawm.

Yog tias koj xav hollow tawm koj tus kheej lub cav, koj tuaj yeem hlawv qhov hauv lossis siv txoj hauv kev uas kuv tau siv. Rau kuv txoj kev koj yuav xav tau lub laum, txov, rauj, thiab ua siab ntev ntau.

Ua ntej koj pib drilling, koj yuav tsum xav txog kev deb npaum li cas koj xav hollow tsob ntoo tawm. Nco tseg: Yog tias koj tshem ntoo ntau dua, txoj haujlwm yuav ua rau hnyav dua, tab sis kuj tsis muaj zog.

Thaum koj paub ntau npaum li cas koj xav mus tob, koj tuaj yeem pib qhov qhov. Tshem tawm cov ntoo nyob nruab nrab ntawm qhov siv qhov txua ntoo thiab tus rauj. Rov ua cov txheej txheem no kom txog thaum koj txaus siab.

Nco ntsoov tias sab ntawm lub cav nrog lub qhov nyob hauv nws yuav yog hauv qab!

Tam sim no koj yuav tsum tawm tswv yim tawm qhov twg koj xav tau koj cov nceb, lub teeb pom kev zoo thiab lub zog txuas mus thiab tho qhov los ntawm sab nraud mus rau sab hauv ntawm lub cav ntawm cov chaw ntawd. Kuv pom zoo tso lub teeb pom kev deb ntawm cov nceb, vim tias yog nws kaw lub teeb dhau los ntawm cov nceb yuav cuam tshuam nrog qhov txiaj ntsig ntawm lub ntsuas.

Kauj Ruam 3: Ua Kom Nceb Caps

Ua Kom Nceb Caps
Ua Kom Nceb Caps
Ua Kom Nceb Caps
Ua Kom Nceb Caps

Rau lub kaus mom nceb koj yuav xav tau pob tshab silicone foob, pleev xim rau xim, tso zaj duab xis, ib yam dab tsi los sib xyaw nrog thiab muab cov khoom puag ncig (lossis cov ntaub so ntswg tawg).

sib tov dollop ntawm silicone nrog me ntsis xim dej xim. Kuv xaiv dawb, yog li kuv tseem tuaj yeem muab kuv cov nceb rau xim twg kuv xav siv cov xim ntawm LEDs, tab sis yog tias koj tsuas xav tau ib xim koj tuaj yeem ua rau nws hnyav dua los ntawm kev ua cov nceb uas tib xim.

Tom ntej no, muab cov silicone tso rau ntawm ib daim yeeb yaj kiab thiab muab cov yeeb yaj kiab tso rau saum nws, yog li cov silicone tau sib xyaw hauv nruab nrab. Tua cov silicone siv koj txhais tes, kom txog thaum nws muaj cov tuab tuab dua. Koj tuaj yeem tuav nws mus txog qhov pom kev kom tau txais lub tswv yim tias nws yuav zoo li cas. Xyuas kom koj ua lub kaus mom loj txaus rau koj lub LEDs thiab lub ntsuas qhov ntsuas kom haum rau hauv!

Muab cov yeeb yaj kiab tso rau ntawm qhov khoom puag ncig thiab tso nws kom qhuav.

Thaum nws tau qhuav tag nrho koj tuaj yeem tshem nws tawm ntawm cov yeeb yaj kiab, tshem tawm ib qho kev nkag mus ib ncig ntawm cov npoo yog xav tau thiab koj lub hau nceb ua tiav.

Kauj Ruam 4: Txuas cov LEDs

Txuas cov LEDs
Txuas cov LEDs
Txuas cov LEDs
Txuas cov LEDs
Txuas cov LEDs
Txuas cov LEDs

Thaum koj lub kaus mom nceb qhuav, koj tuaj yeem pib npaj cov khoom siv kho vajtse, pib nrog LEDs. Txhawm rau npaj cov LEDs, koj yuav tsum ua cov hauv qab no:

  1. Txiav thiab sawb 9 lub xov tooj liab, 9 lub xov tooj dub (Kuv siv xiav hloov nrog qee qhov LEDs vim tsis muaj xaim dub) thiab 9 lub xov tooj hauv xim uas koj xaiv (cov no yuav yog cov xov hlau siv rau cov ntaub ntawv). Xyuas kom tseeb tias koj cov kab hluav taws xob ntev txaus los ntawm hauv qab ntawm koj cov ntoo ntoo txhua txoj kev mus rau saum thiab txawm tias tawm me ntsis. Nws zoo dua los ua kom lawv ntev dua li luv dua
  2. Txiav 5 LEDs tawm ntawm koj cov hlua coj.
  3. Muab cov hlua dub txuas rau hauv cov pins hauv av ntawm LEDs. Ib txoj kab ntawm txhua sab ntawm LED. Rov ua dua nrog cov kab liab rau tus pin 5-volt ntawm LEDs thiab nrog lwm cov xov txuas rau tus pin cov ntaub ntawv. Koj yuav muaj ib qho LED nrog cov xov nyob ntawm ib sab, qhov no yuav yog qhov thib tsib thiab kawg LED thiab yog li ntawd yuav tsis xav tau lwm peb kab. Ntawm LEDs, koj yuav pom cov xub taw qhia rau hauv ib qho kev taw qhia. Siv tus cim ruaj khov los cim qhov kawg ntawm cov xov hlau nyob ntawm sab xub xub los. Qhov no tseem ceeb heev vim koj yuav xav tau nws tom qab!
  4. Txhawm rau tiv thaiv cov xov hlau thiab tiv thaiv lawv los ntawm kev sib chwv ib leeg, txiav tawm cov raj me me, tso lawv hla cov xov hlau uas nthuav tawm thiab siv rab phom kub los ua kom lawv nqaim.
  5. Thaum kawg, ntswj cov kab ua ke raws li qhia hauv daim duab.

Nco tseg: Yog tias koj xav tau, koj tuaj yeem tshem cov yas npog ntawm LEDs, tab sis kuv xav kom tawm nws los tiv thaiv LED.

Kauj Ruam 5: Ntxiv Cov Ntshav Siab

Ntxiv Kev Ntsuas Siab
Ntxiv Kev Ntsuas Siab
Ntxiv Kev Ntsuas Siab
Ntxiv Kev Ntsuas Siab
Ntxiv Kev Ntsuas Siab
Ntxiv Kev Ntsuas Siab

Hauv qab ntawm LEDs, peb yuav tso lub ntsuas siab.

Txhawm rau npaj lawv koj yuav tsum ua cov hauv qab no:

1. Txiav ib ncig 15cm ntawm cov xaim xaim (xyuas kom nws tsis siv hluav taws xob!) Kuv tau siv cov hlau xaim;

2. Twist cov hlau mus rau hauv qhov muab kauv raws li qhia hauv daim duab;

3. Kaw ib sab ntawm cov kauv mus rau qhov ntsuas siab (Kuv siv superglue los ua qhov no, tab sis cov kua nplaum yuav ua)

4. Ua kom ntseeg tau tias lub ntsuas hluav taws xob haum hauv qab cov LEDs. Yog tias lawv tsis ua, koj tuaj yeem khoov cov xov hlau ntawm LEDs kom ua kom haum.

5. Muab lub ntsuas hluav taws xob tso rau hauv qab cov LEDs, kom muaj LED nyob hauv nruab nrab ntawm cov xov hlau. Saib cov duab rau siv.

6. Yog tias peb xav kom lub ntsuas hluav taws xob ua haujlwm kom raug, peb yuav tsum ua qee yam los tuav lawv thaum koj nias ntawm cov xov hlau. Txhawm rau ua li ntawd, Kuv tau muab daim kab xev nruab nrab ntawm cov kab hluav taws xob hauv qab lub siab ntsuas.

Tom ntej no, peb yuav tsum tau txuas cov xov hlau rau lub siab ntsuas. (Koj tseem tuaj yeem ua cov kauj ruam no ua ntej koj ua tag nrho lwm tus, tab sis kuv tau ua nws hauv qhov kev txiav txim no)

7. Txiav tawm thiab hle 15 kab: 5 rau hauv av, 5 rau cov ntaub ntawv thiab 5 rau 5-volt. Kuv xav kom siv cov xim sib txawv rau cov no ntau dua li koj siv rau LEDs. Kuv siv Txiv kab ntxwv, ntsuab thiab txho.

8. Solder cov xov hlau rau cov ntaub ntawv thiab 5-volt rau lub siab ntsuas. Peb yuav siv cov xaim av thaum ntxiv cov tiv thaiv (hauv cov kauj ruam tom ntej)

NCO TSEG: Koj kuj yuav xav ntxiv qee cov hlau xaim rau cov xaim hlau no ib yam. Qhov no yuav ua rau cov qia nce ntxiv me ntsis ntxiv dag zog thaum kawg. Kuv tsis tau ua qhov no vim tias kuv tsis paub tias hnyav npaum li cas nceb yuav kawg.

Kauj Ruam 6: Lub Teeb Sensor thiab Cov Tiv Thaiv

Lub teeb Sensor thiab Resistors
Lub teeb Sensor thiab Resistors
Lub teeb Sensor thiab Resistors
Lub teeb Sensor thiab Resistors
Lub teeb Sensor thiab Resistors
Lub teeb Sensor thiab Resistors

Hauv theem no, peb yuav npaj lub teeb pom kev zoo thiab ntxiv cov tiv thaiv qhov xav tau.

Peb yuav pib nrog lub teeb sensor:

1. Ib zaug ntxiv, txiav thiab txua hlau rau hauv av, cov ntaub ntawv thiab ib qho rau 5-volt.

2. Solder cov hlau rau cov ntaub ntawv thiab 5-volt rau lub teeb pom kev zoo.

Tam sim no, peb yuav ntxiv txhua tus tiv thaiv.

Rau cov ntsuas siab thiab lub teeb pom kev zoo koj yuav tsum ua cov hauv qab no:

1. Txiav cov xaim av hauv ib nrab, hle txhua qhov kawg ntawm xaim thiab muab cov khoom tiv thaiv nruab nrab ntawm ob qho kawg. Nws tsis muaj teeb meem dab tsi tus nqi ntawm tus tiv thaiv yog. Siv lub raj ntswj hla tag nrho cov resistor yog li nws tau tiv thaiv thiab ruaj khov nyob hauv cov hlau.

2. Tom ntej no, ua tib zoo txiav cov roj hmab/yas hauv kwv yees li ib nrab ntawm cov ntaub ntawv xov hlau los nthuav tawm me ntsis ntawm cov xov tooj tiag, lossis txiav cov ntaub ntawv xov hlau ib nrab, ib zaug ntxiv ib txoj hlua ib sab thiab muab lawv rov ua ke.

3. Siv cov xaim av hauv av nrog tus tiv thaiv sab hauv kom nthuav tawm cov xaim ntawm cov ntaub ntawv xov hlau raws li qhia hauv daim duab. Txhawm rau npog cov xov hlau nthuav tawm siv cov kab xev hluav taws xob lossis cov raj nqaim (nco ntsoov muab qee qhov ntawm cov xaim ua ntej yuav siv tau!)

Rau cov LEDs, peb tsuas xav tau ib tus tiv thaiv.

1. Xaiv ib qho ntawm cov xaim hluav taws xob LED uas koj nyuam qhuav tsim (Kuv xav hais kom xaiv ib qho nrog cov xov hlau ntev tshaj plaws, txij li qhov no yuav mus rau qhov deb tshaj ntawm tsob ntoo cav) nco tseg: tsis txhob xaiv LED nrog cov xov hlau nyob ntawm ib sab xwb! Qhov no yuav yog qhov kawg ntawm 5!

2. Ntxiv 470Ω resistor rau cov ntaub ntawv xov hlau ntawm qhov LED tib yam koj tau ua nrog lub ntsuas qhov ntsuas thiab lub teeb pom kev zoo.

3. Ib zaug ntxiv, tseem siv cov raj ntsws los tiv thaiv thiab tiv thaiv tus tiv thaiv.

Kauj Ruam 7: Ua cov Stem

Ua Stem
Ua Stem
Ua Stem
Ua Stem
Ua Stem
Ua Stem
Ua Stem
Ua Stem

Txhawm rau ua cov qia, peb yuav tsum xub txiav txim siab seb peb xav kom lawv ntev npaum li cas:

1. Rub cov kab hluav taws xob LED txuas los ntawm lub qhov uas koj tsim hauv tsob ntoo cav.

2. Ua si me ntsis nrog qhov ntev ntawm txoj hlua txuas mus txog thaum koj txaus siab rau txoj kev nws zoo li. Yog tias koj xav tau lub tswv yim me ntsis seb nws yuav zoo li cas, koj tuaj yeem tso lub kaus mom silicone ntim rau lawv.

3. Thaum koj txaus siab, khij qhov chaw ntawm kab xaim uas nws nkag mus rau hauv lub cav siv tus cim ruaj khov.

4. Nqa cov kab txuas tawm dua thiab siv qee daim kab xev kom ntseeg tau tias cov xov hlau nyob ruaj khov ua ke.

Tam sim no rau ntu uas peb tau ua cov qia:

1. Xim cov xov hlau tib xim li koj cov nceb. Kuv yuav hais kom pleev xim me ntsis ntxiv qis dua qhov koj xav kom koj cov qia mus, tsuas yog kom paub tseeb.

2. Sib tov ua ke pob tshab silicone foob nrog cov xim pleev xim tib yam li koj tau ua nrog lub kaus mom nceb.

3. Muab cov xim silicone tso rau ntawm ib daim ntawv nplaum zaj duab xis thiab muab ib txoj hlua khi tso rau saum nws. Xyuas kom tseeb tias silicone nyob nruab nrab ntawm qhov chaw koj xav kom lub qia nyob ntawm cov xov hlau.

4. Quav cov yeeb yaj kiab tso rau hauv ib nrab nrog cov quav kom ze rau cov xaim hlau ntau li ntau tau.

5. Nyem cov silicone tiv thaiv cov xaim xaim thiab ua si ib puag ncig nrog nws kom txog thaum cov xov hlau uas koj xav kom cov qia mus tau npog tag. Nco tseg: Nws yog lub tswv yim zoo kom coj cov silicone tuaj siab li koj tuaj yeem ua tau, tab sis tsis txhob npog qhov ntsuas qhov ntsuas siab.

6. Rov ua cov txheej txheem nrog rau lwm 4 cov xaim xaim thiab tso lawv kom qhuav.

Kauj Ruam 8: Xeem (thiab Txoj Cai)

Kev Xeem (thiab Txoj Cai)
Kev Xeem (thiab Txoj Cai)
Kev Xeem (thiab Txoj Cai)
Kev Xeem (thiab Txoj Cai)

Ua ntej soldering txhua yam ua ke, tej zaum koj yuav xav sim yog tias koj cov khoom tseem ua haujlwm.

Siv lub khob cij los txuas rau txhua lub pob khoom LED sai thiab lub teeb pom kev zoo thiab xa cov cai rau koj Arduino txhawm rau txheeb xyuas yog tias txhua yam tseem ua haujlwm. Nco ntsoov tias koj yuav tsum tau kho qhov ntsuas ntawm cov ntsuas rau koj qhov project.

NCO TSEG: Kuv tsis muaj kev paub nrog coding, yog li qhov no tsis yog txoj hauv kev zoo tshaj plaws los ua nws nyob deb. Nws yuav zoo dua los siv ntau txoj haujlwm thiab ua haujlwm sib txawv ntawm LEDs los ntawm lawv. Kuv tau sim ua qhov haujlwm no, tab sis thaum kawg txiav txim siab ua nws txoj hauv kev yooj yim dua, tsis muaj txiaj ntsig zoo, vim tias kuv tau siv sijhawm ntau dhau ntawm txoj cai thiab yuav tsum txav mus.

Cov cai:

#define NUM_LEDS 5

#define DATA_PIN 6

CRGB coj [NUM_LEDS];

// LED 0 NPE

int inPinPressureSensor0 = A0;

int ledState0 = HIGH;

ntab siabReading0;

ntab siabPrevious0 = LOW;

// LED teeb 1

int inPinPressureSensor1 = A1;

int ledState1 = HIGH;

ntab siabReading1;

ntab siabPrevious1 = LOW;

// LED teeb 2

int hauvPinPressureSensor2 = A2;

int ledState2 = HIGH;

ntab siabReading2; ntab siabPrevious2 = LOW;

// LED 3

int hauvPinPressureSensor3 = A3;

int ledState3 = HIGH;

ntab siabReading3;

ntab siabPrevious3 = QIB;

// LED teeb 4

int inPinPressureSensor4 = A4;

int ledState4 = HIGH;

ntab siabReading4;

ntab siabPrevious4 = QIB;

// Lub teeb sensor

int inPinLightSensor = A5;

Nyeem teeb; Nyeem;

Lub teeb ntab

void teeb tsa ()

{

Serial.begin (9600);

FastLED.addLeds (leds, NUM_LEDS);

// siab sensor LED 0

pinMode (inPinPressureSensor0, INPUT);

// siab sensor LED 1

pinMode (inPinPressureSensor1, INPUT);

// siab sensor LED 2

pinMode (inPinPressureSensor2, INPUT);

// siab sensor LED 3

pinMode (inPinPressureSensor3, INPUT);

// siab sensor LED 4

pinMode (inPinPressureSensor4, INPUT);

// Lub teeb sensor

pinMode (inPinLightSensor, INPUT);

}

void lub voj ()

{

// siabReading LED 0

siabReading0 = analogRead (inPinPressureSensor0);

ncua (20);

// siabReading LED 1

pressureReading1 = analogRead (inPinPressureSensor1);

ncua (20);

// siabReading LED 2

pressureReading2 = analogRead (inPinPressureSensor2);

ncua (20);

// siabReading LED 3

pressureReading3 = analogRead (inPinPressureSensor3);

ncua (20);

// siabReading LED 4

pressureReading4 = analogRead (inPinPressureSensor4);

ncua (20);

// Lub teeb sensor

lightReading = analogRead (inPinLightSensor);

// Yog tias nws yog lub teeb, LED tawm.

yog (lub teeb Nyeem> 28.0)

{

ledState0 = QAB;

ledState1 = QAB;

ledState2 = LOW;

ledState3 = QAB;

ledState4 = LOW;

}

// Yog tias nws tsaus ntuj thiab nws yog lub teeb yav tas los, LED yuav qhib.

yog (lub teeb Nyeem 28.0)

{

ledState0 = HIGH;

ledState1 = HIGH;

ledState2 = HIGH;

ledState3 = HIGH;

ledState4 = HIGH;

}

// yog siab sensor tus pin 0 nyeem 38.0 (tsis nias) yog (pressureReading0> = 38.0 && pressurePrevious0 <38.0 && lightReading <= 28.0)

{

// yog tias LED 0 qhib, tua nws. txwv tsis pub (yog li thaum nws tawm) qhib nws.

yog (ledState0 == HIGH)

{

ledState0 = QAB;

}

lwm tus

{

ledState0 = HIGH;

}

}

// yog lub siab sensor tus pin 1 nyeem 100.0 (tsis nias) yog (pressureReading1> = 100.0 && pressurePrevious1 <100.0 && lightReading <= 28.0)

{

// yog tias LED 1 qhib, tua nws. txwv tsis pub (yog li thaum nws tawm) qhib nws.

yog (ledState1 == HIGH)

{

ledState1 = QAB;

}

lwm tus

{

ledState1 = HIGH;

}

}

// yog lub siab sensor tus pin 2 nyeem 180.0 (tsis nias) yog (pressureReading2> = 180.0 && pressurePrevious2 <180.0 && lightReading <= 28.0)

{

// yog tias LED 2 qhib, tua nws. txwv tsis pub (yog li thaum nws tawm) qhib nws.

yog (ledState2 == HIGH)

{

ledState2 = LOW;

}

lwm tus

{

ledState2 = HIGH;

}

}

// yog siab sensor tus pin 3 nyeem 6.0 (tsis nias) yog (pressureReading3> = 6.0 && pressurePrevious3 <6.0 && lightReading <= 28.0)

{

// yog tias LED 3 qhib, tua nws. txwv tsis pub (yog li thaum nws tawm) qhib nws.

yog (ledState3 == HIGH)

{

ledState3 = QAB;

}

lwm tus

{

ledState3 = HIGH;

}

}

// yog lub siab sensor tus pin 4 nyeem 10.0 (tsis nias) yog (pressureReading4> = 10.0 && pressurePrevious4 <10.0 && lightReading <= 28.0)

{

// yog LED 4 qhib, tua nws. txwv tsis pub (yog li thaum nws tawm) qhib nws.

yog (ledState4 == HIGH)

{

ledState4 = QIB;

}

lwm tus

{

ledState4 = HIGH;

}

}

yog (ledState0 == HIGH)

{

leds [0] = CRGB (255, 255, 255);

FastLED.show ();

ncua (30);

}

lwm tus

{

leds [0] = CRGB:: Dub;

FastLED.show ();

ncua (30);

}

yog (ledState1 == HIGH)

{

leds [1] = CRGB (255, 255, 255);

FastLED.show ();

ncua (30);

}

lwm tus

{

leds [1] = CRGB:: Dub;

FastLED.show ();

ncua (30);

}

yog (ledState2 == HIGH)

{

leds [2] = CRGB (255, 255, 255);

FastLED.show ();

ncua (30);

}

lwm tus

{

leds [2] = CRGB:: Dub;

FastLED.show ();

ncua (30);

}

yog (ledState3 == HIGH)

{

leds [3] = CRGB (255, 255, 255);

FastLED.show ();

ncua (30);

}

lwm tus

{

leds [3] = CRGB:: Dub;

FastLED.show ();

ncua (30);

}

yog (ledState4 == HIGH)

{

leds [4] = CRGB (255, 255, 255);

FastLED.show ();

ncua (30);

}

lwm tus

{

leds [4] = CRGB:: Dub;

FastLED.show ();

ncua (30);

}

pressurePrevious0 = siabReading0;

pressurePrevious1 = siabReading1;

pressurePrevious2 = siabReading2;

pressurePrevious3 = siabReading3;

pressurePrevious4 = siabReading4;

lightPrevious = lub teeb Nyeem;

// Qhib lub koos pij tawj saib kom pom koj qhov txiaj ntsig thiab hloov pauv qhov ua tau raws.

Serial.println ("Siab 0:");

Serial.println (siab Nyeem0);

Serial.println ("Siab 1:");

Serial.println (pressureReading1);

Serial.println ("Siab 2:");

Serial.println (siab Nyeem2);

Serial.println ("Siab 3:");

Serial.println (pressureReading3);

Serial.println ("Siab 4:");

Serial.println (pressureReading4);

Serial.println ("LightReading:");

Serial.println (lightReading);

ncua (200);

}

Kauj ruam 9: Soldering

Soldering
Soldering
Soldering
Soldering
Soldering
Soldering
Soldering
Soldering

Tam sim no qhov nyuaj tshaj plaws ntawm txoj haujlwm: siv txhua yam ua ke… sab hauv lub cav.

Nco tseg: koj yuav tsum tiv thaiv koj cov xov hlau nthuav tawm nrog lub raj nqaim, yog li tsis txhob hnov qab tso qee qhov ua ntej yuav txuas koj lub xov tooj! Yog tias koj tsis nco qab, koj tseem tuaj yeem npog lawv nrog daim kab xev hluav taws xob.

1: Pib los ntawm kev siv cov hlua txuas los ntawm tus pin 5-volt ntawm koj Arduino mus rau lub rooj tsav tsheb. Ua tib yam nrog hauv av, cov ntaub ntawv tus pin ~ 6 thiab A0 txog A5.

2. Tom ntej no, rub lub teeb pom kev los ntawm nws lub qhov hauv lub cav. Muab cov av pov rau hauv av rau ntawm lub rooj tsav tsheb perf, 5-volt mus rau 5-volt ntawm lub rooj tsav tsheb perf thiab cov ntaub ntawv rau A5 ntawm daim txiag ntoo. Siv lub raj nqaim los npog cov xov hlau uas nthuav tawm.

3. Rub koj thawj qia qia los ntawm nws lub qhov hauv lub cav (qhov no yog qia nrog tus tiv thaiv ntawm cov ntaub ntawv xov hlau!). Ua tib zoo txhuam cov hlau nyob hauv nws qhov chaw: (koj tseem tuaj yeem saib cov phiaj xwm los pab koj nrog cov ntsiab lus ntawm qhov mus qhov twg)

  • Solder cov ntaub ntawv xov hlau ntawm lub siab ntsuas mus rau A0 ntawm lub rooj tsav tsheb perf;
  • Solder av-xaim ntawm lub siab ntsuas mus rau hauv av ntawm daim txiag ntoo;
  • Solder 5-volt hlau ntawm lub siab ntsuas mus rau 5-volt ntawm lub rooj tsav tsheb.
  • Muab cov ntaub ntawv xaim hluav taws xob tso rau ntawm koj lub cim LED mus rau ~ 6 ntawm lub rooj tsav tsheb perf;
  • Siv cov xaim av hauv av koj cim ntawm LED mus rau hauv av ntawm daim txiag ntoo;
  • Solder lub 5-volt hlau koj cim ntawm LED mus rau 5-volt ntawm lub rooj tsav tsheb perf;

4. Npog cov xov hlau uas thaiv nrog lub raj ntswj.

5. Xev cov kab xaim xaim ua ke ua ke ua ke kom khaws cov ntsiab lus.

6. Rub los ntawm koj ob lub nceb.

  • Muab cov ntaub ntawv xaim hluav taws xob uas koj tsis cim rau thawj LED rau cov ntaub ntawv xov hlau uas koj tau cim rau ntawm LED thib ob (tus uas koj nyuam qhuav rub dhau los);
  • Siv cov xaim av hauv av koj tsis cim thawj ntawm LED rau hauv av xaim koj tau kos cim ntawm LED thib ob (tus uas koj nyuam qhuav rub los)
  • Siv lub xaim 5-volt koj tsis cim thawj LED rau 5-volt xaim koj tau kos cim ntawm LED thib ob (tus uas koj nyuam qhuav rub dhau);

Rov ua cov txheej txheem qub rau lwm cov xov hlau thiab cov qia qia. Txheeb xyuas cov txheej txheem kom pom cov ntaub ntawv xaim txuas rau cov ntaub ntawv tus pin.

Thaum koj ua tiav cov khoom siv tas, siv cov kua nplaum kub (lossis kab xev, yog tias koj xav kom tshem tau lawv) kom ruaj ntseg koj lub rooj tsav tsheb thiab Arduino sab hauv ntawm lub cav.

Ua siab ntev thiab ua kom ntseeg tau tias koj txuas cov xov hlau zoo rau ib leeg, txwv tsis pub koj yuav muaj kev pheej hmoo tshuab ib qho ntawm koj cov LEDs! (Qhov no yog vim li cas nws thiaj tseem ceeb heev kom cim qhov kawg ntawm peb lub xov hlau ntawm LEDs)

Kauj Ruam 10: Sib dhos thiab Hloov Parameters

Sib dhos thiab Hloov Parameters
Sib dhos thiab Hloov Parameters
Sib dhos thiab Hloov Parameters
Sib dhos thiab Hloov Parameters
Sib dhos thiab Hloov Parameters
Sib dhos thiab Hloov Parameters
Sib dhos thiab Hloov Parameters
Sib dhos thiab Hloov Parameters

Thaum txhua yam tau muab tso rau hauv qhov chaw, nws yog lub sijhawm los sib sau cov nceb!

1: Ntxuav ib feem ntawm cov qia qhov twg nws ua tau raws lub cav siv txiab thiab lo lawv lo rau ntawm tsob ntoo. Nws yog qhov zoo tshaj los siv silicone rau qhov no.

2: Xaiv lub kaus mom nceb uas koj xav siv thiab lo ib daim ntawv so ntswg sab hauv. Qhov no yuav ua kom ntseeg tau tias koj tsis tuaj yeem pom cov xaim sab hauv ntawm cov nceb.

3: Siv cov kua nplaum kub los ua kua nplaum ua ke ib feem ntawm cov xov hlau uas koj tsim los kom ntseeg tau tias nws ua kom nws zoo tom qab koj nias nws.

4: Kaw cov nceb hau rau cov hlua hlau.

5: Txiav tawm ib lub voj voos ntawm cov ntaub so ntswg txog qhov loj ntawm cov nceb thiab npog hauv qab ntawm cov nceb. Qhov no yuav ntxuav nws thiab txawm tias zoo li me ntsis zoo li spores! Siv daim duab saib seb kuv txiav daim ntawv so ntswg li cas.

Tam sim no cov nceb tau sib sau ua ke, nws yog lub sijhawm los hloov qhov ntsuas ntawm cov ntsuas.

Khiav koj tus lej Arduino thiab qhib qhov saib ua ntej. Saib cov txiaj ntsig ntawm cov ntsuas thiab kho lawv kom txog thaum koj zoo siab. Koj tuaj yeem ua rau cov nceb zoo li ua rau siab thiab lub teeb pom kev zoo raws li lub teeb pom kev zoo li koj nyiam.

Pom zoo: