Cov txheej txheem:

Ntse Tsev Teeb Pom Kev: 6 Kauj Ruam
Ntse Tsev Teeb Pom Kev: 6 Kauj Ruam

Video: Ntse Tsev Teeb Pom Kev: 6 Kauj Ruam

Video: Ntse Tsev Teeb Pom Kev: 6 Kauj Ruam
Video: Tus Neeg Ruam - R-Lin Thoj | New Song [ Official MV ] Nkauj Tawm Tshiab 2023 Hmong Song 2023 2024, Kaum ib hlis
Anonim
Ntse Tsev Teeb
Ntse Tsev Teeb

Nyob zoo cov phooj ywg, hnub no peb tab tom tsim ib qhov project uas peb tswj lub teeb pom kev raws qhov pom kev ib puag ncig. Peb yuav siv PICO thiab Lub Teeb Pom Kev Tiv Thaiv (LDR), txhawm rau txheeb xyuas lub teeb, thiab qhib lossis tua lub teeb nyob ntawm seb lub teeb pom kev zoo nyob ib puag ncig nws li cas.

Kauj Ruam 1: Cheeb Tsam

Cheebtsam
Cheebtsam
  • PICO, muaj nyob ntawm mellbell.cc ($ 17)
  • LDR 12mm, pob ntawm 30 ntawm ebay ($ 0.99)
  • 2-channel Relay module lossis 1-channel Relay Module, muaj nyob ntawm ebay ($ 0.74)
  • 10k ohm resistor, ib pob ntawm 100 ntawm ebay ($ 0.99)
  • Mini breadboard, ib pob ntawm 5 ntawm ebay ($ 2.52)
  • Txiv neej - txiv neej jumber xov, ib pob ntawm 40 ntawm ebay ($ 0.99)
  • Txiv neej - poj niam jumber xov hlau, ib pob 40 ntawm ebay ($ 0.99)
  • 220V AC lub teeb
  • 9 volt roj teeb

Kauj Ruam 2: Txuas LDR rau PICO

Txuas LDR mus rau PICO
Txuas LDR mus rau PICO
Txuas LDR rau PICO
Txuas LDR rau PICO
Txuas LDR mus rau PICO
Txuas LDR mus rau PICO

Lub teeb nyob ntawm tus tiv taus yog cov hloov pauv hloov pauv uas lawv tiv taus nyob ntawm seb lub teeb ntog ntawm lawv. Lawv txoj kev sib raug zoo yog qhov sib piv sib txawv, txhais tau tias kev tiv thaiv nce ntxiv thaum lub teeb pom kev zoo txo qis, thiab txo qis thaum teeb pom kev zoo nce ntxiv.

Peb yuav siv cov cuab yeej no los hloov qhov hluav taws xob uas peb PICO nyeem, thiab ua raws nws. Peb yuav tsum tsim qhov faib hluav taws xob siv peb LDR kom muaj peev xwm ua tau, thiab qhov no yog li cas peb tsim ib qho:

  • Peb txuas thawj sab ntawm LDR mus rau PICO's Vc
  • Txuas lwm sab ntawm LDR nrog ob A0 thiab 10K ohm resistor
  • Txuas lwm sab ntawm tus tiv thaiv mus rau PICO's GND

Tam sim no peb muaj qhov faib hluav taws xob, qhov twg lub teeb liab uas mus txog peb PICO's A0 nyob ntawm qhov tsis kam ntawm peb LDR. Lub teeb liab tawm ntawm qhov faib hluav taws xob tau sawv cev los ntawm: Vout = (R2/(R1+R2)) * Vin. Hauv peb rooj plaub

  • Vin = Lub zog siv hluav taws xob (Vc)
  • Cov = A0
  • R1 = Kev tiv thaiv ntawm LDR
  • R2 = 10k ohm (peb ruaj khov)

Cia tam sim no pom yuav ua li cas nws ua haujlwm nyob rau hauv cov teeb pom kev sib txawv.

Thawj qhov kev sim: Chav ci

LDR qhov kev tiv thaiv txo qis thiab yuav luag txog 1K ohm, cia peb sim qhov ntawd hauv peb qhov kev ua zauv:

A0 = (10000/(1000+10000)) * 5 = 4.54v

PICO's ADC yuav hloov qhov hluav taws xob no mus rau tus lej digital ntawm 928.

Kev sim zaum ob: Chav tsaus

LDR qhov kev tiv thaiv nce ntxiv thiab yuav luag txog 10K ohm, cia sim dua qhov ntawd hauv peb qhov kev ua zauv:

A0 = (10000/(9000+10000)) * 5 = 2.63v

PICO's ADC yuav hloov qhov hluav taws xob no mus rau tus lej digital ntawm 532.

Tam sim no peb tuaj yeem tau txais kev nyeem los ntawm peb LDR, cia txuas LED rau peb PICO thiab siv nws los ntsuas peb txoj haujlwm.

Kauj Ruam 3: Txuas lub LED thiab Xeem Peb Txoj Haujlwm

Txuas tus LED thiab Kuaj Peb Txoj Haujlwm
Txuas tus LED thiab Kuaj Peb Txoj Haujlwm

Tam sim no peb xav kom LED tua thiab nyob ntawm qhov nyeem ntawm peb LDR. Qhov no txhais tau tias peb yuav tsum tau nyeem cov ntawv los ntawm peb LDR, thiab teeb tsa lub hauv paus rau peb LED kom qhib thiab tua ntawm.

Koj yuav xav tau koj qhov program los ua cov hauv qab no:

  • Siv lub teeb liab nkag los ntawm LDR ntawm A0
  • Muaj D2 ua qhov tso tawm rau peb LED
  • Txhais qhov sib txawv uas sawv cev rau peb LDR qhov kev nyeem ntawv
  • Qhia tawm LDR lub teeb liab rau A0 hauv cov lej saib
  • Txheeb xyuas qhov cuam tshuam rau peb LED qhib thiab tawm ntawm.

Tab sis, ua ntej peb ua haujlwm peb txoj haujlwm, cia txuas lub LED rau peb PICO zoo li no:

  • Txuas lub LED tus ceg ntev (qhov zoo anode) rau peb tus PICO's D2 tus pin
  • Txuas lub LED tus ceg luv (qhov tsis zoo cathode) rau PICO's GND

Kauj Ruam 4: Txuas Txuas Txuas mus rau PICO

Txuas Txuas Txuas mus rau PICO
Txuas Txuas Txuas mus rau PICO

Tam sim no peb paub tias peb PICO thiab program tau txuas nrog thiab ua haujlwm tau zoo. Peb tuaj yeem tswj hwm peb lub tsev teeb lossis lwm yam khoom siv hauv tsev. Tab sis, peb xav tau kev tshaj tawm los ua li ntawd.

Kev xa tawm yog tsim los ntawm cov tshuab hluav taws xob uas tau siv los hloov pauv qhib lub Circuit Court thiab kaw nws. Peb yuav siv PICO los tswj kev hloov pauv ntawm kev xa tawm, los tswj kev xa khoom tam sim no rau lub cuab yeej. Thiab cov no yog cov relay tus pin outs:

  • Vcc (Relay) -> Txuas nrog 5 volt tus pin (PICO) txhawm rau ua kom lub kauj nyob hauv qhov txuas
  • GND (Relay) -> Txuas nrog PICO's GND txhawm rau ua kom lub kauj nyob sab hauv hauv kev sib txuas
  • IN1 (Relay) -> Txuas mus rau tus lej digital tso tawm kom xa lub teeb liab mus rau thawj qhov txuas mus txhawm rau qhib thiab kaw lub Circuit Court, hauv peb kis nws yuav yog D2 (PICO)
  • IN2 (Relay) -> Qhov no zoo ib yam li IN1, tab sis rau kis thib ob, thiab peb yuav tso nws tseg vim tias peb tsuas muaj ib qho xwb.
  • Common "com" (Relay) -> Common yog txuas nrog ib kawg ntawm lub load uas yuav tsum tau tswj.
  • Feem ntau Kaw "NC" (Relay) -> Lwm qhov kawg ntawm lub thauj khoom txuas nrog NC lossis NO, yog tias nws txuas nrog NC lub nra tseem txuas nrog ua ntej lub tswb.
  • Feem ntau Qhib "TSIS" (Hloov Chaw) -> Lwm qhov kawg ntawm kev thauj khoom yog txuas nrog NC lossis TSIS, yog txuas nrog TSIS tau lub thauj khoom tseem tsis tau txuas ua ntej qhov ua rau.

Tam sim no peb tsuas yog yuav hloov LED nrog cov qauv xa tawm.

Kauj Ruam 5: Txuas AC Load thiab Programming Relay

Txuas AC Load thiab Programming Relay
Txuas AC Load thiab Programming Relay
Txuas AC Load thiab Programming Relay
Txuas AC Load thiab Programming Relay

Tam sim no, koj tsuas yog yuav tsum txuas lub AC thauj khoom mus rau qhov hloov pauv tus qauv, thiab koj ua li ntawd los ntawm kev txiav ib lub xov hlau los ntawm koj lub nra hauv ib nrab, tom qab ntawd txuas ib qho kawg mus rau qhov xa tawm com, thiab lwm qhov rau NO.

Txoj cai yuav nyob zoo ib yam li nws tau siv rau LED, vim tias kev xa xov siv lub teeb liab digital zoo ib yam li LED. Tab sis, hloov tus coj coj mus rau kis, yog li nws nyob qis qis thiab piav qhia.

Kauj Ruam 6: Koj Ua tiav

Tam sim no, koj muaj AC lub teeb uas qhib thiab tawm nyob ntawm lub teeb uas nyob hauv chav. Koj tuaj yeem ua qhov no rau ib qho khoom siv hluav taws xob hauv tsev, koj tsuas yog yuav tsum tau ceev faj nrog kev ntse koj ua rau lawv li cas!

Thov koj xav muab peb cov lus qhia, thiab nug ib lo lus nug, peb yuav zoo siab tshaj los teb lawv. Thiab yog tias koj nyiam nws, tsis txhob hnov qab qhia nws hauv Facebook lossis xa peb mus rau ntawm mellbell.cc.

Pom zoo: