Cov txheej txheem:

Bluetooth AT Commands Settings (HC05 HC06): 4 Cov Kauj Ruam
Bluetooth AT Commands Settings (HC05 HC06): 4 Cov Kauj Ruam

Video: Bluetooth AT Commands Settings (HC05 HC06): 4 Cov Kauj Ruam

Video: Bluetooth AT Commands Settings (HC05 HC06): 4 Cov Kauj Ruam
Video: Arduino Bluetooth AT commands HC 05 HC 06 2024, Lub Xya hli ntuj
Anonim
Bluetooth AT Commands Settings (HC05 HC06)
Bluetooth AT Commands Settings (HC05 HC06)

Hav guys! Kuv Vam tias koj twb nyiam kuv cov lus qhia yav dhau los "Yuav Ua Li Cas Tswj Servo Motor Arduino Tutorial" Nov yog lwm cov ntaub ntawv qhia qhia koj yuav ua li cas cuam tshuam nrog koj tus qauv Bluetooth thiab teeb tsa nws cov chaw los ntawm AT cov lus txib, yog li yog tias koj xav hloov koj Arduino Bluetooth lub npe lossis tus lej cim lossis lwm yam Bluetooth paramerters, qhov no yuav yog cov lus qhia zoo tshaj plaws rau koj ua tiav nws.

Thaum ua qhov kev qhia no, peb tau sim ua kom ntseeg tau tias kab lus no yuav yog cov lus qhia zoo tshaj plaws rau koj txhawm rau kom txaus siab kawm cov hauv paus ntawm yuav ua li cas bluetooth modules ua haujlwm hauv AT hom hais kom ua thiab kawm qee cov ntaub ntawv muaj txiaj ntsig txog yuav siv li cas kom raug AT hais kom ua teeb.

Cov ntsiab lus zoo li no tseem ceeb tshwj xeeb rau cov uas xav pib kawm hluav taws xob thiab kev kawm neeg hlau. yog li peb vam tias phau ntawv qhia no muaj cov ntaub ntawv xav tau.

Koj yuav kawm dab tsi los ntawm cov lus qhia no:

Kawm keeb kwm ntawm AT cov lus txib pom.

Nkag siab qhov sib txawv ntawm HC bluetooth modules.

Kawm paub kho vajtse ntawm HC Bluetooth module.

Ua qhov tsim nyog txuas kab duab nrog Arduino board.

Teeb Bluetooth rau AT hom kev hais kom ua.

Pib Bluetooth tshiab chaw

Kauj Ruam 1: Yuav Ua Li Cas Txuas Nrog Bluetooth Modules

Yuav ua li cas cuam tshuam nrog Bluetooth Modules
Yuav ua li cas cuam tshuam nrog Bluetooth Modules
Yuav ua li cas cuam tshuam nrog Bluetooth Modules
Yuav ua li cas cuam tshuam nrog Bluetooth Modules
Yuav ua li cas cuam tshuam nrog Bluetooth Modules
Yuav ua li cas cuam tshuam nrog Bluetooth Modules

Pib nrog txoj haujlwm piav qhia, peb yuav hloov kho tus qauv Bluetooth tsis, tab sis peb tuaj yeem sib txuas lus nrog Bluetooth modules li cas!

Zoo li ntau lwm yam cuab yeej Bluetooth modules lees txais kev sib txuas lus los ntawm AT cov lus txib los teeb tsa lawv cov kev teeb tsa xws li lub npe, tus lej cim, tus lej baud thiab lwm qhov chaw.

Cov lus txib AT no yog dab tsi

Rov qab mus rau xyoo 1981 Dennis Hayes tau tsim cov lus hais tshwj xeeb los cuam tshuam rau "Hayes smartmodem device" thiab cov lus hais kom teeb tsa no muaj cov kab ntawv luv luv uas tuaj yeem sib xyaw ua cov lus txib rau kev ua haujlwm xws li hu xov tooj, dai, thiab hloov qhov tsis sib xws ntawm kev sib txuas. Los ntawm no nws los txog lub tswv yim los tsim ntau dua thiab ntau dua Hayes teeb lossis AT cov lus txib teeb tsa los cuam tshuam ntau yam khoom siv siv qee yam ua cim ua ntej.

Zoo li lwm yam khoom siv, Bluetooth cov qauv muaj AT hais kom ua qhov chaw uas koj tuaj yeem cuam tshuam lawv siv AT cov lus txib los teeb tsa lawv.

Yog li txhawm rau xa AT cov lus txib mus rau Bluetooth module peb xav tau thawj zaug tig nws mus rau AT hom kev hais kom ua.

Cov qauv siv Bluetooth nrov tshaj plaws yog HC-06 thiab HC-05 module uas yuav siv hauv peb qhov kev qhia.

Nws nyuaj rau qhov sib txawv ntawm ob lub Bluetooth no tsuas yog pom, tab sis siv pawg thawj coj saib qhov sib txawv yog nyob ntawm tus pin.

Kauj ruam 2: Bluetooth Kho Vajtse

Bluetooth Kho vajtse
Bluetooth Kho vajtse
Bluetooth Kho vajtse
Bluetooth Kho vajtse

Rau peb tus qauv HC-05 peb muaj tag nrho rau tus pin no:

  1. KEY lossis Pab Tau: Tus pin no yuav tsum tau rub siab kom nkag mus rau AT hom. Hauv peb tus qauv Bluetooth peb twb muaj lub laub khawm tseem ceeb heev los tsim kev rub siab teeb ntawm KEY tus pin
  2. VCC thiab GND rau lub hwj chim.
  3. RXD thiab TXD rau cov ntaub ntawv tawm tswv yim/tso tawm
  4. STATE tus pin, tsuas yog tsis quav ntsej nws vim tias tej zaum nws tsis txuas nrog ib qho ntawm Bluetooth pins thiab peb yuav tsis xav tau nws hauv qhov kev qhia no.

Kuv yuav siv Arduino pawg thawj coj los xa cov lus txib hauv AT rau kuv tus qauv Bluetooth.

Kauj Ruam 3: Circuit Diargram

Circuit Diargram
Circuit Diargram

Kuv tau txav mus rau easyEDA los tsim kuv daim duab qhia chaw rau qhov kev qhia no thiab ntawm no yog yuav ua li cas xaim lub bluetooth module rau Arduino, txhua yam nws yuav siv yog tus lej tus lej 3 los ntawm Arduino mus rau RXD ntawm Bluetooth thiab tus lej tus lej 2 ntawm Arduino rau TXD ntawm Bluetooth, GND rau GND thiab VCC rau Arduino 5V.

Kauj Ruam 4: Cov lej thiab Xeem

Codes thiab Tests
Codes thiab Tests
Codes thiab Tests
Codes thiab Tests
Codes thiab Tests
Codes thiab Tests
Codes thiab Tests
Codes thiab Tests

Tsiv mus rau ntu software, raws li kuv tau hais los lawm peb yuav siv Arduino board los sib tham nrog Bluetooth.

Thaum peb lub zog Arduino peb yuav muaj Bluetooth LED ntsais muag nrawm nyob rau ib ntus ntawm ib nrab ntawm qhov thib ob uas txhais tau tias AT hom tsis tau nkag mus ua ntej ua kom lub zog Arduino tsuas yog tuav lub pob nyem thiab tom qab ntawd ua haujlwm rau koj Arduino, vim li ntawd koj yuav muaj LED ntsais ntsais qeeb hauv lub sijhawm ntawm 2 vib nas this uas qhia txog kev ua tiav ntawm AT hom kev hais kom ua. Tam sim no peb tau khiav Arduino cov saib xyuas lossis lwm yam kev saib xyuas zoo ib yam li teraterms kom pib xa AT cov lus txib, koj tuaj yeem tau txais AT cov lus txib los ntawm rub tawm txuas hauv qab no, daim ntawv no qhia txog AT muaj cov lus teev npe rau peb Bluetooth module.

Txhawm rau pib qhov kev teeb tsa peb ua haujlwm saib xyuas thiab peb teeb tsa tus nqi baud rau 9600 thiab ob qho tib si NL & kev xa rov qab, tam sim no yog tias koj xa cov cim AT los ntawm tus lej saib xyuas koj yuav tsum tau txais kev teb zoo los ntawm Bluetooth module.

Peb yuav pib los ntawm kev teeb tsa Baud tus nqi rau 9600BPS thiab ua li ntawd peb yuav tsum sau AT+UART = 9600, 0, 0 tom qab ntawd ntaus nkag, hauv txhua qhov kev ua haujlwm tau zoo koj yuav tsum tau txais cov lus teb OK los ntawm Bluetooth module

Peb tseem yuav hloov lub Bluetooth npe rau Device1 yog li peb sau AT+NAME = Device1

Thiab peb yuav hloov tus password Bluetooth ib yam rau xyoo 2020 yog li peb sau AT+PSWD = 2020

Ntau lwm cov lus qhia AT muaj nyob hais txog kev siv Bluetooth module yog li txhua yam koj yuav tsum tau ua yog rub tawm cov ntawv txuas rau qhov txuas hauv qab no thiab nyeem nws kom tau txais txoj cai AT hais kom ua uas koj xav tau.

Ua raws cov lus qhia no koj yuav muaj peev xwm tam sim no los kho Bluetooth ntawm koj cov neeg hlau thiab cov cuab yeej thiab koj tuaj yeem ua haujlwm zoo li cov kws tshaj lij.

Txog kuv cov kev qhia tom ntej koj tuaj yeem qhia qee cov ntsiab lus hauv ntu lus hauv qab no,

Ib qho kawg, nco ntsoov tias koj ua hluav taws xob txhua hnub. Ntsib koj zaum tom ntej

Pom zoo: