【正文】
電機(jī) 手機(jī) 5 4 系統(tǒng)硬件設(shè)計(jì) 手機(jī)端設(shè)計(jì) 手機(jī)選擇 由于安卓系統(tǒng)的極速發(fā)展,現(xiàn)在安卓智能機(jī)的價(jià)格已經(jīng)能降到 600 元以下,基于安卓的應(yīng)用軟件層出不窮。該方案是在小車端安裝一個(gè)小型路由器,是小車周圍一定范圍具有 WIFI 覆蓋,然后將手機(jī)連接到路由器 IP 地址,對(duì)其發(fā)送指令,路由器接收指令后對(duì)單片機(jī)串口發(fā)送數(shù)據(jù)指令,實(shí)現(xiàn)控制。 第四: 由于單片機(jī) IO 口電流為 mA 級(jí),無法直接驅(qū)動(dòng)電機(jī),必須設(shè)計(jì)專門的電機(jī)驅(qū)動(dòng)模塊。 第三: 由于 Android 系統(tǒng)所有源代碼都已公開并且可以免費(fèi)使用,各手機(jī)公司在開發(fā)自己產(chǎn)品時(shí)可以隨意改動(dòng)代碼,進(jìn)而在市場上出現(xiàn)了所謂的“基于Android 的我們采用的波特率為 4800。 設(shè)計(jì)時(shí)要考慮的問題 第一: 由于該課題的小車端是通過單片機(jī)串口通信接收收手機(jī)是控制指令,因此需要對(duì)單片機(jī)定時(shí)器初值進(jìn)行設(shè)置,若采用常用 12M 晶振,初值不一定是整數(shù),通信時(shí)便會(huì)產(chǎn)生積累誤差,進(jìn)而產(chǎn)生波特率誤差,影響通信 的同步性。 2 2 設(shè)計(jì)任務(wù)及要求 設(shè)計(jì)任務(wù)與設(shè)計(jì)要求 本課題要求利用基于 Android(安卓)手機(jī)系統(tǒng)開發(fā)一個(gè)控制軟件,該軟件將實(shí)現(xiàn)用 WIFI 技術(shù)對(duì)玩具小車進(jìn)行遙控控制,包括小車前進(jìn)、后退、轉(zhuǎn)彎等功能。這款 WIFI 智能小車機(jī)器人采用的路由器 +PC或者手機(jī)的控制方式。 你可以使用你的電腦遙控它,你也可以掏出隨身攜帶的手機(jī)控制它,甚至你可以在世界上任何一個(gè)有英特網(wǎng)的地方遠(yuǎn)程遙控它。同時(shí)現(xiàn)在安卓手機(jī)越來越普及了,如果讓小車通過手機(jī)控制,那樣將會(huì)大大的方便人們的使用。 關(guān)鍵字 : STC89C52 單片機(jī); WIFI 板; L298NN 驅(qū)動(dòng)芯片 II multifunctional car design controlled by Mobile phone WiFi Abstract: Nowadays smart phones have e into our life wide on every side. When it es to smart phones, we have to mention their leading operating system Android. Because of its practicalityand maneuverability, Android has quickly bee the mainstream operating system. Besides, the biggest advantage of Android is open source which makes it unlimited to the development of Android software and the users can use a variety of free software. That makes the development of Android software has an unprecedented market and the development of Android ushers an to the maneuverability and open source of Android system as well as its fluency and a lot of optional equipment closely connected with users, Android system has bee the leader of smart phones market. According to latest survey of the market research institutions ComScore, the advantage of Android smart phones in the United States has further expansion and the market share has reached %.The data of November 2020 showed that Android occupied 58% of Chinese smart phones operating system market. Its application field and market share are also quickly expanding towards the fields of tablet PC, consumer electronics and intelligence present, there has been much entertainment software based on Android mobile phones and WiFI technology. However, the software and patents which control the mechanical and electronic products are relatively less. Our team’s “Remote control car based on mobile phones WiFI technology” will be a new type toy car which takes phones as handheld terminal and transfers instructions through the remote control is the mobile phone, it is extremely portable. The control system based on WIFI can not only control the car, but also can be used to control puter, household appliance and even detect or rule out robot and so on. At the same time, it can be used as the hand terminal of geological testing equipment. Therefore, the results of the project will not just confined to a remote car. The mobile phone remote control system will be more valuable. Key words:STC89C52; WiFi board; L298NN III 目 錄 引言 .......................................................................................................................... 1 2 設(shè)計(jì)任務(wù)及要求 ..................................................................................................... 2 設(shè)計(jì)任務(wù)與設(shè)計(jì)要求 .......................................................................................... 2 設(shè)計(jì)時(shí)要考慮的問題 .......................................................................................... 2 3 系統(tǒng)總體設(shè)計(jì) ........................................................................................................... 3 方案論證 ............................................................................................................ 3 總體設(shè)計(jì)框圖 ..................................................................................................... 4 WIFI 控制小車系統(tǒng)設(shè)計(jì)總框圖 .................................................................................. 4 4 系統(tǒng)硬件設(shè)計(jì) ........................................................................................................... 5 手機(jī)端設(shè)計(jì) ........................................................................................................ 5 手機(jī)選 擇 .................................................................................................. 5 手機(jī)端軟件開發(fā)環(huán)境 ................................................................................ 5 軟件開發(fā)環(huán)境配置 .................................................................................... 5 生成 WIFI 小車手機(jī)客戶端 ........................................................................ 8 小型路由器選擇 .................................................................................................. 8 單片機(jī)選擇 .............................................................................................13 晶振選擇 .................................................................................................17 軟件設(shè)計(jì) .................................................................................................18 電機(jī)驅(qū)動(dòng)模塊 ....................................................................................................18 接口資源和特點(diǎn) ..............................................................................................20 電機(jī) ..................................................................................................................21 電源設(shè)計(jì) ...........................................................................................................22 小車視頻 ...........................................................................................................22 5測(cè)試與調(diào)試 ................................................................................................................25 小車通電運(yùn)行 ....................................................................................................25 測(cè)試中遇到的問題 ........................................................................