当前位置:网站首页>05 design of street lamp control fault detection system based on ZigBee
05 design of street lamp control fault detection system based on ZigBee
2022-07-19 02:01:00 【Steam steam】
1 The system realizes the function
- Real-time monitoring : Real time monitoring of ambient light , The light level of the street lamp and whether it is faulty .
- Manual control mode : You can control the five levels of brightness of the light according to your own wishes .
- Automatic control mode : When the ambient light is lower than 30% And when someone or a car passes , The brightness of the light can be automatically adjusted according to the environment of the street lamp , When the ambient light is higher than 30% And when someone or a car passes , Don't turn on the light .
- Fault detection : When the street lamp breaks down , Buzzer alarm reminder , And put the fault information of the street lamp in APP Last reminder .
- APP Remote monitoring : Through Bluetooth wireless communication technology and mobile phones APP signal communication , Realize remote information interaction on the mobile phone .
2 Hardware selection
Serial number | modular | model |
1 | ZigBee node *2 | CC2530 |
2 | Photoresistor sensor *2 | —— |
3 | The screen | OLED |
4 | street lamp | —— |
5 | Photosensitive sensors | Photosensitive resistor |
6 | Infrared sensor of human body | HC-SR501 |
7 | Bluetooth module | JDY-31 |
8 | DuPont line | A number of |
9 | ZigBee Downloader | SmartRF04EB Emulator |
3 Physical display

4 Part of the source code
/*********************************************************
* @fn APP()
* @brief Customize the polling function with curtain
* @param task - Loop task
* @return none
**********************************************************/
void APP(unsigned char task)// Poll the process with a curtain
{
#if defined(ZDO_COORDINATOR) // The coordinator
unsigned char i;
key_server();// Press the key to scan the process
ble_process();
display_info();// Display refresh function
if((flag_bad[0]==1)&&status_led[0])
{
if(cnt_beep>3000)
{
BEEP_ON;
cnt_beep=0;
}
else
{
if(cnt_beep>100)
{
BEEP_OFF;
}
}
}
else
{
BEEP_OFF;
}
#else
#endif
switch(task) // Task progress
{
case 0:// Serial port process
if(rx_update) // Serial command process , received \r\n Update order
{
rx_update=0; // Clear the update flag bit
rtc_usart_time_set(); // Serial port settings RTC Time function
usart_set_mode();
usart_set_switch();
usart_set_timing();
flash_erase(122);// eliminate FLASH
flash_temp[0]=mode;
flash_write(122,0,flash_temp,10);
wipe_buffer(rx_temp,50);// Clear the serial port cache data
rx_index=0; // Serial port cache pointer back 0
rx_flag=1; // The serial port allows you to receive
}
break;
case 1:
#if defined(ZDO_COORDINATOR) // The coordinator
if(timer1cnt>1000) // Timer process
{
if(mode==0){// In automatic mode
for(i=0;i<3;i++)
{
if(light[i]<30){
if(status_ir[i]==1){
if(light[i]<5)status_led[i]=5;
else {
if(light[i]<10)status_led[i]=4;
else{
if(light[i]<20)status_led[i]=3;
else{
if(light[i]<25)status_led[i]=2;
else status_led[i]=1;
}
}
}
}
else{
status_led[i]=0;
}
}else{
status_led[i]=0;
}
}
}
tx_temp[0]='1';
tx_temp[1]='2';
tx_temp[2]='3';
tx_temp[3]=status_led[0];// Dimming value
tx_temp[4]=status_led[1];
tx_temp[5]=status_led[2];
RF_Master2Point(tx_temp,10);
timer1cnt=0;
}
#else
if(timer1cnt>2000) // Timer process , Every time 3 Flip the display once every second
{
printf("run\r\n");
timer1cnt=0;
}
#endif
break;
case 2:
break;
default:
task=0;
break;
}
}边栏推荐
- [go language] detailed explanation of dynamic library and static library
- 【文献阅读】isl: An Integer Set Library for the Polyhedral Model
- 二階邊緣檢測 - Laplacian of Guassian 高斯拉普拉斯算子
- Mxnet network model of show me the code (III)
- C语言程序之编译,链接
- 性能强悍的图表组件库 ScottPlot
- Monitor browser return operation - prohibit returning to the previous page
- Owl Eyes: Spotting UI Display Issues via Visual Understanding
- L1,L2范数
- 频率派和贝叶斯派
猜你喜欢

IEEE754标准浮点数格式

06基于STM32的智能电子药盒设计
![[literature reading] counting integer points in parametric polymers using barvinok's rational functions](/img/a2/3e1b248c7cd853ffea7a835111db65.png)
[literature reading] counting integer points in parametric polymers using barvinok's rational functions

禁止自作聪明的Safari打开网页时自动播放

【文献阅读】TENET: A Framework for Modeling Tensor Dataflow Based on Relation-centric Notation

4章 性能平台GodEye源码分析-监控模块

MATLAB :Warning: the font “Times” is not available

GoogLeNet

iFair: Learning Individually Fair Data Representations for Algorithmic Decision Making

bais mintigation post-processing for individual and group fairness
随机推荐
apt-get update报错:Hash 校验和不符
CAN协议通信
Saber Pspice simulink电源仿真软件的区别
14:07:08 ckati failed with: signal: killed
Uncaught syntaxerror: unexpected token '< is reported on the blank page of the H5 uniapp package‘
二阶边缘检测 - Laplacian of Guassian 高斯拉普拉斯算子
关于1000BASE-T1 1000BASE-TX和100BASE-T1
Apt get update error: hash checksum does not match
Yolov5训练建议
Hands on deep learning -- linear neural network
防抖debounce和节流throttle的使用
Windbos download and install openssh
Mxnet network model of show me the code (III)
禁止自作聪明的Safari打开网页时自动播放
运算放大器基本原理与参数解读
指针常量与常量指针爱恨情仇
Monitor browser return operation - prohibit returning to the previous page
bag of visual words(BoVW)视觉词袋 个人理解
边缘检测方法 -- 一阶边缘检测
3章 性能平台GodEye源码分析-内存模块