目录 

一、项目成品图片

二、项目功能简介

1.主要器件组成

2.功能详解介绍

三、项目原理图设计

四、项目PCB硬件设计

项目PCB图

五、项目程序设计

六、项目实验效果 ​编辑

七、项目包含内容

一、项目成品图片

哔哩哔哩视频链接:

https://www.bilibili.com/video/BV1Kd6CBKEv2/?spm_id_from=333.1387.upload.video_card.click

资料分享看文章末尾

 二、项目功能简介

1.主要器件组成

    本设计由STM32F103C8T6单片机+WIFI模块ESP8266-01S电路+OLED屏幕电路+超声波传感器电路+红外光电传感器电路+SG90舵机电路+DS1302时钟模块电路+LED电路+按键电路+电源电路组成。

2.功能详解

(1)车辆检测:实时检测停车场车库入口是否有车进入。
(2)自动闸机:当检测到停车场车库入口有车时自动开启闸机,闸机开启一段时间后自动关闭闸机
(3)车位剩余:停车场实时监测车位剩余数量。
(4)车位显示:实时显示车辆停车位置
(5)车位指示灯:当车辆在停车位停车后相应的指示灯亮起
(6)通过app预定车位
(7)计数停车费用
(8)通过超声波传感器检测车位是否停车
(9)通过WIFI连接手机APP,APP可以查看当前环境信息数据,可调节阈值范围

三、项目原理图设计

四、项目PCB硬件设计

五、项目程序设计

#include "stm32f10x.h"
#include "delay.h"
#include "usart.h"
#include "USART2/usart2.h"
#include "timer.h" 
#include "menu.h"
#include "key.h"
#include "modules.h"
#include "sg90.h"
#include "oled.h"
#include "DS1302/ds1302.h"
#include "led.h"
#include "hw.h"
#include "HCSR/hcsr.h"

/****************破晓电子工作室*******************
		              
***          破晓单片机											
***          项目:STM32智能停车场管理系统
***          BILIBILI:破晓单片机
***          小红书:破晓单片机
***          授权IP:破晓单片机
***          淘宝:破晓单片机 
***          淘宝:破晓电子 
***          版本:V01.01
***          MCU:STM32F103C8T6

******************破晓单片机***********************/

//显示界面
CaiDanJieGouTi  KeyTab[SIZE_CAIDAN]=
{
    {0 ,0 ,0 ,0 ,0 ,Main_Menu0}, 
	{1 ,1 ,1 ,1 ,1 ,Main_Menu1},  
	{2 ,2 ,2 ,2 ,2 ,Main_Menu2},  
	{3 ,3 ,3 ,3 ,3 ,Main_Menu3},   
	{4 ,4 ,4 ,4 ,4 ,Main_Menu4},
	{5 ,5 ,5 ,5 ,5 ,Main_Menu5},   
	{6 ,6 ,6 ,6 ,6 ,Main_Menu6},  
    {7 ,7 ,7 ,7 ,7 ,Main_Menu7},	 
	{8 ,8 ,8 ,8 ,8 ,Main_Menu8},   
 
} ;

//传感器变量声明
typedef struct
{
	uint16_t youche;//
	
	uint16_t distance1;//	
	uint16_t distance2;//	
	uint16_t distance3;//	
	uint16_t distance4;//
}SensorModulesValue;

typedef struct
{
 
	uint8_t shijian1;
	uint8_t shijian2;
	uint8_t shijian3;
	uint8_t shijian4;	
 
}SensorThresholdValue;

typedef struct
{
	uint8_t BEEPFlag;
	uint8_t RELAYFlag;	
	uint8_t MOTORFlag;
	uint8_t SG90Flag;
	uint8_t LEDFlag; 						
}DriveFlag;

int main(void)
 {
			delay_init();
			TIM3_Int_Init(9,7199);//定时器初始化
			OLEDGUI_Config(); 				//OLED 	
			OLEDGUI_DispString(30,16,"Init...",16,1);	  	 
	 		key_Init();//按键初始化
	 		HW_Init();//HW初始化
			beep_Init();//beep初始化
			InitClock();//DS1302初始化
			SG90_Init();//SG90初始化
			led_Init();//led初始化

			SensorThresholdSet();//阈值初始化
			uart1_init(9600);
			delay_ms(100);
			uart2_init(9600);
			delay_ms(100);	
			memset((uint8_t *)&currentDataPoint, 0, sizeof(dataPoint_t));	 
			gizwitsInit();
			OLEDGUI_Clear();				//OLED清屏
	while(1)
	{	
            //获取按键值     
			key_scan();		
            //进入菜单界面显示处理数据
			GetKeylnput(&Keystatus); 
            //获取传感器数据
			SensorDataGet();

            //数据上传	
			currentDataPoint.valuechewei=SensorData.chewei;
			currentDataPoint.valuechewei1=SensorData.chewei1;
			currentDataPoint.valuechewei2=SensorData.chewei2;
			currentDataPoint.valuechewei3=SensorData.chewei3;		
			currentDataPoint.valuechewei4=SensorData.chewei4;
			currentDataPoint.valueSG90Flag=DriveFlagData.SG90Flag;
			currentDataPoint.valueyouche=SensorData.youche;	
  
			gizwitsHandle((dataPoint_t *)&currentDataPoint);

            //数据下发
			SensorData.yuyue1=currentDataPoint.valueyuyue1;
			SensorData.yuyue2=currentDataPoint.valueyuyue2;
			SensorData.yuyue3=currentDataPoint.valueyuyue3;
			SensorData.yuyue4=currentDataPoint.valueyuyue4;
 
			delay_ms(100);	
 
	}	
 }

 




六、项目实验效果 ​

七、项目包含内容

Logo

免费领 150 小时云算力,进群参与显卡、AI PC 幸运抽奖

更多推荐