毕业设计开题报告(出租车计价器).(精选5篇)

时间:2019-05-15 03:46:59下载本文作者:会员上传
简介:写写帮文库小编为你整理了多篇相关的《毕业设计开题报告(出租车计价器).》,但愿对你工作学习有帮助,当然你在写写帮文库还可以找到更多《毕业设计开题报告(出租车计价器).》。

第一篇:毕业设计开题报告(出租车计价器).

毕业设计开题报告 题 目 新型出租车计价器控制电路设计 姓 名 牛敏 学 号 120433322 专 业 班 级 电气 123 指 导 老 师 黄俊梅

电子工程系电气自动化教研室 2014年 12月 2 日 一.选题背景和意义

随着我国经济的迅速发展, 人民生活水平的显著提高, 我国出租汽车行业迅 猛发展,出租汽车已经成为我国城 市公共交通的重要组成部分和现代化城市必 备的基础设施, 成为人们工作、生活中不可缺少的交通工具。出租汽车服务行业 和出租汽车计价器紧密相关, 因为出租汽车必须安装出租汽车计价器才能投入营 运。出租汽车计价器是一种能根据乘客乘坐汽车行驶距离和等候时间的多少进行 计价, 并直接显示车费值的计量器具。计价器是出租汽车的经营者和乘坐出租汽 车的消费者之间用于公平贸易结算的工具, 因而计价器计价准确与否, 直接关系 到经营者和消费者的经济利益。依据国家有关法律、法规, 出租汽车计价器是列 入国家首批强制检定的工作计量器具之一, 也是近年来国家质量技术监督部门强 化管理的六类重点计量器具之一。

二、国内外研究现状、发展动态

出租车行业在我国是八十年代初兴起的一项新兴行业,随着我国国民经济 的高速发展, 出租汽车已成为城市公共交通的重要组成部分。多年来国内普遍使 用的计价器只具备单一的计量功能。目前全世界的计价器中有 90%为台湾所生 产。现今我国生产计价器的企业有上百家,主要是集中在北京,上海,沈阳和广 州等地。当单片机出现并应用于计价器后, 现代出租车计价器的模型也就基本具 备了,它可以完成计程,计价,显示等基本工作。单片机以及外围芯片的不断发 展促进了计价器的发展。出租车计价器在最初使用时具备的主要功能是根据行驶 里程计价,要求精度高,可靠性好。

三、研究的内容及可行性分析 1.研究的内容 : 计价器显示的营运金额是营运里程与价格的函数(等候时间一般折算成一 定比例的里程来计算。出租车计价器通过传感器与行驶车辆连接。出租汽车的 实际里程通过传感器的脉冲信号在计价器里折算成一定的计价营运里程。针对这 一点我们来利用单片机作为控制核心,设计一款出租车计价器,具有计价显示、等待时间计价,公里数显示,时间显示等相关功能。

2设计要求 :(1 4位数码管用于实时显示行车里程数(0.0,单位为公里;4位数码管用 于实时显示金额数(000.0,单位为元。

(2规定白天出租车单程价格为 1.5元 /公里 , 往返则价格为 1.0元每公里。夜间出租车单程价格为 1.8元 /公里 , 往返则价格为 1.2元每公里。设置单程往返 按键。

(3 起步公里数为 3公里, 价格为 10元, 若实际运行大于 3公里, 按 “基 本要求 2”计算价格。

2.设计任务 :

1.单片机控制电路原理与设计

2.键盘电路原理与设计---按钮来实现乘车方式、状态操作、查询、清除、参数 调整等操作。

3.车速检测与里程计算电路原理与设计---霍尔传感器输出的里程信号经过光耦 隔离后送到计量 CPU 的外部中断 1, 计量 CPU 通过中断计数并和 K 值进行相关运 算得出行驶里程和车速。

4.数码管显示电路原理与设计;5.蜂鸣提示原理与设计---利用普通蜂鸣器来进行语音提示;为了避免司机由于 工作紧张而无法确定是否按下各个按钮,我们增加了蜂鸣提示功能。6.软件编程, protues 仿真模拟 四总体设计方案

实验箱有六个数码管,故起步价、大的费用以及单价均由 P4、P5(即最左 边两个数码管显示,里程由 P2、P3(即中间两个数码管显示,脉冲计数由 P0、P1(即最右边两个数码管显示。由于缺少霍尔传感器,因此只能通过输入 脉冲模拟。因此电路由时钟脉冲电路(8MHZ 接 P1.0、复位电路、数码管显示电 路构成。

2-1 出租车计价器总体设计图

2-2 单片机单元框图 五计价器设计思想 5.1具体设计思想

利用 80C51单片机控制出租车计价系统工作。

单片机 P1.0口作为脉冲输入。8255的 PB 口连接一个 74LS245芯片(双向 总线驱动器 ,再与外部六个数码管连接, PB 口连接一个 74LS245芯片与 6个数 码管的公共 COM 端连接, 用于选择数据输出的地址, 这样就可以实现起始价、单 价、里程、脉冲计数的动态显示,并且节省了端口数。数码管的段控制信号是由 8255的 PB 口经 74LS245缓冲器后输出得到, 6位位控制信号由 8255的 PA 口经 74LS245缓冲器后输出得到。键盘电路由 8255构成,其中 8255的 PC0-PC3作为 矩阵式键盘行扫描线, 8255的 PA 口为矩阵键盘列入线。

5.2计价器相应控制

通过软件编程实现计价器起始价、单价、脉冲技术的显示以及按下相应键实 现开始暂停、设置单价、复位功能,各个键按下的功能如表 2-2所示。

在白天,不用调节价格,当里程超过 3公里即按照每公里 1.5元计算, 3公 里以内则均按起始价 10元计费。操作如下:白天只要顾客上车,就按下 0键, 到达目的地按下 E 键,然后读数码管上的 L6、L5(最左边两位数码管即为费 用,中间两位即为里程。顾客付费完后按下 F 键复位,恢复起始价格,等待下一 个顾客的到来。

在晚上, 由于夜间行车风显以及司机加班状态, 3公里内还是按照起始价 10元计费;超过 3公里则按照每公里 1.2元计价。操作如下:按下 2键显示单程 1.8元 /公里,按下 3键确定往返是 1.2元 /公里并恢复起始价 10元,待顾客上 车按 0键开始计价,到达目的地按下 E 键,然后读数码管上的 L6、L5(最左边

两位数码管即为费用,中间两位即为里程。顾客付费完后按下 F 键复位,恢复 起始价格,等待下一个顾客的到来。

5.3出租车计价显示电路

出租车计价器显示电路主要由代码实现。显示电路如下图所示。

图 3-7 出租车计价器显示电路

六、工作进度

1.查阅资料,撰写开题报告 第 1周~第 2周 2.英文资料翻译 第 3周~第 4周

3.查阅相关资料,设计总体方案 第 5周~第 6周

4.熟悉单片机控制系统,设计系统硬件电路 第 7周~第 10周 5.熟悉 proteus 或 protel 电路设计软件,画出电路图 第 11周~第 13周 6.编写并调试程序,模拟实现部分控制功能 第 14周~第 15周 7.毕业设计审查、毕业答辩 第 16周~第 17周

七、参考文献

[1].冯先成, 常翠芝.单片机应用系统设计 [M].北京:北京航空航天大学出版社, 2009.[2].元增民.模拟电子技术 [M].北京:中国电力出版社, 2009.[3].南建辉等.MCS-51单片机原理及应用实例 [M].北京:清华大学出版社, 2004.3.[4] 王幸之等.单片机应用系统抗干扰技术 [M].北京:北京航空航天大学出版 社,2000.[5] 童诗白,等.仿真电子技术基础[M].北京:高等教育出版社,2001.[6] 张毅刚.单片机原理及应用.北京:高等教育出版社,2004.[7] 李秉操.单片机接口技术及在工业控制中的应用[M].陕西:陕西电子出版 社,1992.[8] 丁元杰.单片微机原理及应用(第二版.北京:机械工业出版社,2002 [9] 蔡惟铮.集成电子技术.哈尔滨:哈尔滨工业大学出版社,2003.[10]冯博情,吴宁.微型计算机原理与接口技术.北京:清华大学出版社,2010.题目 新型出租车计价器控制电路 进 度 安 排(1)2014 年 10 月——2014 年 11 月:进一步收集和阅读与论文相关的 资料。(2)2014 年 10 月——2014 年 11 月:根据阅读的资料,构思毕业设计 框架。(3)2014 年 11 月——20114 年 12 月:初步设计出 kappa 值软测量数 学模型。(4)2014 年 11 月——20114 年 12 月:根据老师的安排安排思路。(5)2014 年 11 月——20114 年 12 月:实验、分析实验结果,改进数学 模型。(6)2014 年 11 月——20114 年 12 月:确定论文最终方案及完成论文 的撰写。(7)2014 年 12 月:准备答辩。指导老师意见: 签字: 年 月 日

第二篇:出租车计价器毕业设计外文资料

ABSTRACT In this paper, a multi-channel taximeter that is able to deal with more than one passenger simultaneously is proposed.In order to demonstrate the theory of operation of the proposed system, a complete design for an experimental three-channel taximeter(whose prototype has been built under grant from the Egyptian Academy for Scientific and Technological Research)is presented.System location, outline, block diagrams as well as detailed circuit diagrams for the experimental taximeter are also included.1.INTRODUCTION Transporting people in the morning from their homes to their works and back in the afternoon has become a big problem in big cities especially in undeveloped countries.As a partial solution of this problem, the authorities in some countries had, unofficially, left the taxicab drivers to carry different passengers to different places at the Same time.For example, a taxicab with four seats may carry four different passengers without any relation between them except that their way of travelling is the same.Accordingly, it has become very difficult to rely on the present conventional single-channel taximeter to determine the fare required from each passenger separately.Accordingly, an unfair financial relation was created between the taxicab driver, owner, passengers and the state taxation department.Under these circumstances, taxicab drivers force the passengers to pay more than what they should pay.In some cases passengers had to pay double fare they should pay.With the present conventional single-channel taximeter, taxicab owners are not able to determine the daily income of their taxicab.In some cases(a taxicab with four seats)they may only get one quarter of the income of the taxicab(collected by the taxicab driver).From which they should pay the salary of the taxicab driver as well as the cost of fuel, minor and major repairs in addition to the car depreciation.As a matter of fact the position of the taxicab owners is not so bad as it seems.A general agreement has been reached between the taxicab drivers and owners such that the drivers should guarantee a fixed daily income to the owners as well as the paying for the cost of fuel as well as the minor repaires.Even though the taxicab drivers still share the large portion ofthe income of the taxicab.Also with the presence of the single-channel taximeter, it has become very difficult for the state taxation department to know the yearly income of the taxicab and accordingly it has become very difficult to estimate the taxes to be paid by the taxicab owners.In order to face this problem, the state taxation department had to impose a fixed estimated taxes for each seat of the taxicab whatever the income of the taxicab.In this paper, we introduced a multichannel taximeter that can deal with more than one passenger simultaneously.I t should be pointed out that by the term passenger we mean a one person or a group of related persons.I t should also be pointed out that our proposed multi-channel taximeter is not, simply, a multi display readouts.As a matter of fact it contains logic circuits that automatically changes the fare per killometer of travelling distance or per minutes of 'waiting time according to the number of passengers hiring the taxicab.In the following part and as an example, we will present a complete design for a three-channel taximeter.Block diagrams as well as detailed circuit diagrams of the experimental three-channel taximeter are also included.A prototype has been built under grant from the Egyptian Academy for Scientific and Technological Research.2.AN EXPERIMENTAL THREECHANNEL TAXIMETER Theory of operation of our experimental device to work as an electronic digital taximeter is based on t h e fact thathe speedometer cable rotates one revolution for each meter of travelling distance.Accordingly, if the speedometer cable is coupled with a speed sensor that generates a single pulse for each meter of travelling distance, then our taximeter could be three up counter modules associated with a speed sensor unit.However, our experimental taximeter is not simply a three display readouts.As a matter offact it contains logic circuits that automatically changes the fare per kilometer of travelling distance or per minutes of waiting time according to the number of passengers hiring the taxicab.The device may be splitted into two main parts: The first is the speed sensor unit which may be located anywhere in the taxicab such that an easy coupling to the speedometer cable can be achieved.The second unit contains the main electronic circuit, the displayand control panel.The unit should be located somewhere in front of both the driver and the passengers.A possible components locations is shown in Figure 1.A.Speed Sensor Unit The main function of this unit is to supply train of pulses whose frequency is proportional to the angular rotation of the wheels.A possible form of a speed sensor is shown in Figure 2.If may consist of a tj.pica1 permanent magnet sine wave generator with its output connected to a pulse shapping circuit(two general purpose silicon diodes, 1K ohms resistor and a schmit trigger inverter).In order to find some way to detect the movement of the taxicab, the output of the sine wave generator is rectified through a general purpose silicon diode Dl then smoothed by a 1000 F capacitor.The output voltage at terminal Q is then limited to the value of 4.7 volts by using a Ik ohms resistor as well as a zener diode ZD.The level of the voltage at terminal Q would be high whenever the taxicab is moving and will be zero otherwise.This voltage can be used for the automatic switching from distance fare to time fare.B.Main Electronic and Display Unit A suggested shape for the main electronic and display unit is shown in Figure 3.The control and display panel contains all ' controls necessary for operating the taximeter as well as four readout displays.The first channel will give the sum of money required from the first passenger, while the second and third readouts are for the second and third passengers, respectively.The fourth readout will give the total income of the taxicab.The contents of the last readout should be nonvolatile and be able to be retained even during parking the taxicab.The channel rotary selector switchs 1 , 2 and 3 have fully clockwise/anticlockwise positions.In the fully anticlockwise position, the counter of the corresponding readout is blancked and disabled.In the fully clockwise position, the counter is unblanked, cleared to zero and enabled to be ready for counting the sum of money required from the first, second and third passengers, respectively.Pushing the total sum pushbutton 4 unblanks the fourth readout enabling any person to retain the readout corresponding to the total income.After the release of the pushbutton, the fourth readout will be blanked again.This unit also contains the main electronic circuit which will be fully described in the following section.3.DESCRIBTION OF THE MAIN ELECTRONIC CIRCUIT The general block diagram of the main electronic circuit is shown in Figure 4.It consists of five subcircuits designated by the symboles CTI up to CT4supporting circuits, these are: The number of passenger deticition circuit CTI, travelling distance scaling circuit CT2, waiting time scaling circuit CT3, circuit CT4 which generates clock pulses for the display circuit.A.Number of Passengers Detection Circuit CT1 As shown from the general block diagram, the circuit CTI has three inputs I, 2 and 3 as well as three outputs J, K and L.The function of the circuit is to supply a high level voltage at terminals J, K or L if and only if one, two or three passengers are hiring the taxicab, respectively.The term passenger, here, means one person or a group of related persons.When a passenger is getting into the cab, we simply turn on a free readout display by turning the corresponding rotary selector switch to a fully clockwise direction.This will automatically disconnect the corresponding terminal I, 2 or 3 from ground.The logical relation between various input terminals I, 2 and 3 and the output terminals J, K and L is shown in Table 1.As a combinational circuit we start the design by deriving a set of boolean functions.A possible simplified boolean functions that gives minimum number of inputs to gates may be obtained from Table I.A possible logical diagram that is based on the above derived expressions is shown in Figure 5.It consists of two inverters, four 2-input AND, to3-input AND two 3-input OR gates B.Tavelling Distance Scaling Circuit CT2 As shown from the block diagram of Figure 4, the circuit CT2 has four input J, K, L and E and one output M.The function of the circuit is to supply a single pulse at the output M for a certain number of pulses generated at the output of the speed sensor(certain number of meters travelled by the taxicab), according to the number of passengers hiring the car.A suggested fare per kilometer of travelling distance is shown in colomn two of Table 2.the circuit, in this case, should supply a single pulse at the output M for every 100, 125 or 143 pulses generated at the input terminal E according to the level of voltage at input terminale 3, K or L, respectively.Our circuit could be, as shown in Figure 5, three decade counters, connected as a three digit frequency divider whose dividing ratios 100, 125 and 143 are automatically selected by the voltage level at terminals J, K and L, respectively.A possible circuit diagram that may verify the above function is shown in Figure 6.It consists of three decade counters type 7490, one BCD-to decimal decoder type 7445, three 4-input AND, one 3-input ANDone 2-input AND two 3-input OR gates.C.Time Scaling Circuit CT3 As shown in the block diagram, the time scalingcircuit will have four inputs J, K, L and F and one output N.The function of this circuit and accordingto colomn three of Table 2(fare per 2 minuts of waiting time)is to supply a single pulse at the output N for every 120, 240 or 360 pulses supplied at the input terminal F from the I Hz clock according to level of voltage at inputs J, K and L, respectively.Time scaling circuit would be similar to the distance scaling circuit but with different diving ratios.A Possible circuit diagram is shown in figure 7.It consists, in this case, of three decade counter type 7490, two 3-input AND, one 5-input AND, one 2-input AND one 3-input OR gates.D.Circuit CT4 Which Generates Clock Pulses for Display Circuit The function of this circuit is to supply one, two or three pulses at the output terminal R for each pulse generated at any of the terminals N or M, according to the voltage level at the input terminals J, K or L, respectively.The output P will receive a pulse for each pulse generated at any of the input terminals N or M.This function can be performed by the circuit shown in Figure 8, it consists of one ripple counter type 7493, one half of a dual JK masterslave flip-flops circuit type 7476, three inverters, three 2-input AND, one 3-input AND, one 2-input OR and one 3-input OR gates.When a pulse is generated at either input terminals N or M, a high level voltage will be generated at the output Q of the flip-flop.This will g a t e t h e I Khz signal to be connected to the input A of the ripple counter as well as to the output terminal R.When one, two or three pulses are counted by the ripple counter, according to the level of voltage at the input terminals J, K and L, respectively, a high is generated to reset the counter and change the state of the flip-flopsuch that Q becomes low.Hence, the 1 KHz signal is disabled to reach the outputerminal R or the input A of the ripple counter.In order to ensure the proper function of the circuit, the flip-flop should be cleared whenever a new channel is operated.This has been achieved by the input 5 and will be explained later when describing the function of the channels rotary selector switchs.E.Display Circuit As shown in Figure 2, the display panel would contain three 4-digit displays that give the sum of money required from each passenger separately as well as a one six-digit display that gives the total income of the taxicab.A possible wiring diagram for the display circuit is shown in Figure 9.Rotating any of the rotary selector switches to fully clockwise direction will supply the corresponding display by5 volts through terminals 1, 2 and 3, respectively.The corresponding display will be unblanked by supplying a low level of voltage through terminals A, C and G, respectively.Keeping terminals 8, D and H, respectively, at low level will keep them reset to zero.The corresponding display is then enabled by removing the low voltage from terminals B, D, and H, respectively, to be ready for counting the sum of money required from the corresponding passenger starting from zero.The counting pulses for these three displays are supplied through terminal P.The total sum display will be enabled whenever any of the three displays is enabled(this is done by a 3-input OR gate as shown in Figure 8).Retaining the contents of the last display will be done by unblanking it by supplying a low level of voltage to terminal I as shown in Figure 10 b.F.Changing Over Between Time and Distance Fares In the following part, two different methods for changing over between time andistance fares are suggested: The first is to switch to time fare whenever the distance fare is less than the time fare.Hence, a simple look to fares table(Table 2)can show that time fare should be used whenever the taxicab moves with speed less than 50 m/min.A possible circuit that can perform this switching action is shown in Figure IO c.It contains one rpm limit switch and a one inverter as well as two 2-input AND gates.The contacts of the limit switch are normally closed and will be opened whenever the angular speed of the speedometer cablexceeds 50 rmp.The second alternation is to connect the input of the inverter in Figure 10 c.to the output terminal Q of the speedometer circuit, Figure 2.In this case, the switching into time fare will be done whenever the taxicab is at stand still.G.Function of the Rotary Selector Switches The voltage levels that should be supplied by the terminals of the rotary selector switches in order to ensure proper operation by the electronic circuit are given in Table 3.Connection of three rotary selector switches each witb four decks of five poles each, that satisfy the logic function of Table 3, is shown in Figure 10 a.Rotating any of the three switches into fully clockwise direction will pass through five positions.The function of the rotary selector switches can be described starting from the first position passing through variousteps until reaching the final position as follows: Initial position: In this position a low voltage level is applied to terminals I, 2 and 3, this will disconnect the 5 volts supply from the three first displays, set the three inputs of the number of passenger detection circuit CTI to low level.A low voltage level is applied to terminals 8, D and H, this is to ensure that the total income display is disabled.Voltage levels at terminals A, C, G and S are at no care condition.Step I: Rotating any of the rotary selector switches one step toward clockwise direction will supply 5 volts to the corresponding display, provides a high level voltage at terminals 1, 2 or 3 indicating that one passenger have entered the taxicab.A high level voltage should be applied to terminals A, C or G in order to ensure that the corresponding display is still blanked.Other terminals B, D, H and S are kept unchanged.Step 2: Rotating the rotary selector switch one step further, will change the state of voltages at terminal A, C or G to be at low level and unblanks the corresponding display.States of voltages at terminals I, 2, 3 and S are remained unchanged.Terminals B, D and H should be remained at low level to ensure that the corresponding readout is cleared to zero while unblanking the display.

第三篇:出租车计价器毕业设计中英文翻译

ABSTRACT 1.INTRODUCTION Transporting people in the morning from their homes to their works and back in the afternoon has become a big problem in big cities especially in undeveloped countries.As a partial solution of this problem, the authorities in some countries had, unofficially, left the taxicab drivers to carry different passengers to different places at the Same time.For example, a taxicab with four seats may carry four different passengers without any relation between them except that their way of travelling is the same.Accordingly, it has become very difficult to rely on the present conventional single-channel taximeter to determine the fare required from each passenger separately.Accordingly, an unfair financial relation was created between the taxicab driver, owner, passengers and the state taxation department.Under these circumstances, taxicab drivers force the passengers to pay more than what they should pay.In some cases passengers had to pay double fare they should pay.With the present conventional single-channel taximeter, taxicab owners are not able to determine the daily income of their taxicab.In some cases(a taxicab with four seats)they may only get one quarter of the income of the taxicab(collected by the taxicab driver).From which they should pay the salary of the taxicab driver as well as the cost of fuel, minor and major repairs in addition to the car depreciation.As a matter of fact the position of the taxicab owners is not so bad as it seems.A general agreement has been reached between the taxicab drivers and owners such that the drivers should guarantee a fixed daily income to the owners as well as the paying for the cost of fuel as well as the minor repaires.Even though the taxicab drivers still share the large portion ofthe income of the taxicab.Also with the presence of the single-channel taximeter, it has become very difficult for the state taxation department to know the yearly income of the taxicab and accordingly it has become very difficult to estimate the taxes to be paid by the taxicab owners.In order to face this problem, the state taxation department had to impose a fixed estimated taxes for each seat of the taxicab whatever the income of the taxicab.In this paper, we introduced a multichannel taximeter that can deal with more than one passenger simultaneously.I t should be pointed out that by the term passenger we mean a one person or a group of related persons.I t should also be pointed out that our proposed multi-channel taximeter is not, simply, a multi display readouts.As a matter of fact it contains logic circuits that automatically changes the fare per killometer of travelling distance or per minutes of 'waiting time according to the number of passengers hiring the taxicab.In the following part and as an example, we will present a complete design for a three-channel taximeter.Block diagrams as well as detailed circuit diagrams of the experimental three-channel taximeter are also included.A prototype has been built under grant from the Egyptian Academy for Scientific and Technological Research.2.AN EXPERIMENTAL THREECHANNEL TAXIMETER Theory of operation of our experimental device to work as an electronic digital taximeter is based on t h e fact thathe speedometer cable rotates one revolution for each meter of travelling distance.Accordingly, if the speedometer cable is coupled with a speed sensor that generates a single pulse for each meter of travelling distance, then our taximeter could be three up counter modules associated with a speed sensor unit.However, our experimental taximeter is not simply a three display readouts.As a matter offact it contains logic circuits that automatically changes the fare per kilometer of travelling distance or per minutes of waiting time according to the number of passengers hiring the taxicab.The device may be splitted into two main parts: The first is the speed sensor unit which may be located anywhere in the taxicab such that an easy coupling to the speedometer cable can be achieved.The second unit contains the main electronic circuit, the displayand control panel.The unit should be located somewhere in front of both the driver and the passengers.A possible components locations is shown in Figure 1.A.Speed Sensor Unit The main function of this unit is to supply train of pulses whose frequency is proportional to the angular rotation of the wheels.A possible form of a speed sensor is shown in Figure 2.If may consist of a tj.pica1 permanent magnet sine wave generator with its output connected to a pulse shapping circuit(two general purpose silicon diodes, 1K ohms resistor and a schmit trigger inverter).In order to find some way to detect the movement of the taxicab, the output of the sine wave generator is rectified through a general purpose silicon diode Dl then smoothed by a 1000 F capacitor.The output voltage at terminal Q is then limited to the value of 4.7 volts by using a Ik ohms resistor as well as a zener diode ZD.The level of the voltage at terminal Q would be high whenever the taxicab is moving and will be zero otherwise.This voltage can be used for the automatic switching from distance fare to time fare.B.Main Electronic and Display Unit A suggested shape for the main electronic and display unit is shown in Figure 3.The control and display panel contains all ' controls necessary for operating the taximeter as well as four readout displays.The first channel will give the sum of money required from the first passenger, while the second and third readouts are for the second and third passengers, respectively.The fourth readout will give the total income of the taxicab.The contents of the last readout should be nonvolatile and be able to be retained even during parking the taxicab.The channel rotary selector switchs 1 , 2 and 3 have fully clockwise/anticlockwise positions.In the fully anticlockwise position, the counter of the corresponding readout is blancked and disabled.In the fully clockwise position, the counter is unblanked, cleared to zero and enabled to be ready for counting the sum of money required from the first, second and third passengers, respectively.Pushing the total sum pushbutton 4 unblanks the fourth readout enabling any person to retain the readout corresponding to the total income.After the release of the pushbutton, the fourth readout will be blanked again.This unit also contains the main electronic circuit which will be fully described in the following section.3.DESCRIBTION OF THE MAIN ELECTRONIC CIRCUIT The general block diagram of the main electronic circuit is shown in Figure 4.It consists of five subcircuits designated by the symboles CTI up to CT4supporting circuits, these are: The number of passenger deticition circuit CTI, travelling distance scaling circuit CT2, waiting time scaling circuit CT3, circuit CT4 which generates clock pulses for the display circuit.A.Number of Passengers Detection Circuit CT1 As shown from the general block diagram, the circuit CTI has three inputs I, 2 and 3 as well as three outputs J, K and L.The function of the circuit is to supply a high level voltage at terminals J, K or L if and only if one, two or three passengers are hiring the taxicab, respectively.The term passenger, here, means one person or a group of related persons.When a passenger is getting into the cab, we simply turn on a free readout display by turning the corresponding rotary selector switch to a fully clockwise direction.This will automatically disconnect the corresponding terminal I, 2 or 3 from ground.The logical relation between various input terminals I, 2 and 3 and the output terminals J, K and L is shown in Table 1.As a combinational circuit we start the design by deriving a set of boolean functions.A possible simplified boolean functions that gives minimum number of inputs to gates may be obtained from Table I.A possible logical diagram that is based on the above derived expressions is shown in Figure 5.It consists of two inverters, four 2-input AND, to3-input AND two 3-input OR gates B.Tavelling Distance Scaling Circuit CT2 As shown from the block diagram of Figure 4, the circuit CT2 has four input J, K, L and E and one output M.The function of the circuit is to supply a single pulse at the output M for a certain number of pulses generated at the output of the speed sensor(certain number of meters travelled by the taxicab), according to the number of passengers hiring the car.A suggested fare per kilometer of travelling distance is shown in colomn two of Table 2.the circuit, in this case, should supply a single pulse at the output M for every 100, 125 or 143 pulses generated at the input terminal E according to the level of voltage at input terminale 3, K or L, respectively.Our circuit could be, as shown in Figure 5, three decade counters, connected as a three digit frequency divider whose dividing ratios 100, 125 and 143 are automatically selected by the voltage level at terminals J, K and L, respectively.A possible circuit diagram that may verify the above function is shown in Figure 6.It consists of three decade counters type 7490, one BCD-to decimal decoder type 7445, three 4-input AND, one 3-input ANDone 2-input AND two 3-input OR gates.C.Time Scaling Circuit CT3 As shown in the block diagram, the time scalingcircuit will have four inputs J, K, L and F and one output N.The function of this circuit and accordingto colomn three of Table 2(fare per 2 minuts of waiting time)is to supply a single pulse at the output N for every 120, 240 or 360 pulses supplied at the input terminal F from the I Hz clock according to level of voltage at inputs J, K and L, respectively.Time scaling circuit would be similar to the distance scaling circuit but with different diving ratios.A Possible circuit diagram is shown in figure 7.It consists, in this case, of three decade counter type 7490, two 3-input AND, one 5-input AND, one 2-input AND one 3-input OR gates.D.Circuit CT4 Which Generates Clock Pulses for Display Circuit The function of this circuit is to supply one, two or three pulses at the output terminal R for each pulse generated at any of the terminals N or M, according to the voltage level at the input terminals J, K or L, respectively.The output P will receive a pulse for each pulse generated at any of the input terminals N or M.This function can be performed by the circuit shown in Figure 8, it consists of one ripple counter type 7493, one half of a dual JK masterslave flip-flops circuit type 7476, three inverters, three 2-input AND, one 3-input AND, one 2-input OR and one 3-input OR gates.When a pulse is generated at either input terminals N or M, a high level voltage will be generated at the output Q of the flip-flop.This will g a t e t h e I Khz signal to be connected to the input A of the ripple counter as well as to the output terminal R.When one, two or three pulses are counted by the ripple counter, according to the level of voltage at the input terminals J, K and L, respectively, a high is generated to reset the counter and change the state of the flip-flopsuch that Q becomes low.Hence, the 1 KHz signal is disabled to reach the outputerminal R or the input A of the ripple counter.In order to ensure the proper function of the circuit, the flip-flop should be cleared whenever a new channel is operated.This has been achieved by the input 5 and will be explained later when describing the function of the channels rotary selector switchs.E.Display Circuit As shown in Figure 2, the display panel would contain three 4-digit displays that give the sum of money required from each passenger separately as well as a one six-digit display that gives the total income of the taxicab.A possible wiring diagram for the display circuit is shown in Figure 9.Rotating any of the rotary selector switches to fully clockwise direction will supply the corresponding display by5 volts through terminals 1, 2 and 3, respectively.The corresponding display will be unblanked by supplying a low level of voltage through terminals A, C and G, respectively.Keeping terminals 8, D and H, respectively, at low level will keep them reset to zero.The corresponding display is then enabled by removing the low voltage from terminals B, D, and H, respectively, to be ready for counting the sum of money required from the corresponding passenger starting from zero.The counting pulses for these three displays are supplied through terminal P.The total sum display will be enabled whenever any of the three displays is enabled(this is done by a 3-input OR gate as shown in Figure 8).Retaining the contents of the last display will be done by unblanking it by supplying a low level of voltage to terminal I as shown in Figure 10 b.F.Changing Over Between Time and Distance Fares In the following part, two different methods for changing over between time andistance fares are suggested: The first is to switch to time fare whenever the distance fare is less than the time fare.Hence, a simple look to fares table can show that time fare should be used whenever the taxicab moves with speed less than 50 m/min.A possible circuit that can perform this switching action is shown in Figure IO c.It contains one rpm limit switch and a one inverter as well as two 2-input AND gates.The contacts of the limit switch are normally closed and will be opened whenever the angular speed of the speedometer cablexceeds 50 rmp.The second alternation is to connect the input of the inverter in Figure 10 c.to the output terminal Q of the speedometer circuit, Figure 2.In this case, the switching into time fare will be done whenever the taxicab is at stand still.G.Function of the Rotary Selector Switches The voltage levels that should be supplied by the terminals of the rotary selector switches in order to ensure proper operation by the electronic circuit are given in Table 3.Connection of three rotary selector switches each witb four decks of five poles each, that satisfy the logic function of Table 3, is shown in Figure 10 a.Rotating any of the three switches into fully clockwise direction will pass through five positions.The function of the rotary selector switches can be described starting from the first position passing through variousteps until reaching the final position as follows: Initial position: In this position a low voltage level is applied to terminals I, 2 and 3, this will disconnect the 5 volts supply from the three first displays, set the three inputs of the number of passenger detection circuit CTI to low level.A low voltage level is applied to terminals 8, D and H, this is to ensure that the total income display is disabled.Voltage levels at terminals A, C, G and S are at no care condition.Step I: Rotating any of the rotary selector switches one step toward clockwise direction will supply 5 volts to the corresponding display, provides a high level voltage at terminals 1, 2 or 3 indicating that one passenger have entered the taxicab.A high level voltage should be applied to terminals A, C or G in order to ensure that the corresponding display is still blanked.Other terminals B, D, H and S are kept unchanged.Step 2: Rotating the rotary selector switch one step further, will change the state of voltages at terminal A, C or G to be at low level and unblanks the corresponding display.States of voltages at terminals I, 2, 3 and S are remained unchanged.Terminals B, D and H should be remained at low level to ensure that the corresponding readout is cleared to zero while unblanking the display.二、中文翻译.导言

在不发达的国家,早上把人们从他们家送到工作的地方,然后下午送回来已成为一个大问题,尤其是在大城市。

作为解决这个问题的一个部分,在某些国家出租车用来解决这个问题,送人们从一个地方到另外一个地方。例如,出租车的四个席位可携带四个不同的没有任何关系的乘客,除了他们的路线是相同的。

因此,依靠目前的传统的单车道计价以确定所需的票价,把每个乘客的计费分开,这已成为一个非常困难的问题。因此,在出租车司机,车主,乘客和国家税务部门之间存在着不公平的财政关系。

在这种情况下,出租车司机强迫乘客支付多于他们所应付的。在某些情况下乘客支付了他们应付车费的双倍。

本常规单频道计程车,出租车司机不能够确定出租车日常收入。在某些情况下(出租车的4个席位),他们可能只有出租车四分之一的收入(大部分的出租车司机)。从这些支付工资的出租车司机以及作为燃料费用外,还要维修以及汽车折旧等费用。事实上,出租车业主并非似乎如此糟糕。一项在出租车司机和车主之间的协议已经达成,司机应保证每天固定收入,以及向业主支付燃料以及维修的费用。即使如此,还是有的出租车司机的很大一部分份额之收入的出租车。现在还存在的单声道计价,已经变得非常,国家税务部门也知道这种困难 每年估计出租车业主的收入支出,以及应支付的税务也很困难。

为了应对这一问题,国家税务部已实行固定估计税,每个座位的出租车不论收入。在本文中,我们介绍了多通道的士计程表,可处理超过一名乘客同时进行的情况。我应该指出,我所说的长期旅客指一个人或一组相关的人。我同时也应指出,我们提出的多渠道的计价,不是简单地说,一个多显示读数。作为一个先进的事项,事实上它包含逻辑电路,可以自动计算变化的车费以及每公里行走距离或每分钟的候车时间按照乘客人数雇用出租车。在下面的部分,我举出一个例子,我们将介绍一个完整的三通道计价。框图以及详细的电路图,实验三通道计价功能也包括在内。原型下已建成 埃及赠款科学学院 和技术研究。2.实验

出租车计价器理论的运作我们的实验装置从事电子数字计价依据。事实上速度电缆旋转1 圈的每米距离行驶。因此,如果车速电缆耦合与速度传感器,产生一个单脉冲每平方米的旅行距离,那么,我们的的士可以三倍于反模块相与速度传感器的单位。然而,我们的实验是计价而不仅仅是只显示三个读数。事实上,它包含逻辑电路,可以根据每公里的行驶距离或每分钟等候时间按照乘客人数雇用出租车来自动改变车费。该装置可能会分成两个主要部分组成:第一是速度传感器,这个传感器可位于任何地方,在出租车内进行这样一个简单的耦合车速电缆是可以实现的。

单位包含了主要的电子电路,显示器以及控制面板。该单位应位于前排的司机和乘客之间。

A. 速度传感器

其主要职能是本单位提供脉冲的培训,这个脉冲的频率会于旋转角度相适合。一种可能的形式一个速度传感器。如果可以包含正弦波发生器的输出连接到脉冲整形电路的永磁器件(2通用芯片二极管,1000欧姆的电阻和施密特触发逆变器)。

为了找到某种方式来检测出租车的运动,正弦波发生器的输出是纠正通过一个通用的硅二极管延胡索乙然后平滑的1000年F电容。那个输出电压在终端Q是当时限于价值4.7伏特用益欧姆的电阻以及一个齐纳二极管ZD。出租车的终端电压在终端Q将高电压降为零。这电压可作为改变出租车从距离计费到时间计费方式的开关电压。

主要的电子和显示单元

一个建议是主要形式的电子和显示单元。控制和显示器面板包含所有'控制所必需的经营的士以及四个可读显示器。第一频道将给出从第一乘客,第二乘客,第三乘客分别应付的费用,第四个会给出总收入给予出租车。最后读出的数据会包括停车的费用等等费用。频道选择器开关1,第2和第3个,按顺时针/逆时针的立场。在充分逆时针的立场,反相应的读出是未标明和残疾人。以顺时针方向则是未定义的,清除为零,对于第一第二第三的乘客分别计费。第四号推进总钮第四次读出,使任何人保留读出相应的总收入。经过释放按钮,第四次读出将再次保留。这个单位还包含主要电子电路将在下一节充分描述。

描述的主要电子电路

电路一般框图主要电子电路。它由五个部分指定的电脑符号与电话系统整合成为4个支撑电路,它们是:判断乘客数量电路CT1,旅行距离电路CT2,等待时间电路CT3,时钟脉冲显示电路CT4。

乘客人数检测电路CT1,该电路电脑与电话系统整合有三个输出:1,2和3相对应于三个输出J,K和L。

这个循环电路函数包含高电压的终端 J,K或L,如果有1个或者2,3个乘客分别租用出租车。这个组里的任意乘客都是一组相关的人。当一个乘客进入出租车后,我们只是表示这样一种情况,自由读出显示在谈到相应的旋转选择开关,以一个完全顺时针方向。这将自动断开相应的终端1,2或3个从地面。逻辑关系各种输入端子之间第1,第2和第3个输出端J,K和L是列于表1。作为一个组合电路,我们开始设计产生了一系列布尔函数。

一种可能的逻辑图的基础上,上述源性表达。它包括两个变频器,4个2输入和3输入以及2个3输入或门。B.行驶距离标量环路CT2 如图所示的方框图图4,电路CT2有4个输入J,K,L及E和1个输出M,输出功能的电路是供应单脉冲的输出M的某一些脉冲产生的输出的速度传感器(出租车行驶了一定得距离),根据乘客的人数租用的汽车。我们建议票价按每公里行驶距离显示在两个表格2里面。

这个环路,在这种情况下,应提供单脉冲的输出M的每100,125或143脉冲所产生的输入端根据级别的电压输入终端3,K或L。

我们的电路显示,三个十年的计数器,作为一个三位数分频器的分比率100,125和143个自动选定的电压一级终端J,K和L分别。一种可能的线路图可被验证,上述功能如图6。它包括三个十年的计数器7490,一个声BCD-以杜威解码器输入7445,3个4输入和1个3输入以及1个2输入和2个3输入或门。

时间缩放电路CT3.时间缩放电路含有4个输入端 J,K,L及F和一个输出端N,这个电路的函数根据表格2的意思(车费每2分钟的等待时间)是在J,K和L分别供应单脉冲到输出端N时,提供单脉冲的输出N。时间缩放电路将类似于距离标量环路,但是有不同的行驶比率。它包括3个十进制计数器7490,2个3输入与门和一个5输入与门,1个2输入与门和一个3输入或门。

电路产生时钟脉冲的显示电路CT4 这条电路的作用根据电压电平在输入终端J、K或者L,分别供应1,2或者脉冲在每脉冲的输出终端R引起在任何终端N或M。无论输入端N或者M中的谁发送脉冲,都只有一个脉冲能被输出端P接收。它由一个反向计数器7493构成,其中一半是双JK主从触发器电路,型号为7476,包括三个变频器,三个2输入与门,一个3输入与门,1 2输入或门以及一个3输入或门。当脉冲引起在输入的终端N或M,触发器的输入Q上将产生高级电压。这个门信号将被连接到计数器的输入A并且连接到输出终端R。当第一,第二或第三个脉冲由涟波计数器开始计数,J,K,L端会分别根据电压的大小来使产生重置或者翻转来改变状态,然后Q端变为输出低电压。因此,1 KHz信号没有能力到达输出端R或是计数器的输入端A。为了确保电路的函数准确无误,当切换到新频道时,触发器要清零。对于功能选择开关旋转渠道的描述,稍后会以一个成功的5输入门函数来解释。

显示电路

该显示面板将包含三个4位数显示器,这样可以给出每个乘客应付车费的总和,一个六位数显示器可以给出出租车的总收入。一种可能的接线图的显示电路。以顺时针方向旋转所选择的开关将提供相应的显示,这可以通过5伏电压来分别控制1,第2和3终端。对应的显示通过供应低级电压通过终端A、C和G,分别。保持终端D和H在低级状态下重置为零对应的显示分别通过终端B,D,H而改变低压状态,并准备好从对应的乘客那里计算出相应的计数款额,计数脉冲这三个显示器通过终端提供总额。计数器还将通过终端P为3个显示器提供脉冲只要这三个显示器中任意一个是正常的,那么总额将被显示出来。

时间和距离变化时车费的改变

在下面的部分,两种不同的方法使得时间和距离改变从而导致车费发生变化,有如下建议:首先是当以路程计价的费用低于以时间计费的费用时,采用时间计费。从此,一个简单的票价表显示当出租车移动速度小于50米/分时应该采用时间计费方式。一种可能的电路可以执行此开关行动,它包含一个转速限位开关和一个反转器以及两个2输入与门。接触的限位开关通常是封闭,只有当角速度超过50RMP的时候才会打开。第二个改变将中断连接到图10C的输入端,输出端Q连接速度的电路。在这种情况下,只要出租车的状态保持静止,那么计费开关就会处于关闭状态。

功能选择旋转开关

功能选择开关旋转的电压应提供的该终端的旋转选择开关,以确保正常运行的电子电路列于表3。每5个杆就有4个板连接着3个旋转选择开关,每个符合逻辑功能表3,旋转任何三个切换到完全顺时针方向将通过5个职位。功能的旋转选择开关可以说是从第一的位置通过直到达到最后的立场如下:

初始位置:在这个位置上的低电压电平适用于第一第二和第三终端,浙江断开来自三个中一个显示器的5伏特电压供应,设置三个显示器,乘客检测电路并与电路系统整合到较低的水平。终端D,H采用低电压,这是为了确保显示的总收入选项已被禁用。

步骤1:以顺时针方向旋转任何旋转选择开关一格将提供5伏特电压到相应的显示,提供一个高等级的电压终端1,2或3,这表明一名乘客已经进入了出租车。终端C,G应为高电平,以确保相应的显示仍然是笼罩。其他端口,如D,H端口保持不变。

步骤2:旋转旋转选择开关1,然后将在终端A,C或G上改变电压使其处于低电压状态,并会产生相应的显示。终端1,2,3以及S上的电压状态保持不变。终端B,D和H应保持在较低水平,以确保当显示为无数据时相应的读出清除为零。

第四篇:出租车计价器调试报告

出租车计价器调试报告

本设计可分为单片机主控模块、键盘、显示器、温度检测、状态指示、时钟日历、语音收录播报、分频器电路、脉冲信号发生器等9部分。仔细分析系统的工作原理,分别按照模块在系统中的作用,对各个模块分别单独调试,最后形成该系统的用户程序,实现功能要求。

一、接通电源

调试要求:1.首先仔细检查该系统板的电源和地是否有短路问题,在未接入电源轻快下,使用万用表检验电源和地检查是否短路,如果没有短路,再仔细核查电源极性后予以通电,观察电源指示灯D1是否点亮。如果电源指示的灯不亮应立即关闭电源,并用手触摸各个芯片,检查是否用某芯片发热。如果没有发热的器件,很可能是电源指示二极管极性安装错误,或者是该发光二极管的串联电阻阻值偏大。

2.黑板上调试要求:(1)焊接好电路板加电前,用万用表测量板上Vcc 和

GND之间的电阻,应大于1KΩ

(2)加电后测量电路板上各电压,应大于4.2V 调试结果:1.经万用表检验,电路板无短路问题。

2.通电后,D1指示灯点亮。

3.测量Vcc 与 地之间的电阻,1.14KΩ > 1KΩ

4.测量Vcc与 地之间的电压:4.28V > 4.20V

二、测试状态指示

本系统中状态指示二极管共有3个,它们分别是D1、D2、D3。D1是指示电源的,可以在电源接通时直接看到,D2用于指示语音芯片的工作状态,留作语音模块调试时观察。D3是可以由单片机的引脚控制的。

编写测试D3的程序: #include #include

sbit a_c=P1^0;extern serial_initial();

main(){ serial_initial();a_c=0;while(1);}

测试结果: 1.2.三、脉冲信号发生器测试

测试要求:该模块由5G555芯片构成一个多谐振荡器,使用示波器观察该芯片的第3引脚的波形,并调节电位器W1,观察输出波形及频率变化。

测试结果:

调整W1前,f=147.1Hz

调整W1后,f=130.5Hz

四、分频电路测试

测试要求:该模块由一个4位二进制计数器74HC161和一个多路选择器74HC153构成。调试时可以利用由5G555芯片构成一个多谐振荡器的输出,或信号发生器作为计数器74HC161的计数输入信号。值得注意的是控制多路选择器74HC153的S0、S1与单片机调试时所使用的引脚复用,要采取特殊措施才能正确试验检测。

测试结果:利用函数信号发生器生成一个方波,周期/频率如图:

其在输出端输出的波形为:

f1=3.881kHz

f2 =1.235kHz 分频功能无误。

五、键盘测试

测试要求:本系统相对比较简单,仅有5个按键,其中4个为系统功能键,它们分别是S1、S2、S3、S4,另一个是系统复位按键S6。对于系统复位按键S6可以在上电之后,使用万用表予以检查,按下该按键,单片机的第9脚应该为高电平,释放后应该为点电平。

对于系统功能键,编写如下程序予以测试检查:

#include #include #include #include #define SEGMENT XBYTE[0x0c000]

#define BIT_LED XBYTE[0x0a000] void display();sbit k1=P1^0;sbit k2=P1^1;sbit k3=P1^2;sbit k4=P1^3;unsigned char a;unsigned

char table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67,0x40,0x00,0x63,0x39,};void delay(unsigned int i);main(){ while(1){ if(k1==0)a=0x06;if(k2==0)a=0x5b;if(k3==0)a=0x4f;if(k4==0)a=0x66;display();} } 测试结果:对于复位键S6,按下前应为低电平,按下后应为高电平

按下前

按下后

对于S1—S4,按下前为高电平,按下后为低电平。其测试结果均符合预期。

六、动态数码管测试

测试要求:本系统中的数码管的原理采用的是动态扫描方式,即某一时刻只用一个数码管在显示,利用人的视觉暂留特性,让数码管高速轮流显示,达到完整显示的目的。

编写如下程序进行测试: #include #include #include #include #define SEGMENT XBYTE[0x0c000]

#define BIT_LED XBYTE[0x0a000] void displayhello();sbit k1=P1^0;sbit k2=P1^1;sbit k3=P1^2;sbit k4=P1^3;unsigned char a;unsigned char table[]={0x06,0x06,0x3f,0x3e,0x79,0x6e,0x3f,0x3e,0x7f,0x67,0x40,0x00,0x63,0x39,};void delayms(unsigned int i);main(){ while(1){ displayhello();} }

void displayhello(){

unsigned char BIT=1;

unsigned int i;

BIT_LED=1;

for(i=0;i<=7;i++)

{

SEGMENT=table[i];

BIT_LED=BIT;

BIT=BIT<<1;

delayms(1);

}

} void delayms(unsigned int i){ unsigned int n;while(i--){

for(n=0;n<125;n++);

} }

测试结果:显示“I love you”

由于是动态显示,所以按下复位键后,只有一个数码管点亮

七、温度传感器测试

测试要求:本系统使用的是一款单线温度传感器(DS18B20),可将温度穿换成12的数字量,以表示温度。

编写如下程序予以测试检查: #include #include #include #include #define SEGMENT XBYTE[0x0c000]

//段码寄存器地址 #define BIT_LED XBYTE[0x0a000]

//位码寄存器地址 #define fosc 11.0592

unsigned char table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67,0x40,0x00,0x63,0x39,};//分别显示0 1 2 3 4 5 6 7 8 9-o C

unsigned char table1[]={0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd,0x87,0xff,0xef};//分别显示0.1.2.3.4.5.6.7.8.9.unsigned char table2[]={0x76,0x79,0x38,0x38,0x3f};sbit k1=P1^0;sbit k2=P1^1;sbit k3=P1^2;unsigned char data display_buffer[13];unsigned char bdata data_ds1302;

unsigned char disbuf[]={0,0,0,0};sbit k4=P1^3;

sbit TMDAT=P3^4;

//温度入口

void dmsec(unsigned int count);void tmreset(void);

//ds18b20 reset void tmstart(void);

// void tmrtemp(void);void Disbuf(unsigned int temper);void displaytemper();void delay(unsigned int);main(){ display_buffer[0]=0x01;

display_buffer[1]=0x00;

display_buffer[2]=0x00;display_buffer[3]=0x08;

display_buffer[4]=0x05;

display_buffer[5]=0x00;display_buffer[6]=0x01;

display_buffer[7]=0x04;

display_buffer[8]=0x00;display_buffer[9]=0x05;

display_buffer[10]=0x00;

display_buffer[11]=0x01;

display_buffer[12]=0x04;while(1){ tmstart();

tmrtemp();

displaytemper();} }

void tmreset(void){

unsigned int i;

TMDAT = 0;

i = 103;while(i>0)i--;

TMDAT = 1;

i = 4;while(i>0)i--;}

void tmpre(void){

unsigned int i;

while(TMDAT);

while(~TMDAT);

i = 4;while(i>0)i--;}

bit tmrbit(void){

// ds1820

// Reset TX

unsigned int i;

bit dat;

TMDAT = 0;i++;

TMDAT = 1;i++;i++;

dat = TMDAT;

i = 8;while(i>0)i--;

return(dat);}

unsigned char tmrbyte(void){

unsigned char i,j,dat;

dat = 0;

for(i=1;i<=8;i++){

j = tmrbit();

dat =(j << 7)|(dat >> 1);

}

return(dat);}

void tmwbyte(unsigned char dat){

unsigned int i;

unsigned char j;

bit testb;

for(j=1;j<=8;j++){

testb = dat & 0x01;

dat = dat >> 1;

if(testb){

TMDAT = 0;

i++;i++;

TMDAT = 1;

i = 8;while(i>0)i--;

}

else {

TMDAT = 0;

i = 8;while(i>0)i--;

TMDAT = 1;

i++;i++;

}

} }

void tmstart(void){

tmreset();

tmpre();

// ds1820

displaytemper();//delay(100);

tmwbyte(0xcc);

tmwbyte(0x44);

}

void tmrtemp(void){

unsigned char a,xiao,b,y1,y2,y3;

tmreset();

tmpre();

delay(1);

tmwbyte(0xcc);

tmwbyte(0xbe);

a = tmrbyte();

b = tmrbyte();

xiao=a&0x0f;//小数部分

y1=a>>4;

y2=b<<4;

y3=y1|y2;if((b&0x0f8)==0x0f8)

{y3=~y3+1;

disbuf[0]=10;//显示符号

disbuf[1]=y3/10;

disbuf[2]=y3%10;

disbuf[3]=xiao*10*0.0625;} else

disbuf[0]=11;//不显示

disbuf[1]=y3/10;

disbuf[2]=y3%10;

disbuf[3]=xiao*10*0.0625;}

void displaytemper()

//温度显示函数

{ unsigned int i;unsigned char e=0x01;//<<1;for(i=1;i<6;i++)

{ switch(i)

{

case 1:{SEGMENT=table[disbuf[1]];BIT_LED=e;break;}

case 2:{SEGMENT=table1[disbuf[2]];BIT_LED=e;break;}

case 3:{SEGMENT=table[disbuf[3]];BIT_LED=e;break;}

case 4:{SEGMENT=table[12];BIT_LED=e;break;}

case 5:{SEGMENT=table[13];BIT_LED=e;break;}

}

e=e<<1;

delay(80);

}

BIT_LED=0;

}

void delay(unsigned int i)

//delay函数 {

while(i--);}

测试结果:

经传感器及数码管延时,温度重新显示

八、时钟日历测试

测试要求:本系统使用了时钟日历专用芯片,该芯片是以串行方式实现控制和数据传输的。

编写如下程序进行测试: #include #include #include #include #define SEGMENT XBYTE[0x0c000]

//段码寄存器地址 #define BIT_LED XBYTE[0x0a000]

//位码寄存器地址 #define fosc 11.0592

unsigned char table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67,0x40,0x00,0x63,0x39,};unsigned char table1[]={0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd,0x87,0xff,0xef};unsigned char table2[]={0x76,0x79,0x38,0x38,0x3f};sbit k1=P1^0;sbit k2=P1^1;sbit k3=P1^2;sbit k4=P1^3;//利用开关量实现切换

//频率变量及子函数预定义 void displayfreq();void read_freq();unsigned char tcount=0,timecount=0;unsigned long freq=0.0;bit freqflag=0;unsigned char fr[6];unsigned int i=0,x=0;

//日期变量及子函数预定义 sbit SCL_ds1302=P2^0;sbit IO_ds1302=P2^1;sbit RST_ds1302=P2^2;

unsigned char data display_buffer[13];unsigned char bdata data_ds1302;

//传输符

unsigned char disbuf[]={0,0,0,0};void open_write_bit();void initial_ds1302();unsigned char read_ds1302(char command);void close_write_bit();void read_time();void set_time();void delay(unsigned int i);void delayms(unsigned int i);void displaytime();void displaydate();main(){ initial_ds1302();

//上电走时

read_time();

//读取当前时间,放到数组中

display_buffer[0]=0x01;

display_buffer[1]=0x05;

display_buffer[2]=0x01;display_buffer[3]=0x07;

display_buffer[4]=0x04;

display_buffer[5]=0x00;display_buffer[6]=0x01;

display_buffer[7]=0x06;

display_buffer[8]=0x00;display_buffer[9]=0x05;

display_buffer[10]=0x00;

display_buffer[11]=0x01;

display_buffer[12]=0x04;

set_time();

//设置时间

while(1){

if(k1==0)

{

while(1){

read_time();

displaytime();

if(k2==0)break;

}

}

read_time();

displaydate();} }

void close_write_bit()//close write { unsigned int i;

SCL_ds1302=0;

_nop_();

RST_ds1302=1;_nop_();_nop_();data_ds1302=0x8e;

for(i=1;i<=8;i++){

SCL_ds1302=0;

IO_ds1302=(data_ds1302&0x01);

_nop_();

SCL_ds1302=1;

data_ds1302=data_ds1302>>1;} data_ds1302=0x80;

IO_ds1302=0;for(i=1;i<=8;i++){

SCL_ds1302=0;

IO_ds1302=(data_ds1302&0x01);

_nop_();

SCL_ds1302=1;

data_ds1302=data_ds1302>>1;} }

void open_write_bit()//open write { unsigned int i;SCL_ds1302=0;_nop_();

//打开写保护//关闭写保护

RST_ds1302=1;_nop_();_nop_();data_ds1302=0x8e;for(i=1;i<=8;i++){

SCL_ds1302=0;

IO_ds1302=data_ds1302&0x01;

_nop_();SCL_ds1302=1;

data_ds1302=data_ds1302>>1;} data_ds1302=0x00;

//0x00,书上为0x80 IO_ds1302=0;for(i=1;i<=8;i++){

SCL_ds1302=0;

IO_ds1302=data_ds1302&0x01;

_nop_();SCL_ds1302=1;

data_ds1302=data_ds1302>>1;} }

void initial_ds1302()

//初始化函数 { unsigned int i;SCL_ds1302=0;_nop_();RST_ds1302=1;_nop_();_nop_();data_ds1302=0x8e;

for(i=1;i<=8;i++){

SCL_ds1302=0;

IO_ds1302=data_ds1302&0x01;

_nop_();SCL_ds1302=1;

data_ds1302=data_ds1302>>1;} IO_ds1302=0;data_ds1302=0x00;

for(i=1;i<=8;i++){

SCL_ds1302=0;

IO_ds1302=data_ds1302&0x01;

_nop_();SCL_ds1302=1;

data_ds1302=data_ds1302>>1;} RST_ds1302=0;SCL_ds1302=0;_nop_();RST_ds1302=1;_nop_();_nop_();data_ds1302=0x90;

for(i=1;i<=8;i++){ SCL_ds1302=0;IO_ds1302=data_ds1302&0x01;_nop_();SCL_ds1302=1;data_ds1302=data_ds1302>>1;}

data_ds1302=0x0a4;

for(i=1;i<=8;i++){ SCL_ds1302=0;IO_ds1302=data_ds1302&0x01;_nop_();SCL_ds1302=1;data_ds1302=data_ds1302>>1;} RST_ds1302=0;_nop_();SCL_ds1302=0;_nop_();RST_ds1302=1;

data_ds1302=0x8e;

for(i=1;i<=8;i++){ SCL_ds1302=0;IO_ds1302=data_ds1302&0x01;_nop_();SCL_ds1302=1;data_ds1302=data_ds1302>>1;}

data_ds1302=0x80;

for(i=1;i<=8;i++){ SCL_ds1302=0;IO_ds1302=data_ds1302&0x01;_nop_();SCL_ds1302=1;data_ds1302=data_ds1302>>1;} RST_ds1302=0;_nop_();SCL_ds1302=0;}

unsigned char read_ds1302(char command)

//read函数 { unsigned int i;data_ds1302=command;SCL_ds1302=0;_nop_();RST_ds1302=1;for(i=1;i<=8;i++){

SCL_ds1302=0;IO_ds1302=data_ds1302&0x01;_nop_();SCL_ds1302=1;data_ds1302=data_ds1302>>1;}

SCL_ds1302=1;for(i=1;i<=8;i++){

SCL_ds1302=0;

if(IO_ds1302)data_ds1302=(data_ds1302>>1)|0x80;

//送入到data_ds1302中,准备送出

else data_ds1302>>=1;SCL_ds1302=1;} RST_ds1302=0;_nop_();SCL_ds1302=0;return(data_ds1302);}

void write_ds1302(unsigned char address,unsigned char numb){

unsigned int i;

SCL_ds1302=0;

RST_ds1302=0;

RST_ds1302=1;

data_ds1302=address;for(i=1;i<=8;i++){

SCL_ds1302=0;

IO_ds1302=data_ds1302&0x01;

//送入写地址

_nop_();SCL_ds1302=1;

data_ds1302=data_ds1302>>1;} data_ds1302=numb;for(i=1;i<=8;i++){

SCL_ds1302=0;

IO_ds1302=data_ds1302&0x01;

_nop_();SCL_ds1302=1;

data_ds1302=data_ds1302>>1;} } void read_time(){ unsigned char second,minte,hour,d,date,month,year,zhou;second=0x81;

//读秒

d=read_ds1302(second);display_buffer[5]=d&0x0f;display_buffer[4]=d>>4;minte=0x83;

//读分

d=read_ds1302(minte);display_buffer[3]=d&0x0f;display_buffer[2]=d>>4;hour=0x85;

//读时

d=read_ds1302(hour);display_buffer[1]=d&0x0f;display_buffer[0]=d>>4;year=0x8d;

//读年

d=read_ds1302(year);display_buffer[7]=d&0x0f;display_buffer[6]=d>>4;month=0x89;

//读月

d=read_ds1302(month);display_buffer[9]=d&0x0f;display_buffer[8]=d>>4;

//送入写的内容

zhou=0x8b;

//读周d=read_ds1302(zhou);display_buffer[12]=d;date=0x87;

//读日期

d=read_ds1302(date);display_buffer[11]=d&0x0f;display_buffer[10]=d>>4;}

void set_time(){ unsigned char data temp;unsigned char data hour_address=0x84,minte_address=0x82,second_address=0x80,date_address=0x86,month_address=0x88,zhou_address=0x8a,year_address=0x8c;//各个时间量的地址

open_write_bit();

temp=(display_buffer[0]<<4)|display_buffer[1];write_ds1302(hour_address,temp);

//写小时

temp=(display_buffer[2]<<4)|display_buffer[3];write_ds1302(minte_address,temp);

//写分钟

temp=(display_buffer[4]<<4)|display_buffer[5];write_ds1302(second_address,temp);

//写秒

temp=(display_buffer[6]<<4)|display_buffer[7];write_ds1302(year_address,temp);

//写年

temp=(display_buffer[8]<<4)|display_buffer[9];write_ds1302(month_address,temp);

//写月

temp=display_buffer[12];write_ds1302(zhou_address,temp);

//写周temp=(display_buffer[10]<<4)|display_buffer[11];write_ds1302(date_address,temp);

//写日期

close_write_bit();

}

void delay(unsigned int i)

//delay函数 {

while(i--);}

void delayms(unsigned int i){ unsigned int n;while(i--){

for(n=0;n<125;n++);

} }

void displaytime(){ unsigned char e=0x01;unsigned int i;BIT_LED=0;

for(i=0;i<=5;i++){

if(i==5||i%2==0||i==11)

SEGMENT=table[display_buffer[i]];

else

SEGMENT=table1[display_buffer[i]];

BIT_LED=e;

e<<=1;

delayms(1);

}

}

void displaydate(){ unsigned char e=0x01;unsigned int i;BIT_LED=0;

for(i=6;i<=13;i++){

if(i==7||i==9)

SEGMENT=table1[display_buffer[i]];

else if(i==12)

SEGMENT=table[10];

else if(i==13)

SEGMENT=table[display_buffer[i-1]];

else

SEGMENT=table[display_buffer[i]];

BIT_LED=e;

e<<=1;delayms(1);

}

}

测试结果:

S1,S2实现年月日周与时分秒的切换

九、语音收录播报测试:

测试要求:本系统中使用的是语音专用芯片IDS1760芯片,该芯片是以串行方式实现控制和数据传输的。

编写如下程序进行测试: #include #include #include #define uchar unsigned char #define uint unsigned int

unsigned char bdata SR0_L;unsigned char bdata SR0_H;unsigned char bdata SR1;unsigned char APCL=0,APCH=0;unsigned char PlayAddL=0,PlayAddH=0;unsigned char RecAddL=0,RecAddH=0;

sbit CMD=SR0_L^0;sbit FULL=SR0_L^1;sbit PU=SR0_L^2;sbit EOM=SR0_L^3;sbit INTT=SR0_L^4;sbit RDY=SR1^0;sbit ERASE=SR1^1;sbit PLAY=SR1^2;sbit REC=SR1^3;

unsigned char ISD_SendData(unsigned char dat);void ISD_PU(void);void ISD_Rd_Status(void);void ISD_WR_APC2(unsigned char apcdatl,apcdath);void ISD_SET_PLAY(unsigned char Saddl,Saddh,Eaddl,Eaddh);void ISD_SET_Rec(unsigned char Saddl,Saddh,Eaddl,Eaddh);void ISD_SET_Erase(unsigned char Saddl,Saddh,Eaddl,Eaddh);

sbit SS=P1^4;sbit SCK=P1^7;sbit MOSI=P1^5;sbit MISO=P1^6;

void Cpu_Init(void);void ISD_Init(void);void delay(unsigned int t);

void main(){ Cpu_Init();ISD_Init();

while(1){ ISD_SET_Erase(0,0,9,0);ISD_SET_Rec(0,0,9,0);ISD_SET_PLAY(0,0,9,0);} }

void Cpu_init(void){ P0=P1=P2=P3=0xff;TMOD=0x01;EA=0;} void ISD_Init(void){ uchar i=2;SS=1;SCK=1;MOSI=0;do { ISD_PU();//上电 delay(50);ISD_Rd_Status();//读取状态

}while(CMD||(!PU));

//if(CMD_Err==1||(PU!+1))则再次发送上电指令 ISD_WR_APC2(0x40,0x04);//将0x0440写入APC寄存器

do { ISD_Rd_Status();}while(RDY==0);do { delay(300);delay(300);i--;}while(i>0);}

//向cpu读回或发送数据

unsigned char ISD_SendData(unsigned char dat){ unsigned char i,j,BUF_ISD=dat;SCK=1;SS=0;for(j=4;j>0;j--){;}

for(i=0;i<8;i++){ SCK=0;for(j=2;j>0;j--){;} if(BUF_ISD&0x01)

{MOSI=1;} else

{MOSI=0;} BUF_ISD>>=1;if(MISO)

{BUF_ISD|=0x80;} SCK=1;for(j=6;j>0;j--){;} } MOSI=0;return(BUF_ISD);} void ISD_PU(void){

ISD_SendData(0x01);

ISD_SendData(0x00);

SS=1;} void ISD_Rd_Status(void){ unsigned char i;ISD_SendData(0x05);ISD_SendData(0x00);ISD_SendData(0x00);SS=1;for(i=2;i>0;i--){;} SR0_L=ISD_SendData(0x05);SR0_H=ISD_SendData(0x00);SR1=ISD_SendData(0x00);SS=1;}

void ISD_WR_APC2(unsigned char apcdatl,apcdath){ ISD_SendData(0x65);ISD_SendData(apcdatl);ISD_SendData(apcdath);SS=1;}

void ISD_SET_PLAY(unsigned char Saddl,Saddh,Eaddl,Eaddh){ ISD_SendData(0x80);ISD_SendData(0x00);ISD_SendData(Saddl);ISD_SendData(Saddh);ISD_SendData(Eaddl);ISD_SendData(Eaddh);ISD_SendData(0x00);SS=1;}

void ISD_SET_Rec(unsigned char Saddl,Saddh,Eaddl,Eaddh){

ISD_SendData(0x81);ISD_SendData(0x00);ISD_SendData(Saddl);ISD_SendData(Saddh);ISD_SendData(Eaddl);ISD_SendData(Eaddh);ISD_SendData(0x00);SS=1;}

void ISD_SET_Erase(unsigned char Saddl,Saddh,Eaddl,Eaddh){ ISD_SendData(0x82);ISD_SendData(0x00);ISD_SendData(Saddl);ISD_SendData(Saddh);ISD_SendData(Eaddl);ISD_SendData(Eaddh);ISD_SendData(0x00);SS=1;} void delay(unsigned int t){ for(;t>0;t--){ TH0=0xfc;TL0=0x18;TR0=1;while(TF0!=1){;} TF0=0;TR0=0;} }

测试结果:需要在程序中设置断点,完成录音,放音再录音放音的循环操作。

测试功能正常。

十、单片机模块调试

测试要求:该模块的调试很复杂,牵扯面也很多。其实通过前面各个模块的调试,已经大部分得到了间接地验证。例如在“动态数码管测试”和“串行通讯测试”中就是用到了定时器。

如有必要可以再编写一些测试程序。例如检测单片机的某一口线的功能是否正常、测试某段程序运行时间,等等。

测试结论:因单片机大部分功能在前调试方案中大部分已使用过,此处不再进行其余调试。

第五篇:《基于单片机的出租车计价器的设计》开题报告

《基于单片机的出租车计价器的设计》开题报告

关键词:出租车计价器 浙江师范大学应用电子技术专业开题报告范文 杭州论文 开题报告

一.选题背景和意义

随着我国经济的迅速发展,人民生活水平的显著提高,城市的交通日趋完善,出租车计价器的应用也越来越广泛。虽然私家车的拥有量在大幅度地提高,但是出租车还是在我国的交通运输中承担着重要的角色,出租车计价器是出租车上必不可少的重要仪器,它是负责出租车营运收费的专用智能化仪表。用户不仅要求计价器性能稳定、计价准确而且对它的要求也越来越高。

近年来,我国出租汽车行业迅猛发展,出租汽车已经成为我国城市公共交通的重要组成部分和现代化城市必备的基础设施,成为人们工作、生活中不可缺少的交通工具。出租汽车服务行业和出租汽车计价器紧密相关,因为出租汽车必须安装出租汽车计价器才能投入营运。出租汽车计价器是一种能根据乘客乘坐汽车行驶距离和等候时间的多少进行计价,并直接显示车费值的计量器具。计价器是出租汽车的经营者和乘坐出租汽车的消费者之间用于公平贸易结算的工具,因而计价器计价准确与否,直接关系到经营者和消费者的经济利益。依据国家有关法律、法规,出租汽车计价器是列入国家首批强制检定的工作计量器具之一,也是近年来国家质量技术监督部门强化管理的六类重点计量器具之一。

出租车行业在我国是八十年代初兴起的一项新兴行业,随着我国国民经济的高速发展,出租汽车已成为城市公共交通的重要组成部分。多年来国内普遍使用的计价器只具备单一的计量功能。目前全世界的计价器中有90%为台湾所生产。现今我国生产计价器的企业有上百家,主要是集中在北京,上海,沈阳和广州等地。

在出租车是城市交通的重要组成部分,行业健康和发展也获得越来越多的关注。汽车计价器是乘客与司机双方的交易准则,它是出租车行业发展的重要标志,是出租车中最重要的工具。它关系着交易双方的利益。具有良好性能的计价器无论是对广大出租车司机朋友还是乘客来说都是很必要的。

二、国内外研究现状、发展动态

出租车行业在我国是八十年代初兴起的一项新兴行业,随着我国国民经济的高速发展,出租汽车已成为城市公共交通的重要组成部分。多年来国内普遍使用的计价器只具备单一的计量功能。目前全世界的计价器中有90%为台湾所生产。现今我国生产计价器的企业有上百家,主要是集中在北京,上海,沈阳和广州等地。

我国的第一家生产计价器企业是重庆市起重机厂,最早的计价器全部采用机械齿轮结构,只能完成简单的计程功能,可以说早期的计价器就是一个里程表。

随着科学技术的发展,产生了第二代计价器。它采用了手摇计算机与机械结构相结合的方式,实现了半机械半电子化。此时它在计程的同时还可以完成计价的工作。

大规模集成电路的发展又产生了第三代计价器,也就是全电子化的计价器。它的功能也在不断完善.当单片机出现并应用于计价器后,现代出租车计价器的模型也就基本具备了,它可以完成计程,计价,显示等基本工作。单片机以及外围芯片的不断发展促进了计价器的发展。出租车计价器在最初使用时具备的主要功能是根据行驶里程计价,要求精度高,可靠性好。

三、研究的内容及可行性分析 1.研究的内容:

计价器显示的营运金额是营运里程与价格的函数(等候时间一般折算成一定比例的里程来计算)。出租车计价器通过传感器与行驶车辆连接。出租汽车的实际里程通过传感器的脉冲信号在计价器里折算成一定的计价营运里程。针对这一点我们来利用单片机作为控制核心,设计一款出租车计价器,具有计价显示、等待时间计价,公里数显示,时间显示等相关功能。设计要求:

(1)、计价要求:3公里以内10元,夜晚三公里以外每公里2.2元,白天三公里以外每公里1.8元;

(2)、能够实时显示公里数和等待时间;等待时间计价要求为:等待3分钟以内不计价,3分钟以外每分钟0.5元;

(3)、具备起步和下车的语音提示;

2.可行性分析:

本设计采用AT89C51单片机为主控器,以A44E霍尔传感器测距,实现对出租车的多功能的计价设计,并采用掉电存储单元AT24C02来实现在系统掉电的时候保存单价和系统时间等信息,输出采用8段数码显示管。本电路设计的计价器不但能实现基本的计价,而且还能根据白天,黑夜,中途等待来调节单价,但同时在不计价的时候还能作为时钟为司机同志提供方便。

四、论文拟解决的关键问题及难点

1.关键问题:

1)解决里程检测电路精度问题;

2)解决计价器的掉电存储能力和显示的驱动能力; 3)解决多次计价的累加和显示问题。2.难点: 对数据的采集及显示。

五、研究方法与技术路线

本设计由硬件设计和软件设计两部分组成。系统的硬件主要由以下几个部件组成:单片机AT89S51、AT24C02 掉电存储控制、里程计算单元、总金额及单价显示部件、串口显示驱动电路、键盘控制部件、语音播报电路等,其方框原理图如图1所示。

1.硬件设计 1.1 单片机模块:

AT89C51是一种带4K字节闪烁可编程可擦除只读存储器的低电压、高性能CMOS8位微处理器,俗称单片机。单片机的可擦除只读存储器可以反复擦除100次。该器件采用ATMEL高密度非易失存储器制造技术制造,与工业标准的MCS-51指令集和输出管脚相兼容。由于将多功能8位CPU和闪烁存储器组合在单个芯片中,ATMEL的89C51是一种高效微控制器。AT89C2051是它的一种精简版本,AT89C2051是美国ATMEL公司生产的低电压,高性能CMOS8位单片机,片内含2K字节的可反复擦写的只读程序存储器和128bytes的随机存取数据存储器,器件采用ATMEL公司的高密度、非易失性存储技术生产,兼容标准MCS-51指令系统,片内置通用8位中央处理器和Flash存储单元。因为在的程序中有读取、计算、显示等单元,2K字节的ROM可能不够,因此我们采用AT89C51作为单片机模块。

1.2 AT24C02 掉电存储单元: 掉电

存储单元的作用是在电源断开的时候,存储当前设定的单价信息。AT24C02 是ATMEL公司的2KB 字节的电可擦除存储芯片,采用两线串行的总线和单片机通讯,电压最低可以到2.5V,额定电流为1mA,静态电流10Ua(5.5V),芯片内的资料可以在断电的情况下保存40 年以上,而且采用8 脚的DIP 封装,使用方便。

AT24C02的外围电路中有R1、R2 两个上拉电阻,其作用是减少AT24C02 的静态功耗,由于AT24C02 的数据线和地址线是复用的,采用串口的方式传送数据,所以只用两根线SCL(移位脉冲)和SDA(数据/地址)与单片机传送数据。

每当设定一次单价,系统就自动调用存储程序,将单价信息保存在芯片内;当系统重新上电的时候,自动调用读存储器程序,将存储器内的单价等信息,读到缓存单元中,供主程序使用。

1.3 里程计算、计价单元的设计:

里程计算是通过安装在车轮旁的霍尔传感器A44E检测到的信号,送到单片机,经处理计算,送给显示单元的。其原理如图2传感器测距示意图所示。

图 2 传感器测距示意图

由于A44E 属于开关型的霍尔器件,其工作电压范围比较宽(4.5~18V),其输出的信号符合TTL 电平标准,可以直接接到单片机的IO 端口上,而且其最高检测频率可达到1MHZ。

A44E 集成霍耳开关由稳压器A、霍耳电势发生器(即硅霍耳片)B、差分放大器C、施密特触发器D 和OC 门输出E 五个基本部分组成。

在输入端输入电压CC V,经稳压器稳压后加在霍耳电势发生器的两端,根据霍耳效应原理,当霍耳片处在磁场中时,在垂直于磁场的方向通以电流,则与这二者相垂直的方向上将会产生霍耳电势差H V 输出,该H V 信号经放大器放大后送至施密特触发器整形,使其成为方波输送到OC 门输出。当施加的磁场达到工作点(即OP B)时,触发器输出高电压(相对于地电位),使三极管导通,此时OC 门输出端输出低电压,通常称这种状态为开。当施加的磁场达到释放点(即rP B)时,触发器输出低电压,三极管截止,使OC 门输出高电压,这种状态为关。这样两次电压变换,使霍耳开关完成了一次开关动作。

我们选择了P3.2 口作为信号的输入端,内部采用外部中断0(这样可以减少程序设计的麻烦),车轮每转一圈(我们设车轮的周长是1 米),霍尔开关就检测并输出信号,引起单片机的中断,对脉计数,当计数达到1000 次时,也就是1 公里,单片机就控制将金额自动的加增加,其计算公式:当前单价×公里数=金额。

1.4 数据显示单元:

由于设计要求有单价(2 位)、路程(2 位)、总金额(3 位)显示输出,加上我们另外扩展了时钟显示(包含时分秒的显示),若采用LCD 液晶段码显示,在距离屏幕1 米之外就无法看清数据,不能满足要求,而且在白天其对比度也不能够满足要求,因此我们采用6 位LED数码管的分屏显示,如图 4 采用6 位LED数码管的分屏显示所示:

时钟显示(图中显示为12 点0 分46 秒)

图 4 采用6 位LED数码管的分屏显示

数据的分屏的显示是通过按键S1 来实现切换的,如图 5 S1切换显示屏所示。

图 5 S1切换显示屏

在出租车不走的时候,按下S1,可以实现数据的分屏显示;车在行走的时候只有总金额和单价显示屏在显示,当到达目的地的时候,客户要求查看总的里程的时候,就可以按下S1 切换到里程和单价显示屏,供客户查询。显示电路的电路原理图如图 7 所示。

1.5 串口显示驱动电路

从单片机串口输出的信号先送到右边的移位寄存器(74HC164),由于移位脉冲的作用,使数据向右移,达到显示的目的。移位寄存器74HC164还兼作数码管的驱动,插头1(header1)接数据和脉冲输出端,插头2(header2)接电源。电路中的三个整流管D1~D3 的作用是降低数码管的工作电压,增加其使用寿命。

1.6 键盘控制部件 1)S1按键的功能

在出租车不走的时候,按下S1,可以实现数据的分屏显示;车在行走的时候只有总金额和单价显示屏在显示,当到达目的地的时候,客户要求查看总的里程的时候,就可以按下S1切换到里程和单价显示屏,供客户查询。

2)S2按键的功能

在按下S1按键之后,若接着按下S2键则进行单价调整(默认为调整白天单价),当接着按下S1时,则进行晚上单价调整,再次按下S1可进行中途等待单价调整。当单价调整结束后,可以通过按下S2按键进行时间调整,默认为调整小时,接着按下S1可进行调整分钟,分钟调整后再接下S1可进行秒调整。当时间调整完成后,若接着按下S2则又可进行单价调整。3)S3按键的功能

在显示金额及单价时,若按下S3键则显示路程和单价,再次按下S3,可返回显示金额及单价。

4)S4按键的功能

在按下S1按键之后,若接着按下S4按键,则进行设定默认晚上单价,并启动计价器,若没有按下S4则可设定默认单价(白天),并启动计价器。当设定默认晚上单价结束后,再次接下S4按键,则可设定默认中途等待单价,并启动计价器。当设定默认中途等待单价后,若还按一次S4,则返回系统时间的显示。

1.7 语音播报电路

主要用于向乘客致欢迎词,以提高服务质量。语音芯片选用ISD4004,该系列工作电压3V,单片录放时间4~8min,音质好。芯片采用CM0S技术,内含振荡器、防混淆滤波器、平滑滤波器、音频放大器、自动静噪及高密度多电平闪烁存贮阵列。当乘客上车时,播报内容为:乘客您好,欢迎您乘坐本公司出租车。当到达目的地时,播报内容为:车已到达目的地,请按计价器上显示的金额付款,谢谢!

2.软件设计

2.1系统整体程序流程

在主程序模块中,需要完成对各接口芯片的初始化、出租车起价和单价的初始化、中断向量的设计以及开中断、循环等待等工作。当按下S1时,就启动计价,将根据里程寄存器中的内容计算和判断出行驶里程是否已超过起价公里数。若已超过,则根据里程值、每 本论文由无忧论文网www.xiexiebang.com整理提供

公里的单价数和起价数来计算出当前的累计价格,并将结果存于价格寄存器中,然后将时间和当前累计价格送显示电路显示出来。当到达目的地的时候,由于霍尔开关没有送来脉冲信号,就停止计价,显示当前所应该付的金额和对应的单价,到下次启动计价时,系统自动对显示清零,并重新进行初始化过程。主程序流程图如图8 所示。

2.2 定时中断服务程序

在定时中断服务程序中,每100ms 产生一次中断,当产生10 次中断的时候,也就到了一秒,送数据到相应的显示缓冲单元,并调用显示子程序实时显示。其程序流程如图9所示。

2.3 里程计数中断服务程序

每当霍尔传感器输出一个低电平信号就使单片机中断一次,当里程计数器对里程脉冲计满1000 次时,使微机进入里程计数中断服务程序中。在该程序中,需要完成当前行驶里程数和总额的累加操作,并将结果存入里程和总额寄存器中。2.4 中途等待中断服务程序

当在计数状态下霍尔开关没有输出信号,片内的T1 定时器便被启动,每当计时到达3分钟,就对当前金额加上中途等待的单价,以后每3分钟都自动加上中途等待的单价。当中途等待结束的时候,也就自动切换到正常的计价。2.5 显示子程序服务程序

由于是分屏显示数据,所以就要用到4 个显示子程序,分别是:时分秒显示子程序、金额单价显示子程序、路程单价显示子程序、单价调节子程序。2.6 键盘服务程序

键盘采用查询的方式,放在主程序中,当没有按键按下的时候,单片机循环主程序,一旦有按键按下,便转向相应的子程序处理,处理结束再返回。

六、论文的进度安排 2010.07 下达任务书

2010.07——2010.09 完成选题和资料收集,准备开题 2010.09.26 开题

2010.10——2011.02 完成硬件设计和软件编程 2011.02——2011.03 进行调试 2011.03——2011.04 撰写论文准备答辩

七、主要参考文献

[1] 张友德,赵志英,涂时亮.http://www.xiexiebang.com/ktbgfw/ 单片微型机原理、应用与实验.上海:复旦大学出版社 2005,12.[2] 徐光翔.单片机原理接口及应用.南京大学出版社.[3] 张淑清等.单片微型计算机接口技术及其应用.北京:国防工业出版社.[4] 王晓君等.MCS-51及兼容单片机原理与选型.北京:电子工业出版社.[5] 张鑫,华臻,陈书谦.《单片机原理及应用》[M].电子工业出版社, 2005.P110~136.[6] 丁元杰、吴大伟《单片微机实题集与实验指导书》.[M].机械工业出版社, 2004.P124~125.

下载毕业设计开题报告(出租车计价器).(精选5篇)word格式文档
下载毕业设计开题报告(出租车计价器).(精选5篇).doc
将本文档下载到自己电脑,方便修改和收藏,请勿使用迅雷等下载。
点此处下载文档

文档为doc格式


声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:645879355@qq.com 进行举报,并提供相关证据,工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。

相关范文推荐

    !出租车计价器毕业设计中英文翻译(推荐5篇)

    毕业论文准备 ABSTRACT In this paper, a multi-channel taximeter that is able to deal with more than one passenger simultaneously is proposed. In order to demons......

    毕业实践调研报告(出租车计价器)

    无锡职业技术学院 调研报告 1.选题的原因 随着我国经济的发展,城市化进程逐步加快,生活水平逐步提高,人们也不再满足于衣食住的享受,出行的舒适已受到越来越多人的关注。于是,在......

    出租车计价器(范文大全)

    基于单片机的出租车计价器设计 摘要 出租车计价器的数字系统的设计正是基于一些专用的芯片,才发挥其有效特性,从而实现出租车的计价功能。此数字系统主要分为三个单元,即里程计......

    单片机出租车计价器源程序

    出租车计价器设计与制作 设计并制作一台出租车计价器。调试时采用10Hz方波信号模拟,每个方波代表10m。基本要求: (1)不同情况具有不同的收费标准 白天 1元/公里 晚上 2元/ 公......

    出租车计价器 硬件课程设计

    硬件课程设计报告 题目:出租车计价器 目录 1. 引言 ........................................................................................................................

    出租车计价器课程设计2

    出租车计价器课程设计 目录 前言 1、 系统工作原理 1.1 功能说明 1.2 基本原理 2、 硬件设计 2.1 单片机最小系统单元 2.2 A44E霍尔传感器检测单元 2.3 AT24C01存储单元 2.......

    出租车计价器毕业论文附录

    北京信息科技大学 毕业设计(论文)附录 题 目:学 院: 专 业:学生姓名: 班级/学号 指导老师/督导老师:起止时间:2012 年 月 日 至 2012 年 月 日 目录 附件1 原理图·······......

    出租车计价器设计范文

    平顶山工业职业技术学院 目录 目录 .....................................................................................................................................