【正文】
江蘇畜牧獸醫(yī)職業(yè)技術學院論文(設計) 畢業(yè)論 文( 設計 ) 基于單片機的交通燈的設計 范飚 指導老師: 任 玲 班 級: 高專機電 091 系 (部): 機電工程系 專 業(yè): 機電一體化 答辯時間: 江蘇畜牧獸醫(yī)職業(yè)技術學院論文(設計) Ⅰ 單片機交通燈設計 摘 要 近年來隨著科技的飛速發(fā)展,單片機的應用正在不斷深入,同時帶動傳統(tǒng)控制檢測技術日益更新 。在實時檢測和自動控制的單片機應用系統(tǒng)中,單片機往往作為一個核心部件來使用,僅單片機方面知識 是不夠的,還應根據(jù)具體硬件結(jié)構(gòu)軟 硬 件結(jié)合,加以完善。 十字路口車輛 穿梭 ,行人熙攘,車行車道,人行人道,有條不紊。那么靠什么來實現(xiàn)這井然秩序呢?靠的 就 是交通信號燈的自動指揮系統(tǒng)。交通信號燈控制方式很多。 本系統(tǒng)采用 MCS51 系列單片機 AT89C51 為中心器件來設計交通燈控制器,實現(xiàn)了能根據(jù)實際車流量通過 8051 芯片的 P3 口設置紅、綠燈燃亮時間的功能;紅綠燈循環(huán)點亮,倒計時剩 5秒時黃燈閃爍警示(交通燈信號通過 P1 口輸出,顯示時間通過 P0口輸出至雙位數(shù)碼管)。本系統(tǒng)設計周期短、可靠性高、實用性強、操作簡單、維護方 便、擴展功能強。 關鍵詞:單片機;交通燈 Abstract In recent years, with the rapid development of science and technology, the application of SCM is going deep, driving the traditional detection techniques to renew day by day. In the realtime examination and in the automatic control monolithic integrated circuit application system, the monolithic integrated circuit often took a core part uses. The monolithic integrated circuit aspect knowledge is only insufficient, but should also act according to the concrete hardware architecture software and hardware union, to be improved. The intersection vehicles shuttle, the pedestrian is bustling, car dealership traffic lane, person sidewalk, methodical. Then depending on what to realizes this orderly order? the traffic lights on the automatic control system. There are great number kinds of modes to control the traffic lights. The system uses a series of MCS51 as the center AT89C51 singlechip device designed to control the traffic lights, so as to realize the function of setting red, green light time by 8051 chip’ s P3 port according to the actual traffic flows, lighting the redlight and greenlight by turn and lighting the yellowlight to warm while 5 seconds left(outputting the traffic light signal by P1,outpuing the time by P0 and showing the time on doubledigits nixie tube). Short of the design cycle, high reliability, practical, simple operation, easy maintenance, the expansion of powerful is this system. Key words: SCM。 MCU。 traffic light 江蘇畜牧獸醫(yī)職業(yè)技術學院論文(設計) Ⅱ 目 錄 1 緒論 ................................................................... 1 2 交通管理方案論證 ....................................................... 1 設計任務 .......................................................... 1 方案介紹 .......................................................... 2 3 交通燈系統(tǒng)硬件設計 ..................................................... 4 單片機概述 ........................................................ 4 系統(tǒng)構(gòu)成 .......................................................... 5 芯片選擇與介紹 ..................................................... 5 AT89S51 芯片 ................................................ 5 74HC164 芯片介紹 ............................................ 7 74LS04 輸出信號與信號燈 ..................................... 8 交通燈控制線路圖 ............................................ 9 4 交通燈軟件設計 ........................................................ 10 程序設計流程圖 ................................................... 10 延時的設定 ........................................................ 12 計數(shù)器初值計算 ............................................. 12 相應程序代碼 ............................................... 12 程序的主控制循環(huán)調(diào)用 ............................................. 13 對現(xiàn)有程序的擴充 ................................................. 14 5實驗平臺 .............................................................. 14 實驗平臺 .......................................................... 14 實驗步驟 .......................................................... 15 編寫程序代碼 ................................................ 15 按照系統(tǒng)硬件連線圖連接好系統(tǒng)并調(diào)試 .......................... 15 結(jié)論 .................................................................... 16 致謝 .................................................................... 17 參考文獻 ................................................................ 17 程序?qū)崿F(xiàn)代碼 ............................................................ 19 江蘇畜牧獸醫(yī)職業(yè)技術學院論文(設計) 1 1 緒論 今天,紅綠燈安裝在各個道口上,已經(jīng)成為疏導交通車輛最常見和最有效的手段。但這一技術在 19 世紀就已出現(xiàn)了。 1858 年,在英國倫敦主要街頭安裝了以燃煤氣為光源的紅,藍兩色的機械扳手式信號燈,用以指揮馬車通行。這是世界上最早的交通信號燈。 1868 年,英國機械工程師納伊特在倫敦威斯敏斯特區(qū)的議會大廈前的廣場上,安裝了世界上最早的煤氣紅綠燈。它由紅綠兩塊以旋轉(zhuǎn)式方形玻璃提燈組成,紅色表示“停止”,綠色表示“注意”。 1869年 1月 2日,煤氣燈爆炸,使警察受傷,遂被取消。 1914 年,電氣啟動的