




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、本科毕业设计(论文)外文翻译浙江师范大学本科毕业设计(论文)外文翻译译文:基于微控制器的速度表暨里程表ARUN KUMAR VADLA文章来源:electronics for you,2008:6064.通常,数字式车速表仅能在豪华汽车和高端摩托车中找到。 即使您的摩托车有一个机械车转速表,当它受到损坏时您将做什么? 首先,您需要替换机械蜗轮,然后替换缆绳。 无论如何,我们这里描述得是如何给您的摩托车设计一个数字式车速表。该电路使用一个微型控制器、液晶显示和一些常用的组件。这是一个更好的替代机械速度计,甚至以最低技术水平的初学者也可以组装的物品。数字速度表暨里程表的特点是: 1数字读出2显示的
2、速度为公里/小时3显示行驶的移动距离4读数(EEPROM)固定在存储器中保存的5由于使用微控制器就比较可靠6无机械磨损和撕裂7在家中可以自己制速度变换装置或传感器8在完成99,999.9 km后会自已重新设置到零9容易修造和固定在自行车上 计算你首先需要知道的自行车前轮的半径。这里的计算是基于对英雄本田的辉煌典范。前轮半径为30厘米(这可能随品牌或模型变化)。wheel=2r的圆周(其中r为厘米),周长= 2 × 3.14 × 30 =188.4厘米或一点八八四米。速度。让我们假设他在1秒钟完成一次转动。换言之,在一秒钟内,自行车前进了1.88米。所以在km/hour的速度
3、: N×1.88×3600/1000= N×6.784或N×6.8 N是每秒转过的转数。6 .8是一个常数,并且仅N变化,例如,如果N是5,速度等于5x6.8 = 34公里/小时。距离。里程表每隔100米更新一次,包括100米,车轮必须作出约53次转动(100/1.88)。微控制器采用的计算革命,速度计算,结果转换和显示任务。电路说明图.1基于微型控制器的数字式车速表附带测路器的电路在图.1显示。电路中使用的各种组件的功能如下所述。微型控制器。 由于它的与基于CISC的8051家庭的低数字计算、支付能力和兼容性从Atmel的一个20引脚的AT89C205
4、1微型控制器使用这里。所有的微控制器引脚可利用的项目。这个微型控制器具有2 KB的闪存,128个字节RAM, 15条输入-输出(输入/输出)线、两个16位定时器或者计数器、一个5向量两级中断结构,、一个全双工串行口、一个高精确度模拟比较器、一片上振荡器和时钟电路。液晶显示模块。要显示移动的速度和距离,我们使用一块基于HD44780的16x2字母数字液晶控制器。LCD的背光功能,使数据即使在夜晚都依然可见。LCD的引脚配置和液晶显示功能。早前已经被发表在液晶显示器有EFY的几个问题中。串行EEPROM。距离行驶的读数都保存在一个外部串行EEPROM中。在这里使用的是24C02飞利浦协议的串行EE
5、PROM。总线协议。该总线由两个活动连接线和一条地线。主动线,串行数据线(SDA)和串行时钟线(SCL)是双向的。挂接到总线的每个设备都有自己唯一的地址,不管它是一个MCU,LCD驱动器,内存或ASIC。根据功能,这些芯片都可以作为一个接收器和/或发射机。显然,LCD驱动器只是一个接收器,而记忆体或I/O芯片可以同时发射器和接收器。该总线是一种多主总线。这意味着,超过一个IC发起数据传输能力可以连接到它。该协议规范规定的IC,它被认为是上启动主机总线的数据传输。总线主机通常是微控制器。因此,所有其他IC被视为在这一瞬间的总线。假设在MCU要发送数据到它的总线之一。首先,微控制器将发出一个起始条
6、件。作为一个'注意'信号所连接的所有设备,这行为。总线上的所有IC将听取传入的数据总线。则MCU发送的设备,它希望访问地址,以及标明是否有访问是一个'读'或'写'操作。收到的地址,所有IC将比较它自己的地址。如果不匹配,他们只是等待,直到总线由停止条件释放。如果地址匹配,芯片将产生一个响应所谓的'承认'信号。我们已经用写在这个项目的运作。一旦接收到应答信号微控制器,它可以开始发送或接收数据。在我们的例子中,MCU将发送数据。当一切都过去了,微控制器会发出停止条件。这预示着,巴士已被释放,而连接的ICS可能期待着另一个传输到任何时候
7、启动。我们有几个国家在总线上:启动,地址,承认,数据和停止。这些总线上的所有独特的条件。在我们的项目中,微控制器是主串行EEPROM是奴隶。定期的读数存储在EEPROM和以前的阅读是从EEPROM中检索每个自行车启动时。转速传感器。对于这个项目,我们利用一种简单的自制速度传感器的使用。车轮的旋转是由一个干簧管的联合行动,并固定在车轮磁铁感应。每一次当车轮转动时,该传感器发出一个脉冲给微控制器。光耦。光电耦合器是用来对付反弹的时候,干簧管触点闭合的影响。电源供应器。使用三端电压后,对于各部分电路的电源从汽车的12V的电池后减少到5V。软件软件的Init_EEPROM'和Speedo
8、9;这一项目的程序源代码是用汇编语言。这是编译使用打开来源ASEM-51汇编器生成Init_EEPROM.hex和Speedo.hex文件。十六进制文件被烧入微控制器芯片。两个单片机的内部定时器被配置为8位计数器来计算转速传感器产生的脉冲数。一个定时器用于测量距离和速度的计算等。一个软件延时一秒后产生的高速计数器被触发。速度计数值是从逆记数器得到。为了加快进程,查找数据表存储在ROM,帮助微控制器转换成相应的速度值的脉冲数。该方案流程图如图.2所示。在距离'计数器加每隔100米。该轮已使53个转动实现这一目标。距离柜台装有一个203的初始值(255-53 +1),并在每个转动时递增。经
9、过53次计数,定时器溢出并产生一个中断来通知微控制器。在中断服务程序,微控制器更新相应的DS1的'距离变量。而是在每个周期的节能距离变量,当车辆在停止时(速度00.0公里/小时)微控制器会保存这些读数。换句话说,当车辆停在交通信号或之前关闭点火键S,最后读数保存到EEPROM中。同样再次检索阅读时从自行车是开启未来的阅读时间,为每个更新EEPROM中。图.2制造建设中的簧片开关和磁铁需要在电机的自行车(英雄本田的辉煌)前轮固定。一个小的圆形磁铁(直径约2厘米),通常在使用扬声器的小玩具中是都可以用到的。磁铁固定在鼓的中部连接到下方的辐条轮鼓。磁铁固定使用热胶水或环氧树脂。固定磁簧开关,
10、PVC管的机械需要,需要使磁铁和干簧管正确对齐,如图.3所示。将3.2厘米直径、长15.2厘米PVC管测量垂直剪下,分为两半。只用一个一半的PVC管。坐骑和安全保障的的干簧管和电缆用领带固定在熟料手柄上(通常用于紧急照明设备)。一旦烘干,焊两条线的另一端当两个簧片开关的引线。塑料手柄上用螺钉固定。现在,请将前面避震前叉,使得磁簧开关管正对磁体的开关。图.3连接万用表,将它设置在连续性模式下,两条电线来字磁簧开关。慢慢转动方向盘,当磁铁横跨它通过时,看看簧片开关是否关闭。如果是这样的话,万用表会提供连续性的响声。当磁铁移开远离磁簧开关后,蜂鸣声将停止,这表明该簧片开关处于打开状态。做一些试验,以
11、找到安装和固定的PVC管,让磁簧开关顺畅工作的最佳位置。马克前面减震器叉的位置。现在您可以修复的PVC管玩意儿的减震器前叉采用热胶,如图所示.5。使用一定的热胶,以确保管道的自由。仔细检查自行车的车把上的两条电线之间的关系,以确保能顺利使用电缆线,这就完成了传感器安装的一部分。主电路和液晶显示模块可安装在合适的塑料外壳中,可随时在电子商店中买到。这些外壳应具有易于安装的液晶面板预切槽。如果这样的框不可用,您可以使用适当取消对某些部分的液晶面板的电子电抗器的塑料盒。电源可采取直接从自行车的12V的电池或挖掘控制台的大灯开关和指示灯。为此,您需要拆卸交换机控制台并积极用万用表识别正面导线和接地导线
12、。在进行这一步时,记住要关闭点火。钎具60厘米两芯线连接到交换机控制台内的正负极。必须采取从交换机控制台提供,它的优点是点火钥匙的控制,而主要单位是无需单独的通断开关电源。一个实际的尺寸,单面印刷电路板的基于微控制器的速度表暨里程表布局如图所示。在图.7和元件布局图.8。测试当所有的部件测试被焊在PCB上,方案与Init_EEPROM.hex文件放置在一个微控制器和20引脚微控制器芯片和相应的开关电路。在LCD的第一行,INIT_EEPROM'出现。五秒钟后,00000 .0'显示在第二行。这个过程将删除任何以前的数据并且将EEPROM中的初始读数调整为零。现在关掉电源和
13、9;speedo.hex的主要文件中的微控制器。编程后,单片机电路和开关电源回到先前的状态。 LCD会显示公里:00000.0在第一行,'速度 千米/小时:00.0在第二行。现在,先准备你要测试的车子。连接两条电线从干簧管和电源线来的主要单位。装载在自行车的车把中心的'u'的夹子用于固定手柄的机箱顶部单位。您可以使用电缆来做到这一点。安装布置的位置如图.6。现在来做个测试,启动自行车,如果连接是正确的,速度和距离将在液晶显示屏上显示出来。像聚乙烯防护罩可用于雨天的主机使用。EFY注意。本文的源代码已被列入thismonth的EFY CD中。图.4图.5图.6图.8 图.
14、7原文: Microcontroller-based Speedometer-Cum-Odometern ARUN KUMAR VADLAThe article source:electronics for you,2008:6064.Normally, digital speedometers are found only in luxury cars and high-end motorbikes. Even if your motorbike has a mechanical speedometer, what will you do when it gets damaged? Firs
15、t, you need to replace the mechanical worm gear and then the cable. Anyway, we describe here how to build a digital speedometer-cumodometer for your motorbike. The circuit uses a microcontroller, an LCD display and some commonly available components. It is a better alternative to the mechanical spee
16、dometer and even a beginner with minimal skill level can assemble it.The features of the digital speedo-meter-cum-odometer are:1. Digital readout2. Speed displayed in km/hour3. Distance traveled displayed in kilometers4. Readings saved in non-volatile memory (EEPROM)5. Reliability due to use of the
17、microcontroller6. No mechanical wear and tear7. Home-brewed speed transducer/sensor8. Self reset to zero after completion of 99,999.9 km 9. Easy to build and fix onto the bikeCalculations You first need to know the radius of the bikes front wheel. The calculations here are based on Hero Hondas Splen
18、dor model. The radius of the front wheel is 30 cm. (This can vary with thebrand or model.) Circumference of the wheel= 2r(where r is in cm)= 2×3.14×30= 188.4 cm or 1.884 metres.Speed. Lets assume that in 1 second he wheel completes one revolution. In other words, in one second, the bike ha
19、s covered 1.88 metres. Therefore the speed in km/hour:N×1.88×3600/1000= N×6.784 or N×6.8 where N is the number of revolutions per second. 6.8 is a constant and only N varies; for example, if N is 5, the speed equals 5x6.8= 34 km/hour.Distance. The odometer is updated every 100 me
20、tres. To cover 100 metres, the wheel is required to make approximately 53 revolutions (100/1.88).The microcontroller takes care of the tasks of revolutions counting, speed calculation, conversion and display of results.Circuit descriptionThe circuit of the microcontroller-based digital speedometer-c
21、um-odometer is shown in Fig. 1. The functions of various components used in the circuit are described below. Microcontroller. A 20-pin AT89C2051 microcontroller from Atmel is used here because of its low pin count, affordability Fig. 1.and compatibility with CISC-based 8051 family. All the available
22、 pins of the microcontroller are utilised in the project. This microcontroller features 2 kB of Flash, 128 bytes of RAM, 15 input/output (I/O) lines, two 16-bit timers/counters, a five-vector two level interrupt architecture, a full-duplex serial port, a precision analogue comparator, on-chip oscill
23、ator and clock circuitry. LCD module. To display the speed and distance traveled, we have used a 16x2 alphanumeric LCD based on HD44780 controller. The backlight feature of the LCD allows data to be visible even at night. The pin configuration and features of this LCD have earlier been published in
24、several issues of EFY.Serial EEPROM. The readings of the distance traveled are saved in an external serial EEPROM. Here, a 24C02 serial EEPROM based on Philips I2C protocol is used.I2C bus protocol. The I2C bus consists of two active wires and a ground connection. The active wires, serial data line
25、(SDA) and serial clock line (SCL) are bidirectional. Every device hooked up to the bus has its own unique address, no matter whether it is an MCU, LCD driver, memory or ASIC. Each of these chips can act as a receiver and/or transmitter, depending on the functionality. Obviously, an LCD driver is onl
26、y a receiver, while a memory or I/O chip can be both transmitter and receiver. The I2C bus is a multi-master bus. This means that more than one IC capable of initiating a data transfer can be connected to it. The I2C protocol specification states that the IC that initiates a data transfer on the bus
27、 is considered the bus master. Bus masters are generally microcontrollers. Consequently, all the other ICs are regarded as bus slaves at that instant.Lets assume that the MCU wants to send data to one of its slaves. First, the MCU will issue a START condition. This acts as an attention signal to all
28、 of the connected devices. All ICs on the bus will listen to the bus for incoming data. Then the MCU sends the address of the device it wants to access, along with an indication whether the access is a read or write operation. Having received the address, all ICs will compare it with their own addre
29、ss. If it doesnt match, they simply wait until the bus is released by the stop condition. If the address matches, the chip will produce a response called acknowledge signal. We have used write operation in this project.Once the MCU receives the acknowledge signal, it can start transmitting or receiv
30、ing data. In our case, the MCU will transmit data. When all is done, the MCU will issue the stop condition. This signals that the bus has been released and that the connected ICs may expect another transmission to start any moment.We have several states on the bus: start, address, acknowledge, data
31、and stop. These are all unique conditions on the bus. In our project, the microcontroller is the master and the serial EEPROM is the slave.The readings are periodically stored in the EEPROM and the previous reading is retrieved from the EEPROM each time the bike is started.Speed sensor. For this pro
32、ject, we make use of a simple home-made speed transducer. The rotation of the wheel is sensed by the combined action of a reed switch and a magnet fixed on the wheel. The sensor sends a pulse to the microcontroller each time a revolution is made.Optocoupler. An optocoupler is used to counter the eff
33、ects of bouncing when the contact of reed switch is closed.Power supply. The power supply for various parts of the circuit is drawn from the vehicles 12V battery after reducing it to 5V using a three-terminal voltage.SoftwareThe Init_EEPROM and Speedo source codes of this project are written in Asse
34、mbly language. These are compiled using an open-source ASEM-51 assembler to generate the Init_EEPROM.hex and Speedo.hex files. The hex files are burnt into the microcontroller chip. Two internal timers of the microcontroller are configured as 8-bit counters to count the number of pulses generated by
35、 the speed sensor. One timer is used to measure the distance and the other for speed calculation.A software delay of one second is generated after the speed counter is triggered. The speed count value is obtained from the counter registers. To speed up the process, a look-up data table is stored in
36、the ROM that helps the microcontroller to convert the number of pulses into the corresponding speed values. The program flow-chart is shown in Fig. 2.The distance counter is incremented every 100 metres. The wheel has to make 53 revolutions to achieve this. The distance counter is loaded with an ini
37、tial value of 203 (255-53+1) and is incremented on each revolution. After 53 counts, the timer overflows and generates an interrupt to notify the microcontroller that 100 metres are covered.In the interrupt service routine, the microcontroller updates the corresponding DS1 distance variable. Instead
38、 of saving distance variables after each cycle, the microcontroller saves these readings when the vehicle is at halt (speed is 00.0 km/hour). In other words, when the vehicle is stopped at traffic signals or before the ignition key s turned off, the last reading is saved to the EEPROM. The same read
39、ing is again retrieved from the EEPROM when the bike is turned on next time and the readings are updated for each trip.Fig. 2.ConstructionThe reed switch and a magnet need to be fixed on the front wheel of the motor bike (Hero Hondas Splendor). A small circular magnet (about 2 cm in diametre), norma
40、lly used in speakers of small toys, can be used. Fix the magnet to the central drum of the wheel just below the spokes connected to the drum. Secure the magnet using hot glue or Araldite.For fixing the reed switch, a PVC pipe contraption needs to be made so that the magnet and reed switch are aligne
41、d as shown in Fig. 3. The materials required to build the contraption are shown in Fig. 4. Cut a 3.2cm diameter PVC pipe measuring 15.2 cm in length perpendicularly into two halves. Use only one half of the PVC pipe. Mount and secure the reed switch using Araldite and cable ties on the plastic handl
42、e (normally used in emergency lights). Once it dries up, solder two wires to the two opposite end leads of the reed switch. Fix the plastic handle on the half cut PVC pipe using screws. Now, place the pipe on the front shock-absorber fork such that reed switch faces towards the magnet. Connect a mul
43、timeter, set in continuity mode, to the two wires coming from the reed switch. Rotate theFig. 3.Fig. 4.wheel slowly and see whether the reed switch closes when the magnet passes across it. If it does, the multimeter will give a continuity beep. When the magnet moves away from the reed switch, the be
44、ep will stop, indicating that the reed switch is open. Make a few trials to find the optimal position for mounting and fixing the PVC pipe such that the reed switch works smoothly. Mark the location on the front shock-absorber fork.Now you can fix the PVC pipe contraption to the shock-absorber fork
45、using hot glue as shown in Fig. 5. Use liberal amount of hot glue to secure it to the pipe. Carefully route the two wires up to the bikes handle bar using cable ties to secure the wire. This completes the sensor mounting part.Fig. 5.The main circuit and the LCD module can be housed in suitable plast
46、ic enclosures, which are readily available in electronic projects shops. These enclosures should have precut slot for easy mounting of the LCD panel. If such boxes are not available, you can use the plastic boxes of electronic chokes by suitably removingSome portions for the LCD panel. Power supply
47、can be taken either directly from the bikes 12V battery or tapped from the console which houses horn, headlight and indicator light switches. For this, you need to remove the switch console and identify positive wire and ground wire using a multimeter. When carrying out this step, remember to turn the ignition key toon position. Solder a 60cm two-core wire to the positive and negative terminals inside the switch console. The advantage of taking supply from the switch
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025学校超市对外承包合同范本
- 环保作文500字8篇范文
- 再记拔河比赛350字7篇范文
- 雷雨作文600字14篇
- 农村集体经济组织投资合作合同书
- 农危改资金管理办法
- 中商品条码管理办法
- 制服及管理办法规定
- 叙事作文赶集600字11篇
- 公司筹融资管理办法
- 信访工作法治化培训讲座
- 被子植物的一生复习课教案
- 阅读理解词义猜测题(练)- 高考英语 (解析版)
- 2024年下半年青海西宁市事业单位面向社会招聘工作人员笔试及现场笔试历年典型考题及考点剖析附带答案详解
- 商场设备回收合同范本
- 厨师食品安全知识培训
- TCCTAS 151-2024 公路沥青路面结构内部状况三维探地雷达快速检测规程
- 中外贸易合作协议合同范本
- 初三物理杠杆练习题及答案
- 物业管理费用与收入分析
- 《气道管理版》课件
评论
0/150
提交评论