Cov txheej txheem:

DIY I2C LCD Zaub Nrog Cov Lus Qhia: 6 Cov Kauj Ruam
DIY I2C LCD Zaub Nrog Cov Lus Qhia: 6 Cov Kauj Ruam

Video: DIY I2C LCD Zaub Nrog Cov Lus Qhia: 6 Cov Kauj Ruam

Video: DIY I2C LCD Zaub Nrog Cov Lus Qhia: 6 Cov Kauj Ruam
Video: Real Time Clock mit Ardublock Tutorial für Arduino 2024, Hlis ntuj nqeg
Anonim
DIY I2C LCD Zaub Nrog Cov Tswv Yim
DIY I2C LCD Zaub Nrog Cov Tswv Yim

Qhov sib piv ntawm LCD siv nrog Arduino (16x2 lossis 20x4) muaj 16 tus pin. Tsuas yog 6 tus I/O tus pin xav tau ntawm Arduino, tab sis ua li cas yog tias koj tuaj yeem tau txais qhov ntawd mus rau ob I/O pins, thiab tseem muaj cov pins muaj rau lwm yam khoom siv?

I2C interface yog nyob ntawm tus pin A4 thiab A5 ntawm Arduino UNO. Cov no yog qhov chaw nyob, thiab yog li ntawd tuaj yeem sib koom nrog lwm I2C cov cuab yeej uas muaj chaw nyob sib txawv. Tam sim no, koj tuaj yeem yuav I2C LCD's, thiab koj tseem tuaj yeem pom I2C LCD nrog cov chaw nyob sib txawv, tab sis lawv feem ntau yog ob kab LCD's, thiab cov chaw nyob raug tsau. Kuv yuav qhia koj li cas los tsim koj tus kheej I2C interface, xaiv ib ntawm 8 qhov chaw nyob, thiab txawm tias muaj peev xwm ntxiv txog 8 qhov kev tawm tswv yim lossis kev tso tawm, siv MCP23017 16 chaw nres nkoj nthuav dav nti. Qhov no yog tib lub nti Adafruit siv rau lawv I2C LCD Keypad Shield, thiab siv lawv lub tsev qiv ntawv los tham nrog nws. Koj tuaj yeem muaj txog li 16 lub LCD zaub, lossis txog li 128 digital I/O pins, thiab kev sib txuas ua ke ntawm qhov ntawd

NPE 2301

20x4 LCD lossis 16x2 LCD

Kauj Ruam 1: Txuas LCD

LCD Txuas
LCD Txuas

Kev sib txuas ntawm Hitachi hom sib xws LCD (2 lossis 4 kab) thiab MCP23017 tau qhia hauv daim duab.

SDA (tus pin 13 ntawm MCP23017) txuas rau Arduino A4, thiab SCL (tus pin 12) txuas rau Arduino A5. Qee tus hais qhia 4.7k rub cov neeg tawm tsam (tus pin 13 txog +5v thiab tus pin 12 txog +5v) tab sis txoj haujlwm no ua haujlwm tau zoo yam tsis muaj lawv.

Daim ntawv ceeb toom 220 Ohm resistor ntawm LCD k (cathode, gnd) kev sib txuas. Qhov no yog YUAV TSUM!

Yog tsis muaj nws, koj tuaj yeem tshuab MCP23107 lub teeb nrig rov qab. Muaj 3 tus pin koj tuaj yeem siv rau lub teeb pom kev zoo. Tus Pin 1 hu ua XEEB hauv Lub Tsev Qiv Ntawv thiab kos duab, Tus lej 28 hu ua GREEN, thiab tus lej 27 hu ua RED. Yog tias koj muaj monochrome LCD, koj tuaj yeem siv ib qho ntawm peb tus pin, thiab siv cov lus sib tham xim. Yog tias koj muaj RGB teeb pom kev zoo, koj tuaj yeem tau txais ntau xim ua ke. Txheeb xyuas lawv ntawm

Pins 15, 16, thiab 17 ntawm MCP23017 txiav txim siab I2C chaw nyob. Peb muaj tag nrho 3 qhov hauv paus, vim qhov no yog qhov chaw nyob tsis raug cai Adafruit lub tsev qiv ntawv siv. Txhawm rau ntxiv ntau cov lus, lossis xaiv lwm qhov chaw nyob, lub tsev qiv ntawv yuav tsum tau hloov kho, yog li peb yuav mus nrog lub neej ntawd tam sim no.

Adafruit_MCP23017.h muaj cov kab hauv qab no:

#define MCP23017_ADDRESS 0x20

Pin 17 = A2, Pin 16 = A1, thiab Pin 15 = A0

0 = av, 1 = +5v

Qhov chaw nyob yog 0100A2A1A0, yog li txij li peb tau tsaws tag nrho 3 kab, peb siv binary 0100000, lossis 20 hauv hex (0x20). 0100111 yuav yog 27 hauv hex (0x27).

Kauj Ruam 2: Txuas Lub Pob Ntseg

Txuas lub khawm nkag
Txuas lub khawm nkag

Peb suav nrog 5 cov nyees khawm nkag rau hauv qhov haujlwm no. Peb yuav hu lawv sab laug, sab xis, nce, nqis, thiab xaiv. Cov thawb khawm txheem yog qhov zoo rau qhov no, tab sis ib qho digital on / off sensor yuav ua haujlwm.

Txuas koj cov nyees khawm raws li hauv qab no:

Sab laug txuas ntawm Gnd thiab tus pin 25 ntawm MCP23017

Txoj cai txuas ntawm Gnd thiab tus pin 22

Up txuas ntawm Gnd thiab tus pin 24

Down txuas ntawm Gnd thiab tus pin 23

Xaiv txuas ntawm Gnd thiab tus pin 21

Kauj Ruam 3: Kos Duab LCD

LCD Sau
LCD Sau

Rub tawm thiab teeb tsa Adafruit lub tsev qiv ntawv, ua piv txwv "Nyob Zoo Ntiaj Teb", thiab lub lcd interface no tau ua haujlwm. Peb siv tus pin 27 ntawm MCP23017, yog li tsuas yog qhia RED rau lub teeb pom kev zoo ib yam.

Peb yuav hais daws qhov chaw nyob ntawm lub tsev qiv ntawv kom txog li 8 MCP23017 cov chips tuaj yeem siv rau hauv cov theem tom ntej. Email rau kuv nrog cov lus nug.

Rau ntau txoj haujlwm uas siv cov nti no thiab cov cai ntxiv, saib:

arduinotronics.blogspot.com/2015/11/wifi-rechargeable-internet-clock.html

arduinotronics.blogspot.com/2015/10/add-up-to-128-inputsoutputs-or-mix-to.html

Kauj ruam 4: Nws Ua Haujlwm Li Cas

Image
Image

Nov yog qhov haujlwm uas peb tsim los siv Adafruit version ntawm txoj haujlwm no. Tus DIY version yog xaim tib yam, tab sis koj yuav muaj cov xim ib txwm siv hloov ntawm RGB backlight.

Kauj ruam 5: Cov ntaub ntawv

Cov ntaub ntawv ua tiav muaj nyob ntawm

Pom zoo: