Cov txheej txheem:

Ntse Tsev Txheej Txheem: 6 Kauj Ruam
Ntse Tsev Txheej Txheem: 6 Kauj Ruam

Video: Ntse Tsev Txheej Txheem: 6 Kauj Ruam

Video: Ntse Tsev Txheej Txheem: 6 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Ntse Tsev
Ntse Tsev

Cov lus qhia no yuav pab piav qhia yuav teeb tsa thiab siv peb li Smart Home System los ntawm kev siv Matlab software thiab Raspberry Pi kho vajtse. Qhov kawg ntawm cov lus qhia no, koj yuav tsum muaj peev xwm siv peb cov khoom tau yooj yim!

Kauj Ruam 1: Kauj Ruam 1: Cov Khoom thiab Cov Khoom Xav Tau

Kauj Ruam 1: Cov Khoom thiab Cov Khoom Xav Tau
Kauj Ruam 1: Cov Khoom thiab Cov Khoom Xav Tau
Kauj Ruam 1: Cov Khoom thiab Cov Khoom Xav Tau
Kauj Ruam 1: Cov Khoom thiab Cov Khoom Xav Tau
  • Raspberry Pi
  • Daim ntawv qhia zaub mov (x2)
  • PIR Tsab ntawv tsa suab sensor
  • LCD Module
  • LED Teeb
  • Capacitor
  • Raspberry Pi Lub Koob Yees Duab
  • Micro Servo Tsav
  • Ob Chav Xaim Xov (20)

Kauj Ruam 2: Kauj Ruam 2: Nqe Lus Teeb Meem

Cov teeb meem uas peb cov khoom tau sim daws yog phau ntawv tswj lub teeb, tswj qhov kub hauv tsev, thiab ua kom lub zog muaj zog. Peb tsom mus rau tus nqi zog uas lub tsev nruab nrab siv, thiab peb xav nrhiav txoj hauv kev los txo kev siv zog. Teeb tau tso tseg thiab qhov ntsuas cua sov tsis tsim nyog suav nrog kev siv lub zog tsis tsim nyog. Lub teeb yuav txav mus rau qhov chaw uas lawv kaw thaum chav tsis muaj chaw nyob, thiab lub ntsuas cua sov hloov mus rau qhov ntsuas kub ib puag ncig zoo raws li kev ntsuas kub sab nraum zoov.

Kauj Ruam 3: Kauj Ruam 3: Tsab Ntawv tsa suab Sensor Configuration

Kauj ruam 3: Tsab ntawv tsa suab Sensor Configuration
Kauj ruam 3: Tsab ntawv tsa suab Sensor Configuration

Lub suab ntsuas tau txuas nrog 3.3V fais fab tus pin, tus pin hauv av, thiab tus lej digital ntawm qhov koj xaiv. Lawv txuas nrog VCC, GND, thiab OUT cov chaw nres nkoj ntawm cov lus tsa suab sensor, feem. Lub suab ntsuas yuav pom thaum ib tus neeg nyob ze thiab qhib lub LED kom qhia tau tias lub teeb tau qhib. Thaum cov lus tsa suab tsis pom lawm, LED yuav tua nws tus kheej. Cov cai yog raws li hauv qab no:

thaum muaj tseeb

motionDetected = readDigitalPin (rpi, 3);

yog motionDetected == 1

writeDigitalPin (rpi, 16, 1)

lwm tus

writeDigitalPin (rpi, 16, 0)

kawg

kawg

Kauj Ruam 4: Kauj Ruam 4: LCD Module Zaub

Kauj ruam 4: LCD Module Zaub
Kauj ruam 4: LCD Module Zaub

LCD siv cov ntaub ntawv ntsuas kub los ntawm cov ntaub ntawv qhia huab cua nyob hauv internet. LCD module qhia qhov ntsuas kub tam sim no. Hauv Matlab, qhov ntsuas kub tau nyeem thiab tom qab ntawd dhau los yog lub voj los txiav txim siab ntau npaum li cas los kho qhov ntsuas kub hauv tsev. Cov cai yog raws li hauv qab no:

url = 'https://forecast.weather.gov/MapClick.php? lat = 35.9606 & lon = -83.9207 & FcstType = json';

cov ntaub ntawv = webread (url);

a = data.currentobservation. Temp;

fprintf ('Kub sab nraum zoov yog %s / n', a)

x = str2num (a);

yog x80

fprintf ('Tig lub ntsuas cua qis dua 15 degrees')

writeDigitalPin (rpi, 26, 1) %tig teeb

elseif x> 75 && x <80

fprintf ('Teem lub ntsuas sov tawm / n')

writeDigitalPin (rpi, 26, 1) %tig teeb

lwm x55

fprintf ('Tig lub ntsuas cua kom siab li 10 degrees / n')

writeDigitalPin (rpi, 26, 0) %tua teeb

lwm x45

fprintf ('Tig lub ntsuas sov kom txog 20 degrees / n')

writeDigitalPin (rpi, 26, 0) %tua lub teeb

lwm x40

fprintf ('Tig lub ntsuas cua sov mus txog 25 degrees / n')

writeDigitalPin (rpi, 26, 0) %tua teeb

lwm x30

fprintf ('Tig lub ntsuas cua kom siab li 35 degrees / n')

lwm tus

fprintf ('Tig lub ntsuas sov mus txog 65 degrees / n')

kawg

Kauj Ruam 5: Kauj Ruam 5: Tsav Tsheb Servo Module

Kauj Ruam 5: Tsav Servo Module
Kauj Ruam 5: Tsav Servo Module

Motor Servo Module yog los sawv cev rau lub peev xwm qhib thiab kaw qhov muag tsis pom. Thaum lub tsev yuav tsum tau txias, cov qhov muag tsis pom yuav kaw kom tso cua sov kom tsawg. Lub servo txiav txim siab yuav ua dab tsi los ntawm kev tau txais cov tswv yim los ntawm cov neeg siv cuam tshuam nrog cov ntawv qhia zaub mov ntawm kev xaiv. Cov cai rau lub cav yog raws li hauv qab no:

s = servo (rpi, 3) cov

writeDigitalPin (rpi, 4, 1)

sau Txoj Haujlwm (s, 45)

temp_sys = ntawv qhia zaub mov ('Koj xav li cas?') %temp kho

yog temp_sys == 1 %kub

writeDigitalPin (rpi, 26, 1) %tig teeb

writePosition (s, 0) %tig lub cav CW/CCW

kaw qhov muag tsis pom, tua teeb

elseif temp_sys == 2 %txias

writeDigitalPin (rpi, 26, 0) %tua teeb

writePosition (s, 180) %tig lub cav CCW/CW

qhib qhov muag tsis pom, qhib teeb

elseif temp_sys == 3 %yog lawm

fprintf ('Tswj xyuas qhov xwm txheej kub. / n')

kawg

Kauj Ruam 6: Kauj Ruam 6: Motion Sensor Camera

Kauj Ruam 6: Tsab Ntawv Ceeb Toom Lub Koob Yees Duab
Kauj Ruam 6: Tsab Ntawv Ceeb Toom Lub Koob Yees Duab

Lub koob yees duab ntsuas lub koob yees duab yuav yees duab ntawm cov uas nkag los lossis tawm hauv chav. Peb tau xaiv qhov no los ua kev nyab xeeb ntxiv rau cov uas xav paub txog leej twg tau nyob hauv lawv lub tsev. Thaum lub suab ntsuas pom lub suab, Matlab code qhia lub koob yees duab kom thaij duab thiab tso saib nws. Cov cai yog raws li hauv qab no:

kuv = 0

cam meej

cam = lub koob yees duab (rpi);

thaum kuv == 0

snapshot (cam); %meej cov duab tsis

img = snapshot (cam);

dluab (img);

kawg

Pom zoo: