Remote control car base on MCS 51

1.Circuit Design

Before you start, determine the components to use.

Try to select the components that control the trolley.
As the title:
Main control chip:AT89C52 chip
A toy car(which have two motor.The front motor controls the left and right, and the rear motor controls the front and rear)
A chip or module that controls a motor:L298/L9110
Wireless module:NRF24L01(If you like, you can use ESP8266 networking control or HC05 Bluetooth control)
Drop-Out Voltage-Regulator module:5V to 3.3V(The voltage used in NRF24L01 is 3.3V)

The next step is to draw circuit diagram

You can use your hand or some software to draw, this step is to know what you want.

  1. The minimum systemis the core of the hardware circuit design.Because of this you should design the minimum system first.
  2. And then design the switch and power .With the power and switch single chip microcomputer can work.
  3. In China you can not only buy components by using TaoBao, but also use it to see some reference details of the components. For example, the control motor chip on this article, you can see the reference details below Taobao
    such as:How does L298 work and so on.In this step you can figure out how the components work
  4. Next is toconnect the chips and modles with the single chip microcomputer.
  5. Tips: Remember to reserve the port to upload the code.Otherwise, it's a headache if you don't keep the port to upload you have to remove the chip to upload it everytime. You can use a IDC connector(such as 10pin X9555WV-2X05-6TV01) and a USB TO RS232/485/TTLto upload your code.

After completing the above steps, you can start drawing PCB

Draw PCB according to your own circuit diagram.(I use DXP to draw PCB)

Of course, DXP provides a tool that can draw circuit schematic diagrams.You can use it directly to draw the schematic diagram and the schematic library.

After painting, remember to** check **whether the connection is connected, etc

Proofing

Send the design drawings to the factory, and the factory will help you proofing.
After welding,then you can debug.

2.Code debug

Complete the above design

You can simulation in protues before you upload the code in the chip.
This method can simulate the running state of hardware under real conditions.

The first thing to do is to let the car move.

  1. When the trolley moves, first prove that the trolley motor is OK, and then there can be a later control activity.
  2. If the car can't move, check the problem **maybe the motor problem****maybe the L298 problem or some problems with the circuit board **be good at using multimeter at this time.
  3. The motor test is very simple. Connect it with a battery to see if it will move.(It is better to connect a resistor in series. In case of excessive current, the motor may burn during the detection process闭树。)
  4. Other part use a multimeter to check whether there is electricity or not 庭敦。

The next step is to debug the control code

NRF24L01 is used to control in the design, so** pay attention to the voltage**
The voltage of 51 single chip microcomputer is 5V, and this module is 3.3V
If the module burns out, it is impossible to control it。
Assuming that the computer controls, the ** computer is the information sending end and the single chip microcomputer is the information receiving end**

Single control first(such as go forward, P2.0 port is 0, P2.1 port is 1, and the single chip microcomputer receives the signal "1")
In the computer, use the serial port debugging assistant to send the signal of 1


Example diagram of serial port debugging assistant
Key code examples of single chip microcomputer
    if( rece_buf[1]=='1')           //After the first bit is the received command data, rece_buf[0] is the length of data bits.
   
                {
                  M0=0;                        //sbit M0 = P2^0   sbit M1 = P2^1
                  M1=1;
                }

Proceed to the next step after successful debugging

Reverse, stop, left turn and right turn control are completed in the same way.Then complete the project.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
禁止轉(zhuǎn)載,如需轉(zhuǎn)載請通過簡信或評論聯(lián)系作者病瞳。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市悲酷,隨后出現(xiàn)的幾起案子套菜,更是在濱河造成了極大的恐慌,老刑警劉巖设易,帶你破解...
    沈念sama閱讀 206,311評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件逗柴,死亡現(xiàn)場離奇詭異,居然都是意外死亡顿肺,警方通過查閱死者的電腦和手機戏溺,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,339評論 2 382
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來屠尊,“玉大人旷祸,你說我怎么就攤上這事∷侠ィ” “怎么了托享?”我有些...
    開封第一講書人閱讀 152,671評論 0 342
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經(jīng)常有香客問我闰围,道長赃绊,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,252評論 1 279
  • 正文 為了忘掉前任羡榴,我火速辦了婚禮碧查,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘校仑。我一直安慰自己么夫,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 64,253評論 5 371
  • 文/花漫 我一把揭開白布肤视。 她就那樣靜靜地躺著档痪,像睡著了一般。 火紅的嫁衣襯著肌膚如雪邢滑。 梳的紋絲不亂的頭發(fā)上腐螟,一...
    開封第一講書人閱讀 49,031評論 1 285
  • 那天,我揣著相機與錄音困后,去河邊找鬼乐纸。 笑死,一個胖子當(dāng)著我的面吹牛摇予,可吹牛的內(nèi)容都是我干的汽绢。 我是一名探鬼主播,決...
    沈念sama閱讀 38,340評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼侧戴,長吁一口氣:“原來是場噩夢啊……” “哼宁昭!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起酗宋,我...
    開封第一講書人閱讀 36,973評論 0 259
  • 序言:老撾萬榮一對情侶失蹤积仗,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后蜕猫,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體寂曹,經(jīng)...
    沈念sama閱讀 43,466評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 35,937評論 2 323
  • 正文 我和宋清朗相戀三年回右,在試婚紗的時候發(fā)現(xiàn)自己被綠了隆圆。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,039評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡翔烁,死狀恐怖渺氧,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情租漂,我是刑警寧澤阶女,帶...
    沈念sama閱讀 33,701評論 4 323
  • 正文 年R本政府宣布颊糜,位于F島的核電站哩治,受9級特大地震影響秃踩,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜业筏,卻給世界環(huán)境...
    茶點故事閱讀 39,254評論 3 307
  • 文/蒙蒙 一憔杨、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧蒜胖,春花似錦消别、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,259評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至朋沮,卻和暖如春蛇券,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背樊拓。 一陣腳步聲響...
    開封第一講書人閱讀 31,485評論 1 262
  • 我被黑心中介騙來泰國打工纠亚, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人筋夏。 一個月前我還...
    沈念sama閱讀 45,497評論 2 354
  • 正文 我出身青樓蒂胞,卻偏偏與公主長得像,于是被迫代替她去往敵國和親条篷。 傳聞我的和親對象是個殘疾皇子骗随,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 42,786評論 2 345

推薦閱讀更多精彩內(nèi)容