news 2026/4/18 8:52:13

【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/4/17 20:06:21

jQuery EasyUI 数据网格 - 合并单元格

下面直接给你最实用、最常见的合并单元格(merge cells)方法,jQuery EasyUI datagrid 官方没有内置合并,但通过 onLoadSuccess 事件超级容易实现,复制粘贴就能用,领导最爱的“同一客户订单合并显示 报表分组…

作者头像 李华
网站建设 2026/4/17 21:40:28

DailyNotes:终极免费笔记与任务管理解决方案

DailyNotes:终极免费笔记与任务管理解决方案 【免费下载链接】DailyNotes App for taking notes and tracking tasks on a daily basis 项目地址: https://gitcode.com/gh_mirrors/da/DailyNotes 你是否经常忘记重要任务?💡是否在寻找…

作者头像 李华
网站建设 2026/4/18 8:39:40

15分钟用多态打造可扩展的通知系统原型

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容: 快速开发一个支持多通道扩展的通知系统原型:1. 定义Notification接口含send(message);2. 实现EmailNotification、SMSNotification;3. 演示新增微…

作者头像 李华
网站建设 2026/4/16 15:25:16

从‘sageattention‘缺失看深度学习项目依赖管理实战

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容: 构建一个深度学习项目模板,当检测到sageattention缺失时自动执行以下流程:1)检查CUDA和PyTorch版本兼容性 2)搜索相似的attention实现方案 3)提供降级方案或…

作者头像 李华
网站建设 2026/4/18 8:28:04

标书查重,还在人眼核对?——这份“查重单机版”安全又精准

“标书编制耗时漫长,多人协作版本混乱,格式错误低级却致命,复制粘贴留下重复隐患……”这或许是每一位投标专员、项目经理深夜加班时的真实心境。在严苛的招标要求与极限的时间压力下,依赖人眼逐字比对的传统方法,已触…

作者头像 李华