news 2026/6/24 0:56:14

【dz-955】基于单片机的出租车计价器设计

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【dz-955】基于单片机的出租车计价器设计

摘要

随着城市交通的不断发展,出租车作为便捷的公共交通工具,其计价的准确性与智能化水平日益受到关注。传统出租车计价器存在时间区分不精准、单价调整繁琐、数据存储易丢失等问题,依赖人工干预设置夜间加价,易引发计价纠纷,难以满足现代出行对透明化、自动化计费的需求。​

基于 STC89C52 单片机的出租车计价器设计,整合了 DS1302 时钟模块、MX1508 电机驱动模块、KY-003 霍尔检测模块、AT24C02 存储模块、按键、LCD1602 显示屏及声光报警装置等,实现了出租车计费的自动化与智能化。系统核心功能包括:通过 DS1302 获取实时时间,自动判断白天(6:00-22:00)与夜间(22:00 - 次日 6:00)时段,分别执行不同计价标准(白天起步价 5 元 / 3 公里,超出后 2.5 元 / 公里;夜间起步价 8 元 / 3 公里,超出后 3 元 / 公里);通过 KY-003 霍尔模块检测车轮转速换算里程,MX1508 驱动电机模拟行驶状态,速度超限时触发声光报警;借助 AT24C02 存储价格参数、总单量、总里程等数据,防止掉电丢失;支持通过按键查看日总单量、总里程、总金额并清除记录,同时可修改时间、设置速度最大值及调整价格参数;通过 LCD1602 实时显示时间、当前速度、累计里程、单价及总金额等信息。​

该系统的实现,有效提升了出租车计价的准确性与智能化水平,减少了人工干预导致的误差与纠纷,确保了计费透明化,为出租车运营管理提供了高效解决方案,同时为同类车载计费设备的研发提供了参考,具有较高的实际应用价值。​

关键词:STC89C52;出租车计价器;霍尔检测;智能计费;数据存储;时钟模块

ABSTRACT

With the continuous development of urban transportation, taxis, as convenient public transport tools, have increasingly drawn attention to the accuracy and intelligence of their metering. Traditional taxi meters have problems such as imprecise time differentiation, cumbersome unit price adjustment, and easy loss of data storage. They rely on manual intervention to set night surcharges, which can easily lead to metering disputes and are difficult to meet the needs of modern travel for transparent and automated billing.​

The taxi meter design based on the STC89C52 microcontroller integrates DS1302 clock module, MX1508 motor driver module, KY-003 Hall detection module, AT24C02 storage module, buttons, LCD1602 display, and sound and light alarm devices, realizing the automation and intelligence of taxi billing. The core functions of the system include: obtaining real-time time through DS1302, automatically distinguishing between daytime (6:00-22:00) and nighttime (22:00-next day 6:00) periods, and implementing different pricing standards respectively (daytime starting price is 5 yuan for 3 kilometers, 2.5 yuan per kilometer beyond that; nighttime starting price is 8 yuan for 3 kilometers, 3 yuan per kilometer beyond that); detecting wheel speed through KY-003 Hall module to convert mileage, driving the motor through MX1508 to simulate driving status, and triggering sound and light alarm when the speed exceeds the limit; storing price parameters, total orders, total mileage and other data with AT24C02 to prevent loss due to power failure; supporting viewing daily total orders, total mileage, total amount and clearing records through buttons, and modifying time, setting maximum speed and adjusting price parameters; displaying real-time time, current speed, accumulated mileage, unit price and total amount through LCD1602.​

The implementation of this system effectively improves the accuracy and intelligence level of taxi metering, reduces errors and disputes caused by manual intervention, ensures billing transparency, provides an efficient solution for taxi operation management, and also offers a reference for the research and development of similar on-board billing equipment, with high practical application value.​

Keywords:STC89C52; Taxi meter; Hall detection; Intelligent billing; Data storage; Clock module

目录

第 1 章 绪论

1.1 研究的目的及意义

1.2 国内外发展情况

1.3 本文主要研究内容

第2章 设计思路与方案论证

2.1 主要元器件选择

2.1.1 主控芯片选择

2.1.2 时钟模块选择

2.1.3 电机驱动与测速模块选择

2.1.4 存储模块选择

2.1.5 按键模块选择

2.1.6 显示模块选择

2.1.7 声光报警模块选择

2.2整体设计方案

第 3 章 硬件设计

3.1 主控电路模块

3.2 时钟模块电路

3.3 电机驱动与测速模块电路

3.4 存储模块电路

3.5 显示模块电路

3.6 按键模块电路

3.7 声光报警模块电路

第4章 系统程序设计

4.1 编程软件介绍

4.2 系统主流程设计

4.3 独立按键

4.4 LCD1602液晶显示子流程

4.5 速度检测子流程设计

4.6 直流电机速度调节子流程设计

第 5 章 实物测试

5.1 整体实物测试

5.2 时钟与计费功能测试

5.3 里程与速度检测功能测试

5.4 存储模块功能测试

5.5 显示模块功能测试

5.6 按键功能测试

5.7 声光报警功能测试

第 6 章 总结与展望

6.1 总结

6.2 展望

致谢

参考文献

附录

附录一:原理图

附录二:PCB

附录三:主程序

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/23 18:06:17

【dz-956】基于单片机的公交车系统

摘要 随着城市公共交通的快速发展,公交车作为市民出行的主要方式之一,其运营效率与服务质量备受关注。传统公交车系统在站点播报、信息展示等方面存在依赖人工操作、信息更新滞后、功能单一等问题,难以满足乘客对精准出行信息的需求&#xf…

作者头像 李华
网站建设 2026/6/23 18:12:04

SECS/GEM通信实战指南:Python实现半导体设备智能监控系统

在半导体制造车间中,你是否经常面临这样的困境:设备突然停机,却无法快速定位问题根源;生产数据分散在多个系统中,难以形成统一分析;设备状态监控依赖人工巡检,效率低下且容易遗漏?这…

作者头像 李华
网站建设 2026/6/23 15:12:54

Chrome测试版本128.0.6613.137:跨平台自动化测试的终极解决方案

Chrome测试版本128.0.6613.137:跨平台自动化测试的终极解决方案 【免费下载链接】chrome-for-testing 项目地址: https://gitcode.com/gh_mirrors/ch/chrome-for-testing 在当今快速发展的软件开发生态中,确保Chrome测试环境的跨平台兼容性已成为…

作者头像 李华
网站建设 2026/6/23 18:12:02

微信自动化助手:零成本Windows部署全攻略

微信自动化助手:零成本Windows部署全攻略 【免费下载链接】puppet-xp Wechaty Puppet WeChat Windows Protocol 项目地址: https://gitcode.com/gh_mirrors/pu/puppet-xp 在数字化办公时代,微信已成为不可或缺的沟通工具。然而,重复的…

作者头像 李华
网站建设 2026/6/23 17:19:22

PCB激光钻孔:CO₂激光VS紫外激光,谁更胜一筹?

【问】激光钻孔分哪几种类型?各自的适用场景是什么?【答】目前 PCB 行业常用的激光钻孔技术主要有两种:CO₂激光钻孔和紫外激光钻孔,两者的发光原理和加工特性差异很大。CO₂激光的波长是 10.6μm,属于远红外光&#x…

作者头像 李华