Cov txheej txheem:
- Kauj Ruam 1: Dab tsi yog Daim Duab Pom Teeb Meem Qhov Teeb Meem thiab Yuav Ua Li Cas Kuv Thiaj Li Kho Nws
- Kauj Ruam 2: Yam Ua Haujlwm Li Cas
- Kauj Ruam 3: Cov Cuab Yeej thiab Cov Cheeb Tsam
- Kauj Ruam 4: Schematics (Fritzing)
- Kauj ruam 5: Txheej txheem
- Kauj Ruam 6: Qee Cov Duab thiab Yeeb Yaj Kiab Los Ntawm Cov Txheej Txheem Sib txawv
- Kauj ruam 7: Source Code
Video: 4x4 Demo ntawm Electronic Chessboard/ Nrog Arduino Mega + RFID Reader + Hall-effect Sensors: 7 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Nyob zoo cov neeg tsim khoom, Kuv yog Tahir Miriyev, 2018 kawm tiav los ntawm Middle East Technical University, Ankara/ Turkey. Kuv kawm tiav hauv Kev Ua lej, tab sis kuv ib txwm nyiam ua cov khoom, tshwj xeeb tshaj yog thaum nws koom nrog qee qhov ua haujlwm nrog cov khoom siv hluav taws xob, tsim qauv thiab ua haujlwm. Ua tsaug rau cov chav kawm tshwj xeeb ntawm kev tsim qauv, muaj nyob rau ntawm peb chav haujlwm ntawm Kev Tsim Qauv, Kuv tau txais lub sijhawm los ua qee yam txaus nyiam tiag tiag. Txoj haujlwm no tuaj yeem raug kho raws li Lub Sijhawm Ua Haujlwm, tau ua tiav rau lub sijhawm kawm tag nrho (4 lub hlis). Cov tub ntxhais kawm tau muab txoj haujlwm los nrhiav txoj hauv kev muaj tswv yim los tsim cov khoom uas twb muaj lawm/nthuav tawm thiab paub lawv lub tswv yim siv Arduino microcontrollers thiab cov ntsuas. Kuv tau xav txog chess, thiab tom qab ua qee qhov kev tshawb fawb ntawm cov phiaj xwm ua tiav, Kuv tau pom tias hauv cov phiaj xwm yav dhau los cov neeg tsim khoom siv tau npaj teeb tsa tshuab ua si chess (qhov twg txhua qhov txav ntawm txhua daim duab tau teeb tsa hauv qhov tseem ceeb), nrog rau Raspberry Pi, qee qhov MUX Yog, LED's thiab reed keyboards. Hauv kuv txoj haujlwm, txawm li cas los xij, Kuv txiav txim siab tshem tawm ib qho software sab nraud hais txog lub cav chess, thiab txhawm rau nrhiav kev daws teeb meem rau cov teeb meem Kev Pom Duab, siv RFID nyeem ntawv, Hall-effect sensors thiab Arduino Mega.
Kauj Ruam 1: Dab tsi yog Daim Duab Pom Teeb Meem Qhov Teeb Meem thiab Yuav Ua Li Cas Kuv Thiaj Li Kho Nws
Txhawm rau muab nws yooj yim, xav tias koj muaj chessboard nrog "lub hlwb" = microcontroller, thiab koj yuav tsum ua rau koj lub rooj tsav xwm nkag siab tus lej uas koj tuav hauv koj txhais tes thiab koj tau tso nws nyob qhov twg. Nov yog qhov teeb meem ntawm Daim Duab Pom Zoo. Kev daws qhov teeb meem no tsis tseem ceeb thaum koj muaj lub tshuab chess nrog txhua daim sawv ntawm lawv thawj txoj haujlwm ntawm lub rooj tsavxwm. Ua ntej kuv piav qhia vim li cas nws thiaj yog li ntawd, cia kuv ua qee cov lus hais.
Rau cov neeg uas mob siab txog yuav ua haujlwm li cas ntawm no, kuv yuav tsum piav qhia meej tias vim li cas peb thiaj xav tau tus pas nrig (lossis hauv kuv qhov xwm txheej, kuv siv Hall-effect sensors): yog tias koj tso cov hlau nplaum hauv qab txhua daim thiab khaws nws los ntawm ib lub xwmfab ntawm lub rooj tsavxwm (piv txwv tias muaj qhov hloov pauv hauv qab txhua lub xwmfab) vim muaj/tsis muaj nyob ntawm qhov chaw sib nqus saum lub sensor, koj tuaj yeem ua rau koj tus tswj hwm nkag siab tias puas muaj/tsis yog ib qho sawv ntawm lub xwmfab. Txawm li cas los xij, nws tseem tsis qhia microcontroller dab tsi txog qhov twg yog daim twg sawv ntawm lub xwmfab. Nws tsuas yog qhia tias muaj/tsis yog ib qho ntawm lub xwmfab. Txog tam sim no, peb tau ntsib ntsej muag nrog Daim Duab Pom Teeb Meem qhov teeb meem, uas tuaj yeem daws tau siv lub cav chess, nrog txhua daim tso rau ntawm lawv thawj txoj haujlwm thaum chess game pib. Txoj hauv kev no microcontroller "paub" qhov twg txhua daim ntawv sawv los ntawm qhov pib, nrog txhua qhov chaw nyob ruaj khov hauv lub cim xeeb. Txawm li cas los xij, qhov no coj peb qhov kev txwv loj: koj tsis tuaj yeem xaiv, cia peb hais tias, muaj pes tsawg daim thiab tso lawv nyob qhov twg tsis raug ntawm lub rooj tsavxwm thiab pib tshuaj xyuas qhov kev ua si. Koj ib txwm yuav tsum pib txij thaum pib, txhua daim yuav tsum yog ntawm lub rooj tsavxwm, vim qhov no yog tib txoj hauv kev rau lub microcontroller taug qab lawv qhov chaw thaum koj nqa ib daig thiab tso rau ntawm lwm lub xwmfab. Hauv qhov tseeb, qhov no yog qhov teeb meem kuv pom thiab txiav txim siab ua haujlwm rau.
Kuv txoj kev daws tau yooj yim heev, txawm hais tias muaj tswv yim. Kuv tso tus nyeem ntawv RFID nyob rau sab xub ntiag ntawm lub rooj tsavxwm. Lub caij no, kuv txuas tsis tsuas yog cov hlau nplaum hauv qab tab sis tseem muaj daim npav RFID, nrog txhua daim muaj tus lej tshwj xeeb. Yog li, ua ntej koj tso daim duab ntawm ib qho xwm txheej xav tau, koj tuaj yeem xub tuav daim ntawv ze rau RFID nyeem ntawv thiab cia nws nyeem tus lej, txheeb xyuas daim, khaws nws hauv lub cim xeeb, thiab tom qab ntawd koj tuaj yeem tso nws txhua qhov chaw koj xav tau. Tsis tas li, tsis txhob siv cov hloov pauv reed, txhawm rau ua kom yooj yim rau kev tsim hluav taws xob, kuv tau siv cov cuab yeej ntsuas qhov ntsuas, uas ua haujlwm zoo ib yam, nrog qhov sib txawv ntawm kev xa 0 lossis 1 mus rau microcontroller raws li cov ntaub ntawv digital, uas txhais tau tias "muaj" lossis "tsis muaj" ib qho ntawm lub xwmfab, feem. Kuv tau ntxiv LED ib yam (hmoov tsis zoo ib yam xim, tsis muaj ib qho), yog li thaum koj nqa daim, txhua qhov chaw xwm txheej, qhov twg tuaj yeem nqa daim tso, yuav pom. Xav txog nws raws li kev qhia paub rau cov kawm paub chess:)
Thaum kawg, Kuv xav nco ntsoov tias txawm tias qhov tseeb kuv tau siv ntau yam txheej txheem, txoj haujlwm tseem yooj yim thiab nkag siab tau, tsis ua haujlwm tob lossis nyuaj. Kuv tsis muaj sijhawm txaus los txuas nrog 8x8 chessboard (tseem vim tias 64 lub cuab yeej cuam tshuam cov cuab yeej raug nqi nyob hauv Qaib Cov Txwv, Kuv tau them tag nrho cov nuj nqis cuam tshuam nrog tus thawj coj), yog vim li cas kuv thiaj ua 4x4 demo version nrog tsuas yog ob daim sim: Pawn thiab Poj huab tais. Hloov chaw ntawm kev siv lub tshuab chess, Kuv tau sau qhov chaws rau Arduino, uas tsim txhua yam koj yuav pom hauv cov vis dis aus hauv qab no.
Kauj Ruam 2: Yam Ua Haujlwm Li Cas
Ua ntej peb dhau mus rau cov lus piav qhia ib qib zuj zus ntawm txoj haujlwm tau ua tiav, Kuv xav tias nws yuav zoo dua los saib cov vis dis aus qhia thiab tau txais qee lub tswv yim zoo ntawm qhov kuv tham txog.
Nco tseg #1: ib qho ntawm LED liab (ua ntej hauv kab/ ntawm sab laug mus rau sab xis) hlawv tawm, tsis txhob xav li cas.
Nco tseg #2: txawm hais tias siv dav, los ntawm kuv qhov kev paub Kuv tuaj yeem hais tias RFID Technology tsis yog lub tswv yim zoo tshaj plaws los siv hauv DIY daim ntawv thov (tau kawg yog tias koj muaj lwm txoj hauv kev). Ua ntej txhua yam ua haujlwm, Kuv tau ua ntau qhov kev sim nrog tso cov ntawv chess ze rau tus nyeem ntawv thiab tos kom txog thaum nws nyeem ID raug. Qhov chaw nres nkoj yuav tsum tau teeb tsa rau qhov ntawd vim tias txoj hauv kev uas RFID nyeem tus lej tsuas yog mob taub hau. Ib tus yuav tsum sim nws tus kheej txhawm rau nkag siab qhov teeb meem. Yog tias koj xav tau kev pab ntxiv, thov xa ntawv tuaj rau kuv ([email protected]) lossis ntxiv rau skype (tahir.miriyev9r1), yog li peb tuaj yeem teem sijhawm sib tham thiab tham txog txhua yam hauv cov ntsiab lus, Kuv yuav piav qhia txhua yam kom meej.
Kauj Ruam 3: Cov Cuab Yeej thiab Cov Cheeb Tsam
Nov yog cov npe ntawm txhua yam cuab yeej uas kuv siv rau txoj haujlwm: Cov khoom siv hluav taws xob:
- Khoom noj khoom haus (x1)
- Omnidirectional A1126LUA-T (IC-1126 SW OMNI 3-SIP ALLEGRO) Hall effect sensors (x16)
- Yooj yim 5 hli LEDs (x16)
- Jumper xov hlau
- 125 kHz RFID nyeem ntawv thiab Kav hlau txais xov (x1)
- Arduino Mega (x 1)
- RFID 3M Cim npe (x2)
Lwm cov ntaub ntawv:
- Plexiglass
- Ntawv ci
- Ntoo Ntoo (ntoo)
- Cov xim pleev xim acrylic (xim ntsuab tsaus thiab pleev) x2
- Cov duab los qhia nyias
- 10 hli puag ncig cov hlau nplaum (x2)
- Pawn thiab poj huab tais daim
- Soldering hlau thiab cov khoom siv soldering
Kauj Ruam 4: Schematics (Fritzing)
Schematics yog qhov nyuaj me ntsis, kuv paub, tab sis lub tswv yim yuav tsum meej. Nws yog thawj zaug kuv siv Fritzing (tau pom zoo los ntawm txoj kev), tej zaum kev sib txuas tuaj yeem kos tau raug dua. Txawm li cas los xij, Kuv tau sau tseg txhua yam hauv kab lus. Note: Kuv tsis tuaj yeem pom tus qauv tseeb ntawm RDIF Reader ntawm cov khoom siv hauv cov ntaub ntawv ntawm Fritzing. Tus qauv kuv siv yog 125Khz RFID module - UART. Koj tuaj yeem pom cov lus qhia hauv Youtube txog yuav teeb tsa tus qauv no nrog Arduino li cas.
Kauj ruam 5: Txheej txheem
Sijhawm los piav qhia txog yam khoom tau ua. Thov ua raws cov lus piav qhia ib qib zuj zus:
1. Siv daim duab ntawv 21x21 cm, nrog rau qee daim duab los qhia ntxiv los txiav thiab lo rau phab ntsa ntawm ib sab ntawm lub rooj tsavxwm, txhawm rau ua 16 lub xwmfab nrog A B C D 1 2 3 4 suav sau. Txij li cov duab los qhia yog nyias, koj tuaj yeem lo 16 lub ntsej muag cuam tshuam rau hauv txhua lub xwmfab, nrog 3 ceg ib leeg thiab 16 LED nrog 2 ceg ib leeg.
2. Tom qab koj teeb tsa cov khoom, koj yuav tsum tau ua qee qhov txuas, txhawm rau txuas ob txhais ceg ntawm Hall-effect sensors thiab LED's rau jumper xov hlau. Txij ntawm no mus, Kuv xav pom zoo xaiv cov xov hlau nyob hauv txoj kev ntse, yog li koj yuav tsis nkag siab nrog + thiab - ob txhais ceg ntawm LED's, kuj VCC, GND thiab PIN ceg ntawm Hall -effect sensors. Tau kawg, ib tus tuaj yeem luam PCB nrog cov cim thiab txawm tias WS2812 hom LED twb tau muag lawm, tab sis kuv txiav txim siab ua kom txoj haujlwm yooj yim thiab ua qee yam ntxiv "ua haujlwm". Txog ntawm qhov no, txhua yam koj yuav tsum ua yog npaj cov hlua thiab cov cim ntsuas, nyob rau theem tom qab tom qab los ntawm Fritzing cov phiaj xwm koj tuaj yeem pom qhov twg koj yuav tsum txuas qhov kawg ntawm txhua lub xaim. Tsis ntev, qee tus ntawm lawv yuav ncaj qha mus rau tus lej PIN ntawm Arduino Mega (muaj txaus ntawm lawv ntawm Arduino), lwm tus mus rau lub khob cij thiab txhua GNDs tuaj yeem muab muag rau ib qho ntawm txoj hlua (ua rau hauv av) uas tom qab ntawd yuav tsum txuas nrog GND ntawm Arduino board. Ib qho lus ceeb toom tseem ceeb ntawm no: Hall effect sensors yog OMNIDIRECTIONAL, uas txhais tau tias nws tsis muaj teeb meem twg tus ncej ntawm cov hlau nplaum yuav nyob ze rau lub sensor, nws yuav xa 0 cov ntaub ntawv thaum muaj qee qhov chaw sib nqus nyob ze thiab 1 thaum tsis muaj, uas yog, cov hlau nplaum nyob deb (ntau dua li cia hais 5 sm) los ntawm lub sensor.
3. Npaj cov ntawv zoo sib xws 21x21 cm thiab txhim kho Arduino Mega thiab daim txiag ntev ntev rau nws. Koj tseem tuaj yeem txiav 4 phab ntsa ntawm qhov siab xav tau los ntawm cov duab los qhia dua, thiab lo lawv ncaj nrog ob txheej ntawm 21x21 cm square boards. Tom qab ntawd ua raws Fritzing Schematics txhawm rau teeb tsa yam khoom. Koj tseem tuaj yeem teeb tsa RFID nyeem ntawv tom qab koj ua tiav nrog LEDs thiab Hall-effect sensors.
4. Kuaj seb puas yog txhua lub LEDs thiab lub ntsuas cua ua haujlwm, los ntawm kev xa cov cim siv cov lej yooj yim. Tsis txhob zam cov kauj ruam no vim nws yuav qhia koj sim seb txhua yam ua haujlwm tau zoo thiab dhau mus rau kev tsim kho lub rooj tsavxwm ntxiv.
5. Npaj Pawn thiab Poj huab tais, nrog ob lub hlau nplaum ntawm 10 cm lub vojvoog txuas hauv qab no, ntxiv rau puag ncig RFID cim npe. Tom qab ntawd, koj yuav tsum tau nyeem IDs ntawm cov cim npe los ntawm Serial Screen ntawm Arduino IDE.
6. Yog tias txhua yam ua haujlwm tau zoo, koj yuav pib ua tus lej tseem ceeb thiab sim ua tej yam!
7 (yeem). Koj tuaj yeem ua qee yam txuj ci ua haujlwm nrog ntoo uas yuav ua rau koj qhov kev pom zoo dua qub. Qhov ntawd yog nyob ntawm koj lub siab nyiam thiab kev xav.
Kauj Ruam 6: Qee Cov Duab thiab Yeeb Yaj Kiab Los Ntawm Cov Txheej Txheem Sib txawv
Kauj ruam 7: Source Code
Tam sim no, thaum peb ua tiav nrog tus qauv, peb npaj kom coj nws mus rau lub neej nrog Arduino code hauv qab no. Kuv tau sim tawm ntau cov lus raws li kuv tuaj yeem ua, txhawm rau ua kom cov txheej txheem ntawm kev tshuaj ntsuam nkag siab. Yuav kom ncaj ncees, kev xav yuav zoo li nyuaj me ntsis los ntawm qhov pom thawj zaug, tab sis yog tias koj khawb tob rau hauv cov laj thawj ntawm cov cai, nws yuav zoo dua.
Nco tseg: Zoo ib yam li daim chessboard tiag tiag, Kuv suav daws suav tsis suav ua plaub fab li A1, A2, A3, A4, B1,…, C1,…, D1,.., D4. Txawm li cas los xij, hauv txoj cai, nws tsis muaj txiaj ntsig los siv qhov cim tseg no. Yog li kuv tau siv cov cim thiab sawv cev cov plaub fab li 00, 01, 02, 03, 10, 11, 12, 13,…, 32, 33 feem.
Ua tsaug rau koj saib! Kuaj txhua yam thiab pub dawb los sau rau hauv cov lus hais txog txhua yam kev ua yuam kev uas kuv tau ua dhau los, kev txhim kho, cov lus qhia thiab lwm yam..com) lossis ntxiv rau skype (tahir.miriyev9r1), yog li peb tuaj yeem teem sijhawm sib tham thiab tham txog yam hauv cov ntsiab lus. Hmoov zoo!