Cov txheej txheem:

Arduino Tswj Coj Nrog HC-06 Bluetooth Module: 4 Cov Kauj Ruam
Arduino Tswj Coj Nrog HC-06 Bluetooth Module: 4 Cov Kauj Ruam

Video: Arduino Tswj Coj Nrog HC-06 Bluetooth Module: 4 Cov Kauj Ruam

Video: Arduino Tswj Coj Nrog HC-06 Bluetooth Module: 4 Cov Kauj Ruam
Video: How to make a STEEL MARBLE TRACK with basic tools! step by step guide 2024, Lub Xya hli ntuj
Anonim
Image
Image
Arduino Tswj Coj Nrog HC-06 Bluetooth Module
Arduino Tswj Coj Nrog HC-06 Bluetooth Module

Nyob zoo txhua tus, qhov no yog kuv thawj qhov kev qhia ntawm Instructable.com, Kuv zoo siab heev txog kuv thawj qhov haujlwm!

Hnub no kuv yuav qhia koj Yuav ua li cas txuas Arduino thiab Bluetooth module. Arduino yuav sib tham nrog HC-06 Bluetooth Module Board siv Kev sib txuas lus txuas. (qhov kev qhia no tseem ua haujlwm tsis muaj HC-05)

Saib hauv qab no

Bluetooth module peb yuav siv niaj hnub no yog HC-06 uas paub zoo thiab pheej yig. (Kuv tau txais kuv li 2 $ los ntawm aliexpress)

Peb app tseem tab tom sim txheej txheem, yog li peb txhawb koj kom xa email mus rau: [email protected] yog tias koj muaj teeb meem txuj ci lossis koj tau ntsib qee yam teeb meem. Ua tsaug ntau rau kev nkag siab

HC-06 yog dab tsi?

HC-06 yog chav kawm 2 qhev Bluetooth module tsim los rau kev sib txuas lus tsis sib txuas xov tooj. Thaum nws tau ua khub nrog tus tswv Bluetooth zoo xws li PC, smartphones lossis ntsiav tshuaj, nws txoj haujlwm tau dhau los ua pob tshab rau tus neeg siv. Txhua cov ntaub ntawv tau txais los ntawm cov ntawv nkag mus tam sim xa mus rau saum huab cua. Thaum tus qauv tau txais cov ntaub ntawv wireless, nws raug xa tawm los ntawm cov ntawv sib txuas raws nraim qhov twg nws tau txais. Tsis muaj tus neeg siv tus lej tshwj xeeb rau Bluetooth module xav tau ntawm txhua qhov kev siv microcontroller program.

Peb tseem yuav siv Kev sib txuas lus txuas ntxiv rau txoj haujlwm niaj hnub no. Rau Arduino, nws yog lub neej ntawd RX thiab TX pins (D0, D1)

Yog xav paub ntxiv mus ntsib:

Tom qab nyeem cov lus qhia no koj yuav muaj peev xwm:

1) Txuas Arduino Board nrog txhua lub xov tooj Android los ntawm Bluetooth thiab xa/tau txais cov ntaub ntawv.

2) Tsim txoj haujlwm thiab nyeem qhov muaj txiaj ntsig los ntawm cov cuab yeej siv wireless

3) Tsim kom muaj Tsev Automation lossis tswj cov neeg hlau tsis siv neeg.

Kauj Ruam 1: Qhov Chaw thiab Cheeb Tsam

Qhov Chaw thiab Cheeb Tsam
Qhov Chaw thiab Cheeb Tsam
Qhov Chaw thiab Cheeb Tsam
Qhov Chaw thiab Cheeb Tsam
Qhov Chaw thiab Cheeb Tsam
Qhov Chaw thiab Cheeb Tsam

Peb yuav xav tau cov ntu no:

  • 1x Arduino Board (Kuv yuav siv Arduino UNO)
  • 1x Bluetooth Module HC-06 lossis HC-05
  • 1x Coj ntawm txhua yam xim (Kuv siv xiav 5mm)
  • 1 x 220Ω Resistor
  • Breadboard thiab jumpers
  • (Yeem) 9V Roj Teeb

Kauj Ruam 2: Kev Sib Txuas thiab Schematic

Kev sib txuas thiab Schematic
Kev sib txuas thiab Schematic
Kev sib txuas thiab Schematic
Kev sib txuas thiab Schematic

Cia peb tsim!

Lub Circuit Court yog qhov yooj yim heev thiab me me, yog li tsuas muaj ob peb qhov txuas uas yuav tsum tau ua.

Txhua qhov kev sib txuas tseem ceeb thiab cov txheej txheem tau qhia hauv daim duab saum toj no.

Txuas qhov tsis zoo kawg ntawm Led rau GND nrog 220Ω resistor thiab qhov kawg zoo rau Digital Pin 2.

Kauj Ruam 3: Arduino Code thiab Kev Sib Txuas Lus

Arduino Code thiab Kev Sib Txuas Lus
Arduino Code thiab Kev Sib Txuas Lus

Tshaj tawm cov duab kos hauv qab no mus rau Arduino siv USB cable.

Tsis txhob hnov qab txiav tawm HC-06 module ua ntej rub tawm daim duab!

Vim li cas?

HC-06's Pins (RX thiab TX) tab tom siv Arduino Uno tus pin rau kev sib txuas lus nrog khoos phis tawj. Pawg tshwj xeeb no tsuas muaj ib qho khoos phis tawj Serial pins thiab txuas qee yam rau nws thaum rub tawm daim duab kos yuav tsim kev tsis sib haum xeeb. Rub tawm

Kev piav qhia Code:

  • Ua ntej, peb tshaj tawm qhov const (tas li, uas tsis tuaj yeem hloov pauv tom qab) Integer rau Led, uas yog ntawm tus pin 2
  • Hauv kev teeb tsa () peb pib sib txuas lus nrog 9600 baud tus nqi thiab teeb tsa coj los ua OUTPUT
  • Hauv lub voj (), txhua zaus qhov kev zov me nyuam rov ua dua peb nyeem Serial nrog Serial.read () thiab peb khaws ua ib tus cim hauv qhov sib txawv hu ua "c"
  • Peb ntxiv ntau yam yog/lwm nqe lus los tshuaj xyuas seb "c" yog "a" lossis "b"
  • Yog tias tus char yog 'a' peb qhib lub coj, yog tias lub char yog 'b' peb tig lub coj tawm
  • Peb tau ntxiv qhov kev ncua me me rau kev nyeem ntawv

Tam sim no peb tau npaj rau theem kawg!

Kauj ruam 4: Txuas Arduino rau Android Device

Txuas Arduino rau Android Ntaus Ntawv
Txuas Arduino rau Android Ntaus Ntawv
Txuas Arduino rau Android Ntaus Ntawv
Txuas Arduino rau Android Ntaus Ntawv
Txuas Arduino rau Android Ntaus Ntawv
Txuas Arduino rau Android Ntaus Ntawv

Tam sim no rub tawm cov app hauv qab no: Ntse Bluetooth - Arduino Bluetooth Serial ⚡

LINK:

Ntse Bluetooth yog ib qho app uas tso cai rau koj siv koj lub xov tooj sib txuas lus nrog koj li Bluetooth module lossis board, nrog txoj hauv kev yooj yim tshaj plaws thiab yooj yim tshaj plaws. Nws qhib qhov rooj rau txoj hauv kev tsis txwv los tswj koj li haujlwm DIY. Ntse Bluetooth muaj ntau txoj hauv kev sib txawv yuav xa cov ntaub ntawv rau koj li cas.

Ntse Bluetooth muaj cov yam ntxwv hauv qab no:

  • Kev txuas nrawm rau koj tus qauv
  • Xa thiab tau txais cov ntaub ntawv los ntawm koj tus qauv
  • Tswj tus txais tus lej digital thiab PWM tus pin
  • Tsaus thiab Teeb ntsiab lus
  • Txawv tswj kev teeb tsa rau lub hom phiaj sib txawv
  • Niaj hnub thiab teb UI
  • Customizable nyees khawm thiab hloov
  • Siv koj li DIY RC Tsheb project nrog gamepad zoo nkauj
  • Yooj yim tswj koj cov RGB Led strips nrog cov swb
  • Txiav tawm Bluetooth thaum kaw kom txuag lub roj teeb
  • Hais kom ua kab (davhlau ya nyob twg)

Hauv qhov kev qhia no, peb tab tom siv thawj TAB nrog coj loj, tsuas yog txaus los xa ob lub cim.

Hauv cov duab hauv qab no kuv yuav qhia koj yuav siv lub app li cas. Kuv yuav qhia koj li cas txhawm rau tshawb nrhiav cov cuab yeej nyob ze, yuav ua li cas ua ke nrog tus qauv uas peb siv, thiab yuav teeb tsa cov ntaub ntawv xa los ntawm lub app li cas. Yog tias koj xav tias tsis meej pem, ncua thiab rov qab mus rau cov kauj ruam dhau los kom txog thaum koj ua haujlwm. Txawm li cas los xij, yog tias koj tseem muaj teeb meem qhia rau kuv paub [email protected], kuv yuav teb tsis pub dhau 24 teev.:)

  1. Qhib lub app, xaub los ntawm cov lus qhia, ntaus SEARCH khawm thiab tshawb rau cov cuab yeej nyob ze
  2. Thaum koj pom lub cuab yeej, xaiv nws los ntawm txhaj rau nws
  3. Xaiv cov ntsiab lus nyiam (tsaus lossis teeb) thiab tuav lub pob uas koj xaiv
  4. Tos rau qhov kev txuas, yog tias nws ua tsis tau, sim rov txuas dua
  5. Tom qab ua tiav kev sib txuas, coj mus rhaub rau ntawm tus coj loj hauv thawj lub tab (coj) thiab kos lub LED txuas nrog koj Arduino yog tias nws ntsais muag
  6. Yog tias txhua yam ua haujlwm thiab koj xav kho cov ntaub ntawv xa mus rau Arduino, qhib cov yam ntxwv ntxiv thiab txhawb nqa kuv, yuav khoom hwm, Kuv yuav zoo siab heev:)

Qhov ntawd yuav tsum yog nws.

Tsis txhob hnov qab ntsuas thiab tawm tswv yim zoo. Ua tsaug thiab pom koj ntawm kev qhia tom ntej:)

Thov txhawb nqa kuv txoj haujlwm Robotic Arm ntawm no: Nyem qhov no!

Pom zoo: