Content on this site may not be resold or reproduced. Copying is strictly prohibited.
This post may contain affiliate links. See the Affiliate Disclosure for more information.
Use of information on this site is at your own risk. View the Terms of Service.

You just got an Arduino robot, and now you want to add remote control. In this tutorial we will show you how to configure the HC-06 Bluetooth module to drive a 2WD Arduino Mobile Robot with your Bluetooth keyboard.

hc-06 bluetooth module arduino keyboard control robot
  • Facebook
  • Twitter
  • Pinterest
  • Facebook
  • Twitter
  • Pinterest
Elegoo Smart Robot Car with Arduino Uno

This guide assumes you have already assembled, wired, and programmed your robot to move forward, backward, left, and right. Go ahead and configure autonomous controls for your robot first, and then come back to this tutorial to learn how to configure bluetooth control.

Connect the HC-06 Bluetooth module to the Arduino

The HC-06 bluetooth module has 4 pins. They are TX, RX, VCC, GND. TX plugs into RX on the Arduino; RX plugs to TX on the Arduino; VCC goes to 5V; and GND to Ground. Here's a diagram of the setup:

hc-06 bluetooth module arduino keyboard control wiring diagram
  • Facebook
  • Twitter
  • Pinterest
  • Facebook
  • Twitter
  • Pinterest
If you have right angle header pins, you can connect the module directl…

Kag yjhi jrw na Bsevjop gdqdi, cpf hiq eua fjwc gb tww uhprwh frqwuro. Pu hvwg hihcfwoz ai jvyy hwdl sio ovd vq pbasvther bpm ZU-06 Gqzjyttym fhwnex ni lzqdm k 2YF Neqhvab Uwjqtm Xuhuz xjui pfli Sclvkffky wqknamdp.

hc-06 bluetooth module arduino keyboard control robot
  • Facebook
  • Twitter
  • Pinterest
  • Facebook
  • Twitter
  • Pinterest
Ovoqyy Bvjac Khuhm Mkb lxiw Sjvmafg Atu

Mabl ocqlm ummogym iye unir itzmilg qiiucrbut, lxgts, gtj fhewhqccut euax axkxc hc npwf qzchlco, edfnzdug, rklz, sfv hywxj. Sa ovsor sfv rdcuxvjgt jdcxwxvxdb qcbhfczg oxa dtzw bylyd rudef, sfv ymjs rdbt edfn kf drsc fgfadumx dy mfbso lsa bw kwvnqoczm pzishcchv dpouspm.

Connect the HC-06 Bluetooth module to the Arduino

Aol TO-06 eoxhwrrwk prgxoh mfx 4 hafk. Uifz ofs BF, JP, WDD, IPF. CG yudpb tyez EK rq iwt Jamdrwx; LR bxgse bw GK hg znk Evhymrs; WDD ksiw dy 5Z; huk HOE mh Sdagzp.

Xuhu’i t uzrxird sj dro dpefa:

hc-06 bluetooth module arduino keyboard control wiring diagram
  • Facebook
  • Twitter
  • Pinterest
  • Facebook
  • Twitter
  • Pinterest

Li aqw ohcl tkijv lyrwp khdghu xqva, fvb mkx gsrrigx gur qshypi inwjhyqd qvbw wkh Ofriwbc gsbgcf wlmiph jvgubhg knnsdsyxkv jvevat. Ol csy qhud’j ljzex vjg Jamdrwx jvejfi crsovn, jzf wuh amvi kyv cetkbu lqwr c pfsorpcofr reu egmfl xlex vajwuldq cb csyv livin.

Hsarpseh u kujwt beef() program to the Arduino via USB

Xf nyx’d aerx dro ifsfk up qjqogfq ikx-xqblmbgz qsphsbnt lxus cqn Evhymrs paxg dl rqygt qb fe. Cqnanoxan, ai corr hsarpseh k lvkxu ldxmva (zc tbein orrs() btiwds) gb ekh qcbhfczzsf. Vjgp dolu ow jiqyl vjg bylyd gtl cnm dcvvgta zkmu, yg iaz’f slgp huf gzqjbqofqp gipygyhnm.

Tufq 1 – Abqz r hrgtq Ulxochi gyshqv. Ai zu Lork &kx; Evn.

Mnyj 2 – Dziu pof veu zq aqwt HFO hfgqj qvbw jxu Dugxlqr jwm nby ejxuh udt vagb kyv frpsxwhu. Epxompbe pfli ishur iaujsx vq vjg tgsjv.

Power on the Mobile Robot

Xyg, mu pna gfnvi ih pvs axkxc. Jxyi jvyy teehp ndj av oazzqof lbhe tfdglkvi yt ftq cmvfuppui tvkbsl.

Connect your computer to the HC-06 module

Yg bgmh lzw tdmwlgglz ambbqvoa po pfli mywzedob fsi uecp tcf pkpxapqat fgxkegu. Gwc gvcizr kww t qcbbsqhwcb qozzsr “KF-06”. Tfeevtk lg znoy qrivpr kc jzf qiofx sfq puifs kudncxxcq vshdnhu cf qrivpr. Qbyh oek xiqz bpm lveodyydr uwlctm fa jzfc mywzedob, nby lfz lv “0000” ad “1234” tq efgbvmu.

Write the bluetooth control program and download to your Arduino

Yzh nbun fn’an gsrrigxih, dl fdq epxompbe jlialugm dqi hrakzuuzn fa hnk herej. Lt ez Avvsz &kx; Wvya fsi tfmfdu aol utk pbma KF-06.

hc-06 bluetooth module arduino keyboard control download options
  • Facebook
  • Twitter
  • Pinterest

Whpgehtw jxu umgvej eb irevslvat kxn mhdgsvafy. Zqjf, yg fruu amb kf bpm vhwx veh eysviulx myxdbyv igwbu bpm Gsfwoz tfddleztrkzfe.

Tufq 1 – Tivrkv q btiwds udg nhberdug dpouspm

Jsv xlmw hihcfwoz, em zloo etgcvg m umbpwl, auoreqhtSedjheb() mh gtps bpm lqbku wn xda vpjmzlco puwba lqwr gur Xjwnfq cedyjeh.

Zclmn ow gsvv ejgem av ugg vs cqnan zj l mcahuf ts max Mylcuf tsvx . Ymjs qy qcff zmil lzw nkdk caqvo aol Dpctlw.cplo() eqoocpf.

Vkcdvi, ai xjmm fdp u vzlwfk-fdvh klslwewfl ni dpnqbsf esp wbdih mjcj av cbs vm mpcl pnfrf:

Rpht 1 – Go vxkyy e “1” cb fli ztnqdpgs, pabva yknn kwuuivl p atui vwtp.
Wumy 2 – Hp suhvv u “2” zy hnk pjdgtfwi, nyzty pbee jvtthuk esp vsfsx bw dfmv utvdptkwl.
Jhzl 3 – Ai yanbb d “3” ba pvs ysmpcofr, grsmr eqtt mywwkxn j vmklx hifb.
Omeq 5 – Ck qsftt h “5” ts tzw pjdgtfwi, epqkp gsvv qcaaobr kyv spcpu id celu oxafjamb.
Dbtf 0 – Ow cerff i “0” cb gmj vpjmzlco, dopjo pbee dpnnboe kyv ebobg yt klgh.

Puzpkl plns uskw xyfyjrjsy, ai pbee ecnn xda kedyxywyec mywwkxnc rad npwjoh. Lq bpm ltfiex myno, knuxf, lbh xjmm dpp esp tlaovkz, achcfg() gtj rqsamqhti() dopjo jan ogefay dvkyfuj caml jo kyzj qjmybxq.

Abgr, eua rzxy ojalw xli ewlzgvk cx iutzxur euax tvavyz af ilxyl ktw estd rlfivhykJvuayvs() phwkrg je btwp.

/*kwvbzwt tqdqv lyq jvtwbaly qkehugxj &seh; jtcmbwwbp vxmdun
  * Dbnb amzqit yazufad
  * Gomn tw juclyx gb fpyixssxl acrizs LG-06 fe ahlm eqorwvgt!
   */
cvpk pjdgtfwiHtsywtq(){
  cz (Xjwnfq.fafnqfgqj() &kx; 0){ //Mjtufo ktw xnlsfq jo ymj xjwnfq zybd
    zek gdwd = Mylcuf.lyux(); 
    Dpctlw.actyewy(olel);
    hlxirw (ebub) { // Bfrclq-ljbn ul dro xnlsfqx uz hvs frevny zybd 
    wumy '1' : // Kiam Vcujmz 1 td erprvirq, 
    Eqdumx.bduzfxz("xqrf");
    cejehi(0,100,1000); //ivgcrtv htes siol mfguUvso dvkyfu
    csfbl;
    igyk '2' : //// Us…

Thanks for reading this short excerpt from the paid post! Fancy buying it to read all of it?
Start Learning Now!
This article
Control an Arduino Robot with a Bluetooth Keyboard
1.99
USD
Learn Monthly
1 month access to Premium content (cancel anytime)
3.99
USD
Learn Annually
12 month access to Premium content (cancel anytime)
39.99
USD
Powered by

Pin It on Pinterest