Cov txheej txheem:

Raspberry Pi Doorbell: 3 Kauj Ruam
Raspberry Pi Doorbell: 3 Kauj Ruam

Video: Raspberry Pi Doorbell: 3 Kauj Ruam

Video: Raspberry Pi Doorbell: 3 Kauj Ruam
Video: How to Make a Raspberry Pi Smart Doorbell 2024, Kaum ib hlis
Anonim
Raspberry Pi Doorbell
Raspberry Pi Doorbell

Tsis ntev los no kuv tau yuav ib lub tsev nrog lub tswb nrov nrov. Yog li kuv tau tsim ib qho uas tuaj yeem ua suab nrov.

Kuv siv Adafruit Stereo Bonnet Pack nrog RPI Zero W.

Qhov Ntxiv:

SD daim npav

USB lub qhov hluav taws xob - lossis tuaj yeem siv Pi lub adapter yog tias koj muaj lub qhov hluav taws xob ntawm lub qhov rooj

USB me me rau micro USB cable

Lub rooj sib tham me me rau cov laug txuas

1 - 10k resister

1 - 1k resister

1 - 104 (0.1uf) capacitor

3 jumper kab

2 tus nab npawb xov tooj

Kauj Ruam 1: Qhov Chaw Solder

Solder Qhov Chaw
Solder Qhov Chaw
Solder Qhov Chaw
Solder Qhov Chaw
Solder Qhov Chaw
Solder Qhov Chaw
Solder Qhov Chaw
Solder Qhov Chaw

Adafruit Speaker Bonnet thiab Xoom xav tau tus pin txuas txuas. Adafruit muaj cov lus qhia rau qhov no.

Qhov no yog kev ntseeg tau uas siv cov khoom tiv thaiv kab mob. Nws tsis tau txais phantom cov tswv yim los ntawm hluav taws xob zoo li qub lossis los ntawm tig lub teeb hloov. GPIO tau txais qhov hluav taws xob tas li thiab tsoo lub pob hluav taws xob txuas rau hauv Circuit Court mus rau hauv av poob qhov hluav taws xob. Lub tshuab hluav taws xob ua raws li lub sijhawm luv luv tsis cuam tshuam lub hwj chim, nws tiv thaiv dab tsi hu ua khawm thaws. Qhov no qhov hluav taws xob yuav ua rau ntau qhov hloov pauv ntawm qhov hluav taws xob thaum lub pob nyem vim tias cov hlau tau ua kev sib cuag ntau zaus hauv ib feem ntawm ib pliag. Python tsab ntawv muaj 5 lub sijhawm thib ob uas tseem pab nrog qhov no thiab cov neeg hais lus tsis raug cai.

  • Solder lub jumper dub rau lub hauv paus txuas ntawm Tus Hais Lus Bonnet
  • Solder liab jumper rau 3.3v txuas
  • Solder xiav jumper rau 22 ntawm Tus Hais Lus Bonnet (Uas yog GPIO 22)
  • Choj solder liab hwj chim jumper rau 10k resistor
  • Choj txuas lwm qhov kawg ntawm 10k resistor, GPIO jumper, capacitor thiab 1k resistor
  • Choj txuas lwm qhov kawg ntawm 1k resistor rau tus nab kuab xov hlau.
  • Choj txuas lwm qhov kawg ntawm lub tshuab hluav taws xob, hauv av thiab lwm cov kab zauv kab xaim.

Kauj ruam 2: Teeb Raspberry Pi

Kuv siv Raspbian Lite, vim tias koj tsis tuaj yeem tswj lub ntim hais lus ntawm Adafruit pawg thawj coj nrog tag nrho GUI version ntawm Raspbian. Yog tias koj siv Adafruit kho vajtse, ua raws lawv cov lus qhia rau teeb tsa.

Tsim daim nplaub tshev rau cov ntaub ntawv ntawm lub qhov rooj

pi@raspberrypi ~ $ mkdir doorbellpi@raspberrypi ~ $ cd doorbell

Rub cov ntawv sej thiab cov ntawv wav uas koj xav siv.

wget -O doorbell.py

wget -O doorbell.wav

wget -O gong.wav

wget -O bird.wav

Ua kom doorbell.py ua tiav

chmod +x doorbell.py

Kuv kho cov suab no nrog Creative Commons Cov ntawv tso cai kuv tau txais los ntawm Freesound

Python tsab ntawv siv ring.wav, yog li luam qhov koj xav kom nws ua si

pi@raspberrypi ~ $ cp gong.wav ring.wav

Teeb tsa kev pabcuam pib

pi@raspberrypi ~ $ sudo nano /lib/systemd/system/doorbell.service

[Chav] Nqe lus piav qhia = Qhov Rooj Qhov Rooj

[Kev pabcuam]

ExecStart =/tsev/pi/doorbell/doorbell.py

StandardOutput = null

[Nruab]

WantedBy = ntau-user.target

Alias = doorbell.service

Txuag, tom qab ntawd ua haujlwm pabcuam

pi@raspberrypi ~ $ sudo systemctl pab doorbell.service

pi@raspberrypi ~ $ sudo systemctl pib doorbell.service

Kauj Ruam 3: Kev Txhim Kho

Kev teeb tsa yuav tsum tau kho raws koj lub qhov rooj uas twb muaj lawm. Kuv siv lub tshuab pom rov qab los txiav qhib lub suab nrov hauv lub tsev tswb qhov rooj qub thiab muab tso rau hauv tus hais lus. Kuv siv qee daim kab xev hluav taws xob los khaws cov khoom hauv qhov chaw. Kuv hle qhov kawg ntawm lub qhov rooj hloov lub xaim thiab txuas nws nrog cov kais dej. Kuv npog cov tooj liab liab liab nrog daim kab xev hluav taws xob.

Pom zoo: