摘 要
随着居民生活水平的不断提高,自行车不再仅仅是普通的运输、代步的工具,而是成为人们娱乐、休闲、锻炼的首选。自行车里程/速度计能够满足人们最基本的需求,让人们能清楚地知道当前的速度、里程等物理量。本文介绍的速度与里程表设计以单片机最小系统和霍尔传感器为核心。传感器将不同车速转变成的不同频率的脉冲信号输入到单片机进行控制与计算,再采用LED模块进行显示,使得电动车的速度与里程数据能直观的显示给使用者。
本系统由霍尔传感器、单片机AT89C52、系统化LED显示模块、数据存储电路和键盘控制组成。其中霍尔传感器包含信号放大和波形整形。对待测信号进行放大的目的是降低对待测信号的幅度要求;波形变换和波形整形电路则用来将放大的信号转换成可与单片机相连的TTL信号;通过单片机的设置可使内部定时器T1对脉冲输入引脚T0进行控制,这样能精确地算出加到T0引脚的单位时间内检测到的脉冲数;设计中速度显示采用LED模块,通过速度换算得来的里程数采用I2C总线并通过E2PROM来存储,既节省了所需单片机的口线和外围器件,同时也简化了显示部分的软件编程。
关键词:单片机最小系统,LED数码管,霍尔传感器,EEPROM存储器
Abstract
With the continuous improvement of living standards, not just an ordinary bicycle transportation, travel tools, but rather become entertainment, leisure, exercise of choice. Bike mileage / speed meter to meet the most basic needs of people, so that people can clearly know the current speed, mileage, and other physical quantities. This article describes the speed and odometer designed to smallest single-chip system as the core and the Hall sensor. Different speed sensor pulse signal into different frequency input to the MCU control and calculation, and then using LED display module, so that the speed and mileage data electric bike can visually displayed to the user.
The system consists of a Hall sensor, microcontroller AT89C52, systematic LED display module, data storage and keyboard control circuit components. Which contains the Hall sensor signal amplification and waveform shaping. Treatment measured signal amplification purpose is to reduce the requirement to treat the measured amplitude of the signal; waveform conversion and waveform shaping circuit for converting the amplified signal into a TTL signal can be connected with the microcontroller; through the MCU internal timer allows setting of T1 pulse input pin T0 is controlled so precisely calculated number of pulses applied to the inner pin T0 unit time detected; the design speed LED display module, the conversion rate by the number of miles come through the use of I2C bus E2PROM to store, saving the required microcontroller port lines and peripheral devices, and also simplifies software programming display portion.
Keywords: smallest single-chip system, LED digital tube, Hall sensors, EEPROM memory
目 录