Cov txheej txheem:

Digital RPi LED Thermometer: 6 Kauj Ruam (nrog Duab)
Digital RPi LED Thermometer: 6 Kauj Ruam (nrog Duab)

Video: Digital RPi LED Thermometer: 6 Kauj Ruam (nrog Duab)

Video: Digital RPi LED Thermometer: 6 Kauj Ruam (nrog Duab)
Video: Часы G-Shock до 250 долларов-15 лучших часов Casio G до 250 доллар... 2024, Hlis ntuj nqeg
Anonim
Digital RPi LED Ntsuas Kub
Digital RPi LED Ntsuas Kub
Digital RPi LED Ntsuas Kub
Digital RPi LED Ntsuas Kub
Digital RPi LED Ntsuas Kub
Digital RPi LED Ntsuas Kub
Digital RPi LED Ntsuas Kub
Digital RPi LED Ntsuas Kub

Raspbian OS Kawm paub tias kuv ua tus Digital LED Thermometer, nrog Raspberry Pi Zero W, LED sawb, OLED zaub, thiab kev cai PCB.

Nws tau txiav kev xav ib daim ntawv teev cov nroog, thiab qhia qhov ntsuas kub ntawm OLED zaub, thiab LED's. Tab sis koj kuj tseem tuaj yeem xaiv lub nroog los tso saib, nrog cov nyees khawm nyob ntawm ib sab. Nyob rau sab saum toj ntawm qhov ntawd, nws yuav kaw lub LED thiab OLED, yog tias nws tsis ua haujlwm li ob peb feeb, thiab yuav tig rov qab, yog tias nws pom qhov hloov pauv tseem ceeb (Tswj los ntawm LDR).

Khoom siv

- Raspberry Pi Zero W thiab SD-card nrog Raspbian OS

- Ib qho 1.5 Nti OLED Module los ntawm Waveshare

- A 5V 2.4A Lub Hwj Huam Muab rau Raspberry Pi

- 5m WS2812B LED Sawb, 30 LEDs/m

- Screws, tshuab ntxhua khaub ncaws, bolts thiab standoffs.

- Kev Cai PCB, nrog cov nyees khawm, hloov, ldr, tus pin-headers, thiab ntau dua

- Soldering hlau thiab solder

- Kub kua nplaum

- Ntoo kua nplaum

4mm thiab 6mm plywood

- 3 hli dawb acrylic

Kauj Ruam 1: Cov Ntaub Ntawv Huab Cua

Cov Ntaub Ntawv Huab Cua
Cov Ntaub Ntawv Huab Cua

Tso nyiaj rau StuffWithKirby rau nws cov cai ntawm kev nyeem JSON cov ntaub ntawv huab cua hauv nab hab sej.

Kuv khaws cov ntaub ntawv huab cua dawb los ntawm OpenWeatherMap.org, qhov uas lawv muab cov ntaub ntawv huab cua los ntawm ntau lub nroog loj, hauv ntau lub tebchaws.

1. Pib los ntawm kev ua tus lej pub dawb ntawm OpenWeatherMap.org.

2. Tom qab ntawd luam koj li api-key los siv tom qab.

3. Tam sim no rub tawm, unzip thiab qhib lub nroog.list.json.gz cov ntaub ntawv, thiab tshawb rau cov nroog uas koj xav pom, thiab luam lub nroog-tus lej rau tom qab.

Kauj Ruam 2: Teeb RPi thiab Sau Txoj Cai

Teeb RPi thiab Sau Txoj Cai
Teeb RPi thiab Sau Txoj Cai
Teeb RPi thiab Sau Txoj Cai
Teeb RPi thiab Sau Txoj Cai

Ua ntej kuv txuas OLED rau Pi, thiab teeb tsa cov tsev qiv ntawv tsim nyog rau OLED, raws li tau piav qhia los ntawm cov khw, ntawm no.

Nco ntsoov tias RPi txuas nrog internet

1. Pab kom I2C thiab SPI muaj nuj nqi hauv raspi-teeb tsa nyob rau hauv Kev cuam tshuam kev xaiv. Tawm thiab rov pib dua.

2. Khiav qhov no kom hloov tshiab:

sudo apt-tau hloov tshiab

3. Khiav cov lus txib hauv qab no txhawm rau txhim kho cov tsev qiv ntawv tsim nyog:

sudo apt-tau nruab nruab sej-dev

sudo apt-tau nruab python-smbus sudo apt-tau nruab sej-serial sudo apt-tau nruab python-imaging

4. Khiav cov lus txib hauv qab no los qhib cov ntawv teeb tsa:

sudo nano /thiab /modules

Nco ntsoov ob kab hauv qab no, nyob hauv cov ntawv teeb tsa, tom qab ntawd tawm thiab rov pib dua:

i2c-bcm2708

i2c-dev

5. Tam sim no khiav qhov no rau clone kuv GitHub repo:

git clone

6. Mus rau hauv daim nplaub tshev tshiab, thiab unzip RPi_GPIO-0_6_5.zip:

unzip RPi_GPIO-0_6_5.zip

Khiav qhov no rau nruab lub tsev qiv ntawv:

cd RPi_GPIO-0_6_5

sudo python setup.py nruab

7. Rov qab mus rau lub nplaub tshev tseem ceeb, los ntawm kev ntaus ntawv:

cd /home/pi/1.5inch-OLED-with-RPi/

Los yog

cd ua..

Tom qab ntawd ua qee qhov nrog spidev-3_2.zip.

8. Tom qab ntawv unzip wiringPi.zip:

unzip wiringPi

cd kab w

Thiab khiav cov lus txib no:

chmod 777 ua

./ tsim

Kos lub installation nrog:

gpio vwm

9. Rov qab mus rau lub nplaub tshev tseem ceeb, thiab unzip bcm2835-1_45.zip

unzip bcm2835-1_45.zip

cd bcm2835-1_45

10. Tom qab ntawv ua qhov no, txhawm rau txhim kho lub tsev qiv ntawv:

./configure

ua sudo ua kos sudo ua nruab

11. Rov qab mus rau /home/pi/1.5inch-OLED-with-RPi/, thiab khiav qhov no, los ntsuas OLED:

cd/Demo_Code/Nab hab sej/

sudo python main.py

Tom qab ntawd kuv kuj yuav tsum tau teeb tsa lub tsev qiv ntawv rau WS2812B LED-strip, ua raws cov lus qhia no.

Tom qab ntawd nws tsuas yog teeb meem ntawm kev sau cov cai, uas tau siv li ob peb lub hlis txij thaum pib kom tiav, ua haujlwm ntawm thiab tawm. Kuv tus lej tuaj yeem pom ntawm kuv GitHub ntawm no.

Kauj Ruam 3: Txheeb Xyuas Huab Cua API

Kho lub Huab Cua API
Kho lub Huab Cua API

1. Cd rau hauv LED_Thermometer_Code_and_OLED_driver:

cd LED_Thermometer_Code_and_OLED_driver

2. Tom qab ntawd qhib Official_Digital_LED_Thermometer_v1-0.py:

nano Official_Digital_LED_Thermometer_v1-0.py

Thiab tom qab ntawv nqes mus thiab kho qhov api-key, rau koj tus lej api, los ntawm openweathermap.org, raws li qhia hauv daim duab saum toj no. Kuj hloov lub nroog-id thiab npe nroog, rau qhov koj xav tau.

Kauj Ruam 4: Kev Cai PCB

Qhov khoom plig thib ob hauv Raspberry Pi Contest 2020

Pom zoo: