Cov txheej txheem:

Ua Haujlwm Koj Arduino Nrog Android Ntaus Hauv Bluetooth: 6 Cov Kauj Ruam (nrog Duab)
Ua Haujlwm Koj Arduino Nrog Android Ntaus Hauv Bluetooth: 6 Cov Kauj Ruam (nrog Duab)

Video: Ua Haujlwm Koj Arduino Nrog Android Ntaus Hauv Bluetooth: 6 Cov Kauj Ruam (nrog Duab)

Video: Ua Haujlwm Koj Arduino Nrog Android Ntaus Hauv Bluetooth: 6 Cov Kauj Ruam (nrog Duab)
Video: Making a &#!$%ing Button 2024, Kaum ib hlis
Anonim
Ua Haujlwm Rau Koj Arduino Nrog Android Ntaus Hauv Bluetooth
Ua Haujlwm Rau Koj Arduino Nrog Android Ntaus Hauv Bluetooth

Nyob zoo ntiaj teb, hauv Cov Lus Qhia Kuv xav qhia koj, yuav ua li cas rau phiaj xwm koj Arduino Uno nrog koj lub cuab yeej Android dhau Bluetooth. Nws yog qhov yooj yim heev thiab pheej yig heev. Tsis tas li nws tso cai rau peb ua haujlwm peb Arduino qhov twg peb xav tau tshaj wireless bluetooth … Yog li cia pib!:)

Kauj Ruam 1: Cov Khoom thiab Cov Cuab Yeej

Cov Ntaub Ntawv thiab Cov Cuab Yeej
Cov Ntaub Ntawv thiab Cov Cuab Yeej

Kho vajtse:

  • Arduino Ib
  • Bluetooth HC-05 module
  • Mini khob cij
  • Capacitor 1uf/50v (elco) Cov.
  • Reasisor 100 ohm
  • 5 pcs x Jumper xov hlau
  • USB cable
  • Android ntaus nrog Android 4.0.0+ (Bluetooth muaj)
  • Laptop/PC

Software:

Bluino Loader los ntawm Google Play Store

Kauj Ruam 2: Program Koj Arduino Siv Laptop/PC

Program Koj Arduino Siv Laptop/PC
Program Koj Arduino Siv Laptop/PC
Program Koj Arduino Siv Laptop/PC
Program Koj Arduino Siv Laptop/PC

Pib los ntawm kev luam cov cai los ntawm kab ntawv hauv qab no. Sau. Upload.

Txoj cai no muaj ntau txoj haujlwm los hloov qhov ntsuas ntawm Bluetooth HC-05:

  • AT+NAME = Bluino#00: Hloov lub npe ntawm bluetooth module, lub npe tsis yog "HC-05".
  • AT+UART = 115200, 0, 0: Hloov baud tus nqi rau 115200 (Arduino Uno, Bluino thiab Mega2560)
  • AT+UART = 57600, 0, 0: Hloov tus nqi baud rau 57600 (Arduino Nano, Leonardo, Micro, Pro Mini 3V3/5V thiab Duemilanove)
  • AT+POLAR = 1, 0: Hloov lub xeev tus lej tus lej
  • Yog xav paub ntxiv koj tuaj yeem hloov tus password kom siv tsis tau tus password thaum ua khub, AT+PSWD = xxxx.

Lub npe bluetooth yuav tsum "Bluino#00-9999", yog tias koj xav tau lub npe tshwj xeeb koj yuav tsum siv qhov them nyiaj ntawm Bluino Loader App.

void teeb tsa () {

Serial.begin (38400); ncua (500); Serial.println ("AT+NAME = Bluino#00"); ncua (500); Serial.println ("AT+UART = 115200, 0, 0"); // Siv qhov baudrate no yog siv rau Arduino Uno, Bluino thiab Mega2560 //Serial.println("AT+UART=57600, 0, 0 "); // Siv qhov baudrate no yog siv rau Arduino Nano, Leonardo, Micro, Pro Mini 3V3/5V thiab Duemilanove ncua (500); Serial.println ("AT+POLAR = 1, 0") ncua (500); } void voj () {}

Kauj Ruam 3: Hook Up Like Schematic

Hook Up Zoo li Schematic
Hook Up Zoo li Schematic
Hook Up Zoo li Schematic
Hook Up Zoo li Schematic
Hook Up Zoo li Schematic
Hook Up Zoo li Schematic
Hook Up Zoo li Schematic
Hook Up Zoo li Schematic

Ua raws li cov duab saum toj no, kev teeb tsa yog qhov yooj yim.

Yog tias koj xav tau koj tuaj yeem hloov daim ntawv qhia zaub mov nrog PCB tsab ntawv pov thawj nrog qee qhov haujlwm ua haujlwm, yog li koj tau txais me me lossis zoo li daim thaiv rau Arduino.

Kauj Ruam 4: Sijhawm Teeb Bluetooth HC-05

Sijhawm Teeb Bluetooth HC-05
Sijhawm Teeb Bluetooth HC-05
Sijhawm Teeb Bluetooth HC-05
Sijhawm Teeb Bluetooth HC-05

Yeej hauv cov kauj ruam no yuav teeb tsa HC-05 dhau ntawm qhov hais kom ua, nrog ua raws cov kauj ruam no koj yuav teeb tsa HC-05 rau qee qhov tsis tau. TX (D0/D1), uas yog thaum koj txuas rau HC-05 tus pin RX/TX yog yuav yuam teeb tsa HC-05 ntawm Qhov hais kom ua hom. Tsuas yog ua raws cov kauj ruam zoo li ntawm cov duab. • Nias thiab tuav KEY khawm • Txuas USB cable rau lub zog Arduino • Tos li 5 vib nas this (tseem tuav lub khawm KEY) • Tshem tawm thiab rov ntsaws USB rau rov pib dua los ntawm AT hom hais kom ua

Kauj Ruam 5: Nruab Daim Ntawv Thov Bluino Loader Los Ntawm Googleplay Store

Nruab Daim Ntawv Thov Bluino Loader Los Ntawm Googleplay Store
Nruab Daim Ntawv Thov Bluino Loader Los Ntawm Googleplay Store

Okay, thawj daim ntawv thov kuv xav qhia koj yog "Bluino Loader", rau Andorid 4.0 lossis siab dua nrog muaj bluetooth txuas. Koj tuaj yeem tau txais los ntawm googleplay khw:

Bluino Loader - Arduino IDE lossis Pro version los txhawb nqa tus tsim tawm Bluino Loader Pro - Arduino IDE

Cov app no yog ua haujlwm nrog Arduino Uno, koj tuaj yeem sau, kho thiab xa cov duab kos rau Arduino uno hla bluetooth HC-05. Lub app yooj yim to taub zoo li Arduino IDE, muaj ntau qhov piv txwv kos duab, kuj koj tuaj yeem ntxiv qee lub tsev qiv ntawv tsuas yog luam cov ntawv tais ceev tseg rau hauv BluinoLoader/qiv. Koj tuaj yeem hloov cov ntsiab lus ntawm tus kws kho xim, qhov loj ntawm cov ntawv thiab ntau yam. Yog tias koj xav tau Serial Monitor feature, tshem tawm Ad thiab tuaj yeem luam theej tawm lub npe ntawm bluetooth (Tsis tsuas yog Bluino#…) koj tuaj yeem yuav cov khoom lag luam hauv app yuav khoom, yog li kuj txhawb nqa tus tsim tawm.

Kev xa cov duab kos ua haujlwm tau zoo heev dhau Bluetooth! Yog li kuv yuav muab qhov app 4.0 tawm ntawm 5 lub hnub qub:)

Kauj Ruam 6: Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Device Dhau Bluetooth

Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Ntaus Hauv Bluetooth
Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Ntaus Hauv Bluetooth
Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Ntaus Hauv Bluetooth
Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Ntaus Hauv Bluetooth
Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Ntaus Hauv Bluetooth
Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Ntaus Hauv Bluetooth
Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Ntaus Hauv Bluetooth
Sim Upload Cov Qauv Sketch Blink.ino Rau Hauv Arduino Siv Android Ntaus Hauv Bluetooth
  • Tom qab ua tiav kev teeb tsa koj tuaj yeem qhib piv txwv kos duab BluinoLoader/piv txwv/02. Basic/Blink/Blink.ino
  • Tos kom txog thaum muab cov cuab yeej ua tiav
  • Coj mus rhaub rau "upload" khawm (Xub nyob rau hauv lub voj voog icon)
  • Tom qab ua tiav kev suav sau tsis muaj qhov yuam kev, coj mus rhaub khawm "Scan Bluino Hardware" txhawm rau tshawb nrhiav bluetooth
  • Xaiv bluetooth kho vajtse nrog lub npe "Bluino#00"
  • Yog thawj qhov txuas ua ke nkag ua ke tus qauv txheej txheem "1234", tom qab ntawv OK
  • Tos kom txog thaum txheej txheem rub tawm tiav

Tom qab tag nrho cov kauj ruam OK koj Arduino yuav ntsais ntawm coj 13, thiab koj tuaj yeem rov ua txhua kauj ruam txhawm rau rub lwm daim duab.

Pom zoo: