当前位置:网站首页>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;
}
}边栏推荐
- 判断两个数组是否完全相等
- Factory method mode notes
- 如何理解Volatile以及如何使用它
- Handling Conditional Discrimination(可解释歧视和确切的歧视)
- Neutralizing Self-Selection Bias in Sampling for Sortition
- Suivi du mode de méthode de l'usine
- [literature reading] vaqf: full automatic software hardware co design framework for low bit vision transformer
- The following packages have unmet dependencies: deepin.com.wechat:i386 : Depends: deepin-wine:i386
- 【文献阅读】Counting Integer Points in Parametric Polytopes Using Barvinok‘s Rational Functions
- Determine whether two arrays are exactly equal
猜你喜欢

C语言程序之编译,链接
![[translation] transformers in computer vision](/img/94/a6b8fdddca0e3042e1da7f945aeebe.png)
[translation] transformers in computer vision

apt-get update报错:Hash 校验和不符

Show Me the Code之MXNet网络模型(三)

A causal linear model to quantify edge unfairness for unfair edge prioritization

电解电容特性及应用要点

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

如何理解Volatile以及如何使用它

Owl Eyes: Spotting UI Display Issues via Visual Understanding

【文献阅读】Counting Integer Points in Parametric Polytopes Using Barvinok‘s Rational Functions
随机推荐
[go language] code coverage test (Gcov)
边缘检测方法 -- 一阶边缘检测
MXNet网络模型(五)条件GAN神经网络
Integrated learning
电解电容特性及应用要点
Fair Attribute Classification through Latent Space De-biasing
Hands on deep learning -- from full connection layer to convolution layer
The following packages have unmet dependencies: deepin. com. wechat:i386 : Depends: deepin-wine:i386
IEEE754标准浮点数格式
Hands on deep learning -- linear neural network
Can protocol communication
errno详解
GoogLeNet
【pycharm】Cannot find reference ‘XXX‘ in ‘__init__.py‘ 解决办法
One vs One Mitigation of Intersectional Bias
集成学习
动手学深度学习---从全连接层到卷积层篇
Leveraging Semi-Supervised Learning for Fairness using Neural Networks
ACE下载地址
【文献阅读】isl: An Integer Set Library for the Polyhedral Model