Cov txheej txheem:

Kev Paub Xim W/ TCS230 Sensor thiab Arduino [Calibration Code Included]: 12 Cov Kauj Ruam
Kev Paub Xim W/ TCS230 Sensor thiab Arduino [Calibration Code Included]: 12 Cov Kauj Ruam

Video: Kev Paub Xim W/ TCS230 Sensor thiab Arduino [Calibration Code Included]: 12 Cov Kauj Ruam

Video: Kev Paub Xim W/ TCS230 Sensor thiab Arduino [Calibration Code Included]: 12 Cov Kauj Ruam
Video: ? Что такое многополосный 6 атомный хронометраж ? То 2024, Hlis ntuj nqeg
Anonim

Los ntawm ElectropeakElectroPeak Lub Vev Xaib Ua Haujlwm Ntxiv Ntxiv los ntawm tus sau:

Pib Nrog Ultrasonic Module thiab Arduino
Pib Nrog Ultrasonic Module thiab Arduino
Pib Nrog Ultrasonic Module thiab Arduino
Pib Nrog Ultrasonic Module thiab Arduino
Tsim WiFi Daim Ntawv Qhia Kub Thaum Siv ESP8266 & Arduino
Tsim WiFi Daim Ntawv Qhia Kub Thaum Siv ESP8266 & Arduino
Tsim WiFi Daim Ntawv Qhia Kub Thaum Siv ESP8266 & Arduino
Tsim WiFi Daim Ntawv Qhia Kub Thaum Siv ESP8266 & Arduino
Yuav Ua Li Cas Tswj WS2812 RGB LED (NeoPixel) W/ Arduino [Tutorial]
Yuav Ua Li Cas Tswj WS2812 RGB LED (NeoPixel) W/ Arduino [Tutorial]
Yuav Ua Li Cas Tswj WS2812 RGB LED (NeoPixel) W/ Arduino [Tutorial]
Yuav Ua Li Cas Tswj WS2812 RGB LED (NeoPixel) W/ Arduino [Tutorial]

Txog: ElectroPeak yog koj qhov chaw ib-nres los kawm cov khoom siv hluav taws xob thiab coj koj lub tswv yim mus rau qhov tseeb. Peb muab cov lus qhia saum toj kawg nkaus los qhia koj li cas koj tuaj yeem ua koj cov phiaj xwm. Peb kuj tseem muab cov khoom lag luam zoo yog li koj muaj … Ntau Ntxiv Txog Electropeak »

Txheej txheem cej luam

Hauv qhov kev qhia no, koj yuav kawm paub txog TCS230 sensor thiab yuav siv nws li cas nrog Arduino kom paub xim. Thaum kawg ntawm qhov kev qhia no, koj yuav pom lub tswv yim zoo los tsim tus cwj mem xim xim. Nrog tus cwj mem no, koj tuaj yeem luam theej duab cov xim ntawm cov khoom ib puag ncig koj, thiab pib tha xim rau ntawm LCD siv cov xim ntawd.

Yam Koj Yuav Kawm

  • Kev taw qhia txog TCS230
  • Yuav siv TCS230 module nrog Arduino li cas thiab paub qhov txawv xim

Kauj ruam 1: Tus TSC230 Sensor yog dab tsi?

TSC230 Sensor yog dab tsi?
TSC230 Sensor yog dab tsi?
TSC230 Sensor yog dab tsi?
TSC230 Sensor yog dab tsi?

TSC230 nti muaj 8 × 8 array ntawm silicon photodiodes, uas tuaj yeem siv los paub xim. 16 ntawm cov photodiodes no muaj lub lim dej liab, 16 muaj lub lim ntsuab, 16 muaj lub lim xiav thiab lwm 16 tsis muaj lim.

TCS230 module muaj 4 LEDs dawb. Photodiodes tau txais lub teeb pom kev zoo ntawm cov LED no los ntawm cov khoom ntawm qhov khoom, tom qab ntawd tsim hluav taws xob tam sim no nyob ntawm cov xim uas lawv tau txais.

Ntxiv rau photodiodes, tseem muaj qhov hloov pauv tam sim no-rau-zaus hauv qhov ntsuas no. Nws hloov qhov tam sim no tsim los ntawm photodiodes rau zaus.

Qhov tso tawm ntawm cov qauv no yog nyob rau hauv daim ntawv ntawm cov square pulses nrog lub voj voog ua haujlwm ntawm 50%.

Qhov ntsuas zoo tshaj plaws rau qhov ntsuas no yog li 2 txog 4 cm.

Kauj ruam 2: TCS230 Pinout

TCS 230 Pinout
TCS 230 Pinout
TCS 230 Pinout
TCS 230 Pinout
TCS 230 Pinout
TCS 230 Pinout

TCS230 muaj 4 tus pin tswj. S0 thiab S1 yog siv rau qhov tso zis ntau zaus, thiab S2 thiab S3 tau siv los xaiv hom photodiode. (liab, ntsuab, xiav, tsis muaj lim)

Tam sim no-rau-zaus hloov pauv Circuit Court muaj zaus faib. Koj tuaj yeem tswj qhov kev faib tawm zaus nrog S0 thiab S1 tswj tus pin.

Piv txwv li, yog tias koj xav ntsuas tus nqi ntawm cov xim xiav hauv ib qho khoom, koj yuav tsum teeb tsa lub xeev S2 tus lej kom qis, thiab lub xeev S3 tus pin kom siab ib txhij.

Kauj Ruam 3: Cov Ntaub Ntawv Xav Tau

Cov Ntaub Ntawv Yuav Tsum Tau
Cov Ntaub Ntawv Yuav Tsum Tau

Kho vajtse Cheebtsam

Arduino UNO R3 *1

TCS230 Xim Kev Paub Xim Xim Module *1

Lub khob cij *1

RGB LED *1

2.4 TFT LCD ** *1

Txiv neej rau Poj niam jumper hlau *1

220 Ohm Resistor *1

Software Apps

Arduino IDE Cov

Kauj Ruam 4: TCS239 Xim Sensor thiab Arduino cuam tshuam

Txuas lub sensor rau Arduino raws li koj pom hauv daim duab hauv qab no. Tom qab ntawd txheeb xyuas qhov tso tawm ntawm cov xim sib txawv los ntawm kev pib ua tus pin S0 rau S4.

Kauj ruam 5: Circuit Court

Circuit Court
Circuit Court

Txuas lub sensor mus rau Arduino raws li kab lus hauv qab no.

Kauj ruam 6: Code

Code
Code

Cov cai hauv qab no ntsuas lub teeb liab rau txhua ntawm peb xim thiab qhia qhov tshwm sim ntawm qhov chaw nres nkoj.

Cov xim muaj nuj nqi tswj S2 thiab S3 pins nyeem tag nrho cov xim ntawm cov khoom. Txoj haujlwm no siv cov lus txib pulseln kom tau txais cov kab mob sib kis los ntawm cov xim xim. Yog xav paub ntxiv, koj tuaj yeem nyeem nplooj ntawv no.

lo lus txib no ua haujlwm zoo li yog thiab hais kom ua lwm yam.

Yog tias qhov xwm txheej muaj tseeb, exp1, thiab lwm qhov exp2 yuav ua tiav.

Kauj Ruam 7: TCS230 Xim Sensor Calibration

Txhawm rau ntsuas qhov ntsuas, koj xav tau cov khoom dawb.

Calibrate muaj nuj nqi ua qhov ntsuas ntawm lub sensor. Txhawm rau ua qhov no, nkag mus rau tus cim "c" hauv lub qhov rai ntu. Tom qab ntawd tshem tag nrho cov khoom xim nyob ib puag ncig lub sensor thiab rov sau "c". Tam sim no coj cov khoom dawb nyob ze lub sensor thiab sau "c" dua.

Tom qab ntsuas qhov ntsuas, yog tias koj khaws cov khoom dawb nyob rau sab xub ntiag ntawm lub ntsuas cua, koj yuav tsum pom tus nqi 255 (lossis ib ncig 255) rau txhua qhov ntawm peb lub xim liab, ntsuab, thiab xiav hauv lub qhov rais.

Calibrate muaj nuj nqi suav thiab khaws cov kev hloov pauv siab tshaj plaws thiab yam tsawg kawg nkaus hauv qhov tso zis ntau zaus hauv ib puag ncig uas tsis muaj xim thiab dawb.

Tom qab ntawd hauv ntu ntu, nws qhia cov xim hloov pauv mus rau 0-255 (lossis lwm yam ntau yam koj txhais tau).

Koj tuaj yeem nrhiav cov ntaub ntawv ntau ntxiv txog daim ntawv qhia kev qhia ntawm no.

Kauj ruam 8: Code

Kauj Ruam 9: Ua Tus Cwj Pwm Xim Xim Nrog TCS230 Sensor thiab Arduino

Yog tias koj siv Arduino UNO, koj yuav tsum tau muab cov xim xim tso rau ntawm Arduino pawg thawj coj siv xov hlau. Tab sis yog tias koj siv Arduino MEGA, koj tuaj yeem siv tus pin kawg ntawm pawg thawj coj los txuas lub ntsuas xim rau nws.

Yog tias koj tab tom siv daim iav tiv thaiv LCD thawj zaug, koj tuaj yeem pom cov teeb tsa qhia ntawm no.

Cov cai hauv qab no tsim cov nplooj ntawv pleev xim rau ntawm LCD. Lub xim xim ntawm tus cwj mem yog liab. Tuav tus yuam sij thiab kaw lub ntsuas xim mus rau qhov khoom xav kom xaiv nws cov xim. Tom qab ntawd xim koj tus cwj mem hloov mus rau xim ntawm cov khoom ntawd.

Kauj ruam 10: Circuit Court

Circuit Court
Circuit Court

Kauj ruam 11: Txoj Cai

Kev xaiv xim xim hu ua thaum tus yuam sij raug nias. Nws nyeem cov xim ntawm cov khoom uas nyob ze ntawm lub sensor thiab hloov xim cwj mem rau xim ntawd.

Pom zoo: