Cov txheej txheem:

Arduino: Cov Sijhawm Kawm & Cov Chaw Taws Teeb Los Ntawm Android App: 7 Kauj Ruam (nrog Duab)
Arduino: Cov Sijhawm Kawm & Cov Chaw Taws Teeb Los Ntawm Android App: 7 Kauj Ruam (nrog Duab)

Video: Arduino: Cov Sijhawm Kawm & Cov Chaw Taws Teeb Los Ntawm Android App: 7 Kauj Ruam (nrog Duab)

Video: Arduino: Cov Sijhawm Kawm & Cov Chaw Taws Teeb Los Ntawm Android App: 7 Kauj Ruam (nrog Duab)
Video: Qhia txuas xaim hluav taws xob daim: 02 2024, Hlis ntuj nqeg
Anonim
Arduino: Cov Sijhawm Kawm & Cov Chaw Taws Teeb Los Ntawm Android App
Arduino: Cov Sijhawm Kawm & Cov Chaw Taws Teeb Los Ntawm Android App

Kuv ib txwm xav tsis thoob tias yuav muaj dab tsi tshwm sim nrog txhua tus Arduino cov laug cam uas tib neeg tsis xav tau tom qab lawv ua tiav lawv cov phiaj xwm txias. Qhov tseeb yog chim siab me ntsis: tsis muaj dab tsi. Kuv tau pom qhov no ntawm kuv tsev neeg lub tsev, qhov uas kuv txiv tau sim tsim nws tus kheej kev daws teeb meem hauv tsev tab sis txij li nws yog tus kws kho hluav taws xob nws tsis tuaj yeem hla qhov kev ua haujlwm. Hauv txoj haujlwm no kuv tau sim daws cov teeb meem nws ntsib:

  • Programming yog ib qho nyuaj.
  • Nws siv sijhawm los tsim cov software muaj txiaj ntsig.
  • Tsev tsim cov apps zoo li tho txawv thiab tsis siv tus phooj ywg.

Nws siv ob peb hlis los ua kom raug, tab sis txoj haujlwm tsim nyog nws. Kuv npaj siab yuav daws kuv txiv qhov teeb meem los ntawm kev muab Android app uas txuas nrog bluetooth thiab txhawb lub sijhawm cov haujlwm, cov xwm txheej & kev tswj phau ntawv tawm ntawm lub thawv yam tsis muaj kev paub txog kev ua haujlwm. Cia peb pib!

Khoom siv

Kho vajtse:

  • 1 x Arduino Uno
  • 1x HC-05 bluetooth module
  • 1x DS1302 RTC module
  • 1 x Breadboard
  • 3x Resistor 1k ohm (tuaj yeem yog 220 ohm lossis 10k ohm)
  • 1x USB 2.0 cable hom A/B.
  • 12 x Jumper xov hlau
  • Smartphone nrog Android 5.0+ (bluetooth muaj)
  • Laptop/PC

Software:

  • Arduino IDE Cov
  • Maya App los ntawm Play Store

Kauj ruam 1: Upload Bluetooth Module Configuration

Upload Bluetooth Module Configuration
Upload Bluetooth Module Configuration
Upload Bluetooth Module Configuration
Upload Bluetooth Module Configuration

Ua ntej tshaj, koj yuav tsum teeb tsa koj lub bluetooth adapter los ntawm koj lub laptop/PC. Txuas Arduino board rau USB chaw nres nkoj ntawm koj lub computer. Tua tawm Arduino IDE, qhib daim duab tshiab, theej & paste cov cai hauv qab no.

Txoj Cai:

void teeb tsa () {

Serial.begin (38400); ncua (500); Serial.println ("AT+NAME = Arduino_Maya"); ncua (500); Serial.println ("AT+BAUD = 115200, 0, 0"); ncua (500); Serial.println ("AT+POLAR = 1,0"); ncua (500); } void voj () {}

Nco ntsoov tias cov kev xaiv no raug xaiv hauv koj li IDE:

  1. Cov cuab yeej → Pawg → Arduino Uno
  2. Cov Cuab Yeej → Port → chaw nres nkoj uas koj txuas nrog Arduino

Ua ke thiab rub tawm qhov program

Kauj ruam 2: Txuas Bluetooth Module

Txuas Bluetooth Module
Txuas Bluetooth Module
Txuas Bluetooth Module
Txuas Bluetooth Module
Txuas Bluetooth Module
Txuas Bluetooth Module
Txuas Bluetooth Module
Txuas Bluetooth Module

Txuas koj HC-05 raws li tau hais qhia hauv cov phiaj xwm. Cov lus qhia dav dav:

  • VCC txuas rau Arduino 5V tus pin.
  • GND txuas rau Arduino GND tus pin.
  • TXD txuas rau Arduino RXD tus pin.
  • RXD txuas mus rau Arduino TXD tus pin los ntawm kev faib hluav taws xob raws li qhov ntsuas qhov ntsuas hluav taws xob ntawm cov ntaub ntawv yog 3.3V. Arduino TXD (xa tus pin) yog 5V, yog li ntawd yog tias koj yuav tsis siv qhov faib hluav taws xob, koj yuav hlawv koj cov qauv.

Kauj Ruam 3: Teeb HC-05 Module

Teeb HC-05 Module
Teeb HC-05 Module

Hauv cov kauj ruam no peb yuav siv kev teeb tsa los ntawm theem 2 mus rau bluetooth module. Ua raws li cov lus qhia no:

  1. Disconnect USB cable ntawm koj lub computer.
  2. Nias thiab tuav lub khawm KEY ntawm koj tus qauv HC-05 rau 5 vib nas this thaum txuas USB cable.
  3. Nyem RESET khawm ntawm koj lub Arduino board.
  4. Tos 10 vib nas this ua ntej teeb tsa siv.
  5. Txuas lub USB cable thiab txuas nws dua.

Kauj Ruam 4: Txuas DS1302 RTC Module

Txuas DS1302 RTC Module
Txuas DS1302 RTC Module
Txuas DS1302 RTC Module
Txuas DS1302 RTC Module
Txuas DS1302 RTC Module
Txuas DS1302 RTC Module

Txuas koj DS1302 raws li tau hais qhia hauv cov phiaj xwm. Cov lus qhia dav dav:

  • VCC txuas rau Arduino 5V tus pin.
  • GND txuas rau Arduino GND tus pin.
  • CLK txuas rau Arduino tus pin 8.
  • DAT txuas rau Arduino tus pin 7.
  • RST txuas rau Arduino tus pin 6.

Kauj ruam 5: Upload Arduino Program

Rub tawm Arduino Program
Rub tawm Arduino Program
Rub tawm Arduino Program
Rub tawm Arduino Program

Yog! Tag nrho cov kho vajtse tau teeb tsa tam sim no. Cia wb mus nrog software. Ua ntej, rub lub firmware rau koj lub rooj tsavxwm muaj nyob hauv qhov txuas no:

Arduino Uno firmware.hex

Tom ntej no, tshem tawm HC-05 bluetooth module. Qhov no tseem ceeb heev vim tias cov cai tshiab tsis tuaj yeem rub tawm thaum tus qauv txuas nrog.

Siv AVRDUDE

AVRDUDE yog lub cuab yeej siv los rub cov firmware rau AVR microprocessors, thiab nws tau suav nrog hauv Arduino IDE yog li koj twb muaj nws lawm. Feem ntau nws nyob qhov twg hauv Program Files. Thaum koj pom nws, taw rau daim nplaub tshev no:/hardware/tools/avr/bin/.

Linux / Mac OS

Yog tias koj teeb tsa Arduino IDE los ntawm cov ntaub ntawv raug cai, koj yuav tsum muaj avrdude ntxiv rau koj txoj hauv kev ua haujlwm.

Windows, Linux & Mac OS

Txheeb xyuas avrdude kev teeb tsa nrog cov lus txib no. Yog tias kev pab tau nthuav tawm ces koj tuaj yeem txuas ntxiv mus. Yog tias koj ntsib teeb meem tsis txhob ua siab deb nug Google txog nws.

avrdude -pab

Upload firmware rau koj Arduino Uno board. Nco tseg: lub firmware tau tsim tshwj xeeb rau Arduino Uno thiab nws yuav tsis ua haujlwm rau lwm pawg Arduino.

avrdude -v -patmega328p -carduino -b115200 -P -D -Uflash: w:: i

Thaum lub firmware tau rub tawm, txuas rov qab HC-05 bluetooth module.

Kauj Ruam 6: Nruab Maya App Ntawm Play Store

Tam sim no koj lub rooj tsavxwm tau npaj siv. Rub tawm Maya App los ntawm Play Store rau Android 5.0 lossis tshiab dua nrog muaj bluetooth adapter.

Maya - cov sijhawm rau Arduino

Nrog Maya koj tuaj yeem hloov kho koj lub tsev kom ntse tsis tas yuav nqis peev nyiaj ntau hauv cov npe kim. Koj tuaj yeem rov siv cov khoom siv hluav taws xob uas koj twb muaj lawm.

Cov Sijhawm Ua Haujlwm - teeb tsa koj cov kev niaj hnub niaj hnub hauv cov sijhawm uas tuaj yeem kho tau. Piv txwv li koj tuaj yeem yuam kom koj lub rooj tsavxwm qhib thiab tua lub teeb ib ntus kom ntshai cov tub sab.

Scenes - ua tau tshwm sim thiab qhib kev ua uas xaus rau tom qab ncua sijhawm uas koj teeb tsa.

Kev Tswj Los Ntawm Tes - ua haujlwm raws li kev hloov pauv. Qhib lossis deactivate tus pin raws li koj xav tau. Rau PWM pins tus lej feem pua tus nqi raug txhawb.

Kauj Ruam 7: Txuas rau Koj Lub Rooj Tsav Xwm Los Ntawm Maya

Txuas rau Koj Pawg Thawj Coj Los ntawm Maya
Txuas rau Koj Pawg Thawj Coj Los ntawm Maya
Txuas rau Koj Pawg Thawj Coj Los ntawm Maya
Txuas rau Koj Pawg Thawj Coj Los ntawm Maya
Txuas rau Koj Pawg Thawj Coj Los ntawm Maya
Txuas rau Koj Pawg Thawj Coj Los ntawm Maya

Zoo, tam sim no zoo heev. Qhib lub app thiab txuas rau lub rooj tsavxwm.

  1. Ntawm qhov screen txais tos xaiv Kuv twb teeb tsa lub rooj tsavxwm. Wb txuas rau nws.
  2. Pab kom bluetooth thiab luam theej duab rau cov khoom siv muaj. Thaum koj lub rooj tsav xwm tau pom (Arduino_Maya) thov nyem rau nws.
  3. Bluetooth pairing pib. Android OS yuav nug koj tus pin txhawm rau txuas rau lub rooj tsavxwm. Rau HC-05 nws yog 1234 los ntawm lub neej ntawd.
  4. Yog tias vim li cas los xij koj yuav raug txiav tawm, thov qhia qhov teeb meem siv qhov txuas no.
  5. Koj tau txuas nrog. Nrog koj zoo siab!: D

Pab tau txuas

Chaw Pabcuam: https://apps.maroon-bells.com/maya/help_center.htmlFacebook Page: hauv Play Store: https://play.google.com /apps/testing/com.maroonbells.maja

Pom zoo: