Cov txheej txheem:

Pib Nrog HC05 Bluetooth Module & Arduino [Tutorial]: 6 Cov Kauj Ruam
Pib Nrog HC05 Bluetooth Module & Arduino [Tutorial]: 6 Cov Kauj Ruam

Video: Pib Nrog HC05 Bluetooth Module & Arduino [Tutorial]: 6 Cov Kauj Ruam

Video: Pib Nrog HC05 Bluetooth Module & Arduino [Tutorial]: 6 Cov Kauj Ruam
Video: Pib Tshiab Nrog Kuv- hu: CM XIONG Feat.NIKKI THAO [ Official Audio] 2023 2024, Kaum ib hlis
Anonim
Pib Nrog HC05 Bluetooth Module & Arduino [Tutorial]
Pib Nrog HC05 Bluetooth Module & Arduino [Tutorial]

Koj tuaj yeem nyeem qhov no thiab lwm yam kev qhia zoo ntawm ElectroPeak lub vev xaib raug cai

Hauv qhov kev qhia no, koj yuav kawm paub sib txuas lus thiab xa cov ntaub ntawv nrog Bluetooth siv HC05 Bluetooth Module thiab Arduino board. Qhov kawg ntawm kab lus no, koj yuav kawm:

  • Cov ntaub ntawv dav dav txog Bluetooth raws tu qauv
  • Yuav xa cov ntaub ntawv siv Bluetooth li cas
  • Yuav ua li cas xa AT-Command rau HC05

Kauj Ruam 1: Cov Lus Taw Qhia luv rau Bluetooth Kev Sib Txuas Lus thiab Cov Txheej Txheem

Muaj ntau txoj hauv kev rau kev sib txuas lus wireless xws li NRF, ZigBee, Wi-nkaus, thiab Bluetooth.

Bluetooth raws tu qauv; tus txheej txheem kev sib txuas lus pheej yig hauv PAN network, nrog cov ntaub ntawv siab tshaj plaws ntawm 1Mb/S, ua haujlwm nyob rau hauv thaj tsam ntawm 100 meters siv 2.4 G zaus yog ib txoj hauv kev sib txuas lus wireless.

HC05 module yog Bluetooth module siv kev sib txuas lus, feem ntau yog siv hauv cov phiaj xwm hluav taws xob.

HC05 Bluetooth module qhov tseem ceeb tshwj xeeb:

  • Ua haujlwm voltage: 3.6V - 5V
  • Kav hlau txais xov sab hauv: Yog
  • Kev sib txuas tsis siv neeg mus rau lub cuab yeej kawg: Yog

Kauj Ruam 2: Xa Cov Ntaub Ntawv rau Arduino Ntawm Bluetooth

HC05 module muaj kev tswj hwm sab hauv 3.3v thiab yog vim li cas koj tuaj yeem txuas nws mus rau 5v qhov hluav taws xob. Tab sis peb xav pom zoo 3.3V qhov hluav taws xob, txij li cov laj thawj ntawm HC05 cov xov tooj sib txuas txuas yog 3.3V. Kev muab 5V rau tus qauv tuaj yeem ua rau puas rau tus qauv.

Txhawm rau tiv thaiv tus qauv los ntawm kev puas tsuaj thiab ua kom nws ua haujlwm tau zoo, koj yuav tsum siv qhov sib faib ua haujlwm tsis sib xws (5v txog 3.3v) ntawm arduino TX tus pin thiab module RX tus pin. Thaum tus tswv thiab qhev tau txuas nrog, LEDs xiav thiab liab ntawm lub rooj ntsais ntsais txhua 2 vib nas this. Yog tias lawv tsis txuas nrog, tsuas yog xiav ib qho ntsais muag txhua 2 vib nas this.

Kauj ruam 3: Circuit Court

Circuit Court
Circuit Court
Circuit Court
Circuit Court

Kauj ruam 4: Code

Txhawm rau sib txuas lus nrog HC05 siv Bluetooth, koj xav tau daim ntawv thov Bluetooth davhlau ya nyob twg ntawm koj lub xov tooj. Tam sim no koj tuaj yeem pib xa cov ntaub ntawv, xa cov cai no ntawm koj Arduino thiab txuas HC05 siv lub app koj nyuam qhuav tau teeb tsa. Kev sib txuas lus lub npe yog HC05, tus password yog 1234 lossis 0000 thiab qhov hloov pauv baud tus nqi yog 9600 los ntawm lub neej ntawd.

Cia peb ua tib zoo saib cov cai thiab pom tias txhua kab ntawv txhais li cas:

#suav nrog "SoftwareSerial.h"

lub tsev qiv ntawv koj xav tau software kev sib txuas lus txuas. Koj tuaj yeem rub nws ntawm no.

SoftwareSerial MyBlue (2, 3);

Kev txhais software rau tus lej cim; RX2 & TX3

MyBlue.begin (9600);

Kev teeb tsa software serial baud tus nqi ntawm 9600

Nyeem cov ntaub ntawv xov xwm thiab Tig LEDs On/Off raws li.

Kauj Ruam 5: Xa AT-Commands rau HC05 Bluetooth Module

Xa AT-Commands rau HC05 Bluetooth Module
Xa AT-Commands rau HC05 Bluetooth Module

Los ntawm kev nias thiab tuav lub pob tus qauv hloov mus rau AT-hais kom ua hom. Txwv tsis pub, nws ua haujlwm nyob rau hauv hom kev sib txuas lus. Muaj cov qauv muaj lub laub khawm hauv lawv cov pob khoom thiab tsis tas yuav ntxiv ib qho ntxiv lawm. Ntau qhov baud tus nqi nkag rau At-command mode yog 38400. Tam sim no upload cov cai no ntawm koj lub rooj tsavxwm thiab teeb tsa txib siv Serial Monitor.

Koj yuav tau txais RESPONSE los ntawm kev xa COMMAND mus rau tus qauv. Nov yog qee qhov tseem ceeb tshaj AT cov lus txib:

Kauj Ruam 6: Yuav HC05 Bluetooth Module

Yuav HC05 Blurtooth module los ntawm ElectroPeak

Pom zoo: