223 [Completed Course Design] Design of Automobile Protection Device Based on 51 Single Chip Computer-HX711+ Infrared Obstacle Avoidance

[Resource Download] The download address is as follows:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl

51 car protection device design-HX711 + infrared obstacle avoidance-RELAY-RFID

This design consists of STC89C52 single-chip circuit + HX711 weighing module circuit + infrared obstacle avoidance sensor circuit + relay module circuit + RFID module circuit power supply circuit.

1. If the weight exceeds a certain value (the specific value is determined by Tongwang Technology itself) or the infrared obstacle avoidance sensor detects an obstacle, the relay will be disconnected. (The relay is closed by default)

2. The range of the load cell is 0-5kg, and the simulated weight is enough.

3. After the RFID module swipes the card (the set card), the relay 2 will be turned on (relay 2 will be turned off automatically after 5 seconds) otherwise, the relay 2 will not work.

#include<reg52.h> //包含头文件,一般情况不需要改动,头文件包含特殊功能寄存器的定义
#include<stdio.h>
#include <intrins.h>
#include "delay.h"
#include "rc522.h"
#include "hx711.h"

sbit relay1 =P1^3;  //引脚定义
sbit relay2 =P1^4; 
sbit hotm = P1^2;

/*********/
unsigned char code yxID[4]={0x04,0x97,0x80,0x63};	//有效卡号
/*********/
xdata long Weight_Shiwu=0;		  //实物重量
xdata unsigned long Weight_Maopi=0;	 //读取初始化值


unsigned char UID[5];  //读取到的卡号
unsigned char Temp[4] ; //定义中间变量数组  

unsigned long time_20ms;//定时器计数	     
bit readFlag;			//显示更新标志

unsigned char relayLater = 0;//继电器动作延时

void Init_Timer0(void);	  //函数声明
void uartSendStr(unsigned char *s,unsigned char length);
void UART_Init(void);
void uartSendByte(unsigned char dat);

 

Guess you like

Origin blog.csdn.net/theroadon/article/details/109232390