Cov txheej txheem:

Particle Photon Salinity Meter: 4 Kauj Ruam
Particle Photon Salinity Meter: 4 Kauj Ruam

Video: Particle Photon Salinity Meter: 4 Kauj Ruam

Video: Particle Photon Salinity Meter: 4 Kauj Ruam
Video: Starlight and Astrophysics: Mindblowing Science - PANEL - TAG Con 2020 Virtual Intergalactic 2024, Kaum ib hlis
Anonim
Particle Photon Salinity Meter
Particle Photon Salinity Meter

Peb tau siv lub ntsuas ntsuas los ntsuas cov ntsev hauv dej uas siv lub tshuab nqus hlau thiab lub ntsuas qhov ntsuas qhov ntsuas kom ua rau nws peb siv Particle Photon, tab sis Arduino kuj tseem tuaj yeem siv tau raws li lawv ua haujlwm ib yam nkaus.

Txhawm rau ua txoj haujlwm no koj xav tau ob peb yam:

- Particle/arduino suav nrog lub khob cij thiab qee cov xov hlau

- ib txoj kab ncaj ncaj sensor

- qee cov hlau nplaum (peb siv me me tab sis muaj zog neodymium hlau nplaum)

- tus cwj mem

- ib co kab xev

Kauj ruam 1: Lub Thawv

Lub Thawv
Lub Thawv

Tus cwj mem yuav siv los ua ib lub thawv thiaj li mus tom ntej thiab tshem tus pin kom koj tsuas muaj lub ntim yas xwb.

Kaw qhov me me nrog qee daim kab xev, thiab kaw cov hlau nplaum nyob ze lub qhov me me ntawm ib sab ntawm tus cwj mem.

Kauj Ruam 2: Txuas Cov Particle/Arduino

Txuas cov Particle/Arduino
Txuas cov Particle/Arduino

Txuas cov particle lossis arduino mus rau lub khob cij. Tsis tas li txuas lub cuab yeej tso tawm kab ib yam nkaus li ntawm daim duab, tus pin sab saum toj rau 3.3V, tus pin nruab nrab rau GND thiab tus pin hauv qab mus rau cov lus sib piv.

Kauj Ruam 3: Txoj Cai

Ntawm cov particle photon koj tsuas tuaj yeem nias ntawm tus pin koj siv ua tswv yim thiab siv ua haujlwm analogRead kom tau txais tus nqi los ntawm lub cuab yeej sensor.

Yog tias koj xav kom nws ua tiav lossis yog tias koj tab tom siv arduino koj yuav xav tau tus lej saib qee yam zoo li no:

// tus pin ntsuas los ntawm analogPin = A0;

// lub sijhawm, hauv milliseconds, ntawm kev ntsuas.

// vim koj tsis tuaj yeem tshaj tawm ntau yam xwm txheej, qhov no tau dhau los tsawg kawg 1000

int delayTime = 5000;

// ib lub npe txheej xwm yog li koj yuav paub txog qhov ntsuas ntws hauv

String eventName = "ntsuas/Ntsev";

String laag = "Tsawg";

String middel = "Nruab Nrab";

String hoog = "Siab";

void teeb tsa () {

}

void voj () {

int ntsuas = analogRead (analogPin);

yog (ntsuas <= 1750) {

Particle.publish (eventName, laag); }

yog (ntsuas> = 1751 && ntsuas <= 1830) {

Particle.publish (eventName, middel);

}

yog (ntsuas> = 1831 && ntsuas <= 2100) {

Particle.publish (eventName, hoog);

}

yog (ntsuas> = 2101) {

}

ncua (delayTime);

}

Kauj ruam 4: Ntsuas

Ofcourse qhov muaj txiaj ntsig hauv txoj cai yuav tsum tau ntsuas rau qhov qab ntsev koj tab tom siv yog li mus tom ntej thiab tau 3 khob dej. Lub khob 1 yuav tsuas yog dej, Lub khob 3 yuav ua kom tiav nrog ntsev thiab khob 2 yuav nyob ib puag ncig.

Nqa ib lub khob thiab nchuav dej rau hauv tus cwj mem.

Tuav tus cwj mem nyob ib sab ntawm lub tsev sensor nrog cov hlau nplaum tawm ntawm lwm sab (yog li cov dej yuav raug ntab ntawm cov hlau nplaum thiab lub ntsuas)

Siv lub luag haujlwm analogRead kom pom tus nqi dej uas koj siv thiab siv tus nqi ntawd hauv cov cai.

Qhov tseem ceeb peb ntsuas yog:

dej xwb: 1720

Txaus nrog ntsev: 1840

qhov chaw nyob nruab nrab ntawm: 1760

Pom zoo: