设计说明书
总字数:14000+
摘要
在公共安全安检、工业生产异物检测、考古勘探等场景中,金属的准确识别与及时检测至关重要。若金属异物(如危险品、生产杂质)未被及时发现,可能引发公共安全事故、影响产品质量或破坏考古文物;而传统金属探测设备部分存在操作复杂、响应滞后等问题,难以适配快速检测需求。因此,研发一种操作简便、响应迅速、检测准确的金属探测器具有重要现实意义。
本设计提出一种基于 STM32F103C8T6 单片机的金属探测器。系统主要功能包括:通过金属监测模块实时检测当前环境是否存在金属;检测结果通过 OLED 液晶显示屏直观展示 —— 存在金属时显示 “金属:有”,无金属时显示 “金属:无”;当监测到金属时,系统触发声光报警装置,无金属时自动取消报警;用户通过按键 K1 启动金属监测功能,启动的同时继电器点亮,明确指示探测工作已开始。
该金属探测器的作用在于,为多场景金属检测提供便捷、可靠的工具。通过按键启动、直观显示与自动报警的协同设计,简化操作流程,提升检测效率,既能满足公共安检的快速筛查需求,也能适配工业生产的杂质检测与考古勘探的精准识别,为安全保障与工作质量提升提供支持。
关键词:STM32F103C8T6;金属探测器;金属监测;声光报警;OLED 显示
Design of Metal Detector Based on STM32
Abstract
Accurate identification and timely detection of metals are crucial in scenarios such as public safety checks, industrial foreign object detection, and archaeological exploration. If metal foreign objects (such as dangerous goods and production impurities) are not detected in a timely manner, they may cause public safety accidents, affect product quality, or damage archaeological relics; However, traditional metal detection equipment has problems such as complex operation and delayed response, making it difficult to adapt to rapid detection requirements. Therefore, developing a metal detector that is easy to operate, responds quickly, and detects accurately is of great practical significance.
This design proposes a metal detector based on STM32F103C8T6 microcontroller. The main functions of the system include: real-time detection of the presence of metals in the current environment through the metal monitoring module; The test results are visually displayed on an OLED LCD screen – displaying “Metal: Yes” when metal is present and “Metal: No” when metal is absent; When metal is detected, the system triggers the sound and light alarm device, and automatically cancels the alarm when there is no metal; The user activates the metal monitoring function by pressing button K1, and at the same time, the relay lights up, clearly indicating that the detection work has started.
The function of this metal detector is to provide a convenient and reliable tool for multi scene metal detection. Through the collaborative design of button activation, intuitive display, and automatic alarm, the operation process is simplified, and the detection efficiency is improved. It can not only meet the rapid screening needs of public security checks, but also adapt to the precise identification of impurities in industrial production and archaeological exploration, providing support for safety assurance and work quality improvement.
Keywords:STM32F103C8T6; metal detector; Metal monitoring; Sound and light alarm; OLED display
目 录
1 绪论
1.1 研究背景及意义
1.2 国内外研究现状
1.3 主要内容
2 系统总体方案设计
2.1系统总体设计
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 OLED显示流程设计
5 实物制作与功能测试
5.1 实物制作
5.2 按键启动与继电器联动功能测试
5.3 金属探测与显示功能测试
5.4 声光报警功能测试
6 总结
参考文献
致谢
附录A 原理图
附录B PCB
附录C 主程序