CN202615556U - Street lamp carrier wave monitoring alarm system - Google Patents

Street lamp carrier wave monitoring alarm system Download PDF

Info

Publication number
CN202615556U
CN202615556U CN2012200554530U CN201220055453U CN202615556U CN 202615556 U CN202615556 U CN 202615556U CN 2012200554530 U CN2012200554530 U CN 2012200554530U CN 201220055453 U CN201220055453 U CN 201220055453U CN 202615556 U CN202615556 U CN 202615556U
Authority
CN
China
Prior art keywords
uart0
uart1
carrier wave
sendbuffer
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN2012200554530U
Other languages
Chinese (zh)
Inventor
朱红宁
刁纯生
薛占伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LIAONING ZHIFANG TECHNOLOGY CO LTD
Original Assignee
LIAONING ZHIFANG TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LIAONING ZHIFANG TECHNOLOGY CO LTD filed Critical LIAONING ZHIFANG TECHNOLOGY CO LTD
Priority to CN2012200554530U priority Critical patent/CN202615556U/en
Application granted granted Critical
Publication of CN202615556U publication Critical patent/CN202615556U/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/72Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps in street lighting

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The utility model relates to a street lamp carrier wave monitoring alarm system, by which the on-off states and fault records of all lamps during the current and past period of history can be checked as long as a computer can access an internet. The street lamp carrier wave monitoring alarm system comprises a communication control mainboard, a carrier wave communication module, a power supply module, a voltage transformer, a current transformer, an integration operation circuit, a relay driver and an output module, and is characterized in that a communication base station is composed of the communication control mainboard, the carrier wave communication module, the power supply module, the voltage transformer, the current transformer, the integration operation circuit, the relay driver and the output module, an upper-layer network employs GPRS wireless communication, and a lower-layer network employs power line carrier wave communication; the monitoring on the lamps is realized by adding carrier wave main stations and carrier wave controllers at each node, a C8051F340 one-chip microcomputer is used as a core module of the system, is connected with a carrier wave module via a 232 interface, and is connected with a GPRS module via a 485 interface. The street lamp carrier wave monitoring alarm system of the utility model is suitable for the managements and uses of various lamps.

Description

Street lamp carrier wave monitoring and alarming system
Technical field
The utility model relates to switch control field, exactly is a kind of street lamp carrier wave monitoring and alarming system.
Background technology
At present domestic city road lamp switch control mode mainly adopt manually, clock control and three kinds of main modes of photocontrol
A, manual control mode: be the most original basic control mode, through manual control switch's light fixture.Be applicable to the light fixture controls in zone on a small scale such as business unit, if the light fixture enormous amount, the infield disperses, and the effector bears heavily, and very difficulty operates.
B, clock control mode: can control lamp switch through pre-set timetable, to schedule the section configuration switch time.But if revise switching time, need all timing controllers are all revised setting, dumb, parameter is set to waste time and energy.The accident of can not meeting an urgent need.Influenced seriously by operator's individual factor.
C, light-operated switch lamp mode: gather the intensity of illumination signal through photoelectric sensor, powered-down switch when ambient light illumination is high starts power switch when ambient light illumination is low.Compare manual control, can alleviate certain operator's labor capacity.Shortcoming is to start to stop to control to depend on illumination, and control mode is single, and the accident of can not meeting an urgent need can not be controlled evening lamp, is too dependent on illumination.Light-operated in addition equipment is prone to affected by environment, and failure rate is high.
2. traditional control mode is dumb
Management is closely bound up with the number of devices of being managed, and quantity is few, and management is easy, quantity growth, and the degree of difficulty of management also increases.When a large amount of light fixtures needs to carry out every day switch control; The mode of lamp switch becomes extremely important, manual, clock control, and light-operated shortcoming has separately all limited the flexible operating to lamp switch; Manually the control labor intensive is many; Respond untimelyly, clock control need preestablish the startup stand-by time, and it is loaded down with trivial details, inconvenient to revise setting-up time.Photocontrol can only be controlled by illuminance, can not single at times control.In sum, three kinds of modes operate all dumb.
3. the light fixture maintenance maintenance is difficult, and cable can not monitoring anti-theft
The startup that the control mode that the order first three is traditional all can only be carried out each branch road stops control; The ability that does not all have monitoring circuit fault, light fixture whether to damage; The master switch of their simple operation circuits is realized the purpose of switch lamp; Can not carry out information acquisition to the working condition of circuit, not possess surveillance coverage, can only just can handle and maintenance maintenance through reporting after the special inspection of patrolman the maintenance of light fixture equipment.
Landscape Lamp, street lamp distributed areas are wide, and the power circuit complicacy is tediously long, and the artificial directly on-the-spot supervision of a lot of zone passages is difficult to realize, again because non-ferrous metal is expensive in recent years, and some lawless person is possessed with a lust for gain, the cable phenomenon that is stolen happens occasionally.Some offender steals light fixture, even charged theft cable, often has human casualty accident to take place; What is more causes cable short circuit to burn; Not only need change the whole piece cable again, and can endanger the upper level supply network, bring hidden danger for the supply network normal power supply.So the monitoring of strengthening service cable and light fixture is necessary.Breaking down in time reports, and maintenance maintenance has cable stolen, finds rapidly and reports to the police, and lets thief hang back, and so just can improve the deterrent force to thief.
Summary of the invention
The purpose of the utility model provides a kind of street lamp carrier wave monitoring and alarming system.It comprises the Communication Control mainboard, carrier communication module, power module, voltage transformer (VT); Current transformer, integral operation circuit, relay drive and the output module, it is characterized in that: by the Communication Control mainboard; The carrier communication module, power module, voltage transformer (VT); Current transformer, integral operation circuit, relay drive and the output module is formed communication base station; Upper layer network adopts the GPRS wireless telecommunications, and lower floor adopts electric line carrier communication, and the carrier controller that increases carrier wave main website and each node is realized the monitoring to light fixture; The C8051F340 single-chip microcomputer is as the nucleus module of system, and single-chip microcomputer connects carrier module through 232 interfaces, and single-chip microcomputer connects the GPRS module through 485 interfaces.
The electric current of communication base station is with this road current signal sampling through current transformer CT; LM324 handles through the amplifier amplifier, and analog quantity is inputed to single-chip microcomputer IA pin, in like manner collects other two-way current signal and inserts single-chip microcomputer IB, IC mouth respectively; Drive pilot relay along separate routes through ULN2003 Darlington chip for driving; With this road voltage signal sampling, LM324 handles through the amplifier amplifier through voltage transformer pt, and analog quantity is inputed to single-chip microcomputer U pin.Be equipped with and force output toggle switch SWDIP-4 at the pilot relay place along separate routes.LED3 is housed as the communication state pilot lamp in the system.
The utility model has the advantages that: 1. monitor mode easily: managerial personnel need not monitor in special Control Room; As long as your computer can be surfed the Net; Promptly can check on off state and failure loggings current and all light fixtures of past phase of history in period, can check the state of each each light fixture of block more intuitively through forms such as Google Maps through linking this monitoring network address.2. time interval control flexibly: can be unit sets needs switch in the week time period with the week through upper computer software; Can set the opening time section according to longitude and latitude, the sun time of rising and falling at scene, can carry out time control at times according to managerial personnel's requirement.3 simple accident processing modes:, can come enforced opening to turn-off light fixture through keeper's identity Website login and perhaps come enforced opening and turn-off light fixture with the mode of SMS like accident.4. fast fault alarm function: can notify supvr and relevant law enforcement agency through the mode of SMS during like significant troubles such as cable outages, accomplish to fix a breakdown as early as possible and responding rapidly.5 easy maintenances: Landscape Lamp, street lamp maintainer do not need regularly to make an inspection tour to the scene; Both can monitor the working condition of field apparatus through network; Find lamp failure, can directly carry out the maintain and replace activity according to place of indicating on the network and base stations detected numbering to light fixture in the base station (20 ~ 50); Scope is little, is convenient to find the trouble spot.6 easy site operation flow processs: to the zone of the end of brightening; If increasing umbilical cable, large tracts of land certainly will to destroy original greening; Landscape belt green plants majority is domestic well-known plant at present; Involve great expense, it is big to destroy these plant costs, and cable laying also needs the installing and laying expense of great number.GPRS, carrier wave comprehensive intelligent supervisory system; Upper layer network adopts the GPRS wireless telecommunications; Lower floor adopts electric line carrier communication; Can not destroy accomplishing supply network, the transformation of constructing under the situation about not rerouting, the carrier controller that only needs to increase carrier wave main website and each node can be realized the monitoring to light fixture.
Description of drawings
Fig. 1 is the system architecture block diagram of the utility model;
Fig. 2 is the base stations detected schematic diagram
Fig. 3 is a carrier wave main website schematic diagram
Fig. 4 is the design of communication base station geocoding and the single-chip microcomputer output interface circuit of the utility model;
Fig. 5 is the communication base station current acquisition circuit of the utility model;
Fig. 6 is output of communication base station relay and driving circuit;
Fig. 7 is a communication base station voltage signal acquisition circuit;
Fig. 8 is communication main website single-chip microcomputer and interface circuit;
Fig. 9 is the RS232 of a communication main website interface circuit;
Figure 10 is the RS485 of a communication main website interface circuit.
Embodiment
The utility model is by the Communication Control mainboard, carrier communication module, power module; Voltage transformer (VT), current transformer, integral operation circuit; Relay drives and the output module is formed communication base station, and upper layer network adopts the GPRS wireless telecommunications, and lower floor adopts electric line carrier communication; The carrier controller that increases carrier wave main website and each node is realized the monitoring to light fixture; The C8051F340 single-chip microcomputer is as the nucleus module of system, and single-chip microcomputer connects carrier module through 232 interfaces, and single-chip microcomputer connects the GPRS module through 485 interfaces.When street lamp breaks down, after base stations detected detects the base station current anomaly, with abnormal current data process carrier wave main website; The GPRS interface; Upload to the data server at management and control center, server is according to these data, failure judgement state, fault street lamp position; Then, send state information and abort situation on preset phone number.The electric current of communication base station is with this road current signal sampling through current transformer CT; LM324 handles through the amplifier amplifier, and analog quantity is inputed to single-chip microcomputer IA pin, in like manner collects other two-way current signal and inserts single-chip microcomputer IB, IC mouth respectively; Drive pilot relay along separate routes through ULN2003 Darlington chip for driving; With this road voltage signal sampling, LM324 handles through the amplifier amplifier through voltage transformer pt, and analog quantity is inputed to single-chip microcomputer U pin.Be equipped with and force output toggle switch SWDIP-4 at the pilot relay place along separate routes.Single-chip microcomputer connects LED3 as the communication state pilot lamp through resistance R 6 in the warning system.
Software is constructed as follows in the utility model:
Server program
Major function: the lamp switch steering logic is analyzed, a road lighting lantern duty indication is (normal; Lamp decreases reports to the police; The serious warning; Communicating interrupt, power supply trouble--a plurality of base stations of-same branch road are communicating interrupt simultaneously), the analysis of light fixture ignition mode, the setting of fault alarm rank, the realization of GSM short message interface, historgraphic data recording, fault inquiry mode analyze
The operation screen program
Major function: light fixture, the inquiry of historical data are turn-offed in unlatching, the light fixture duty is checked intuitively, the alarm telephone number is provided with, the setting of lamp switch pattern
Communication main website program
Major function: will be on the spot each communication base station data upload to internet, each bid section power supply control contactor of start and stop, receive each communication base station and prop up the road lighting lantern status data, start to the communication base station issue and cease and desist order
#include <C8051F340.h> // SFR declarations
#include <stdio.h>
#include <string.h>
************************************************************************************/
#define POLL_INTERVAL 0x1d // time slot polling interval time
#define PLC_NODE_COUNT 60 // master station quantity
#define POLL_COUNT_EVERYTIME 9 // main website quantity
code char SlaveNode[] = {18,10,12,13,14,0,16,31,15};
// satellite station numbering, no chromaffin body point, write 0
/************************************************************************************/
#define SYSCLK 48000000 // SYSCLK frequency in Hz
#define BAUDRATE0 9600 // 485 is connected to carrier wave
#define BAUDRATE1 9600 // 232 is connected to the GPRS module
// notice that minimum 2 of CKCON is set to 01 by UART0_Init, i.e. 4 frequency divisions,
// but baud rate when changing, this position can change, and should note
#define TIMER0_RELOAD_HIGH 0x40
#define TIMER0_RELOAD_LOW 0
#define UART1_Send(UART1_SendLen_Temp) do{\
UART1_SendLen = UART1_SendLen_Temp;\
UART1_SendPtr = 0;\
SCON1 |= 0x02;\
}while(0)
#define UART0_Send(UART0_SendLen_Temp) do{\
TR = 1;\
UART0_SendLen = UART0_SendLen_Temp;\
UART0_SendPtr = 0;\
TI0 = 1;\
}while(0)
code char acMSRHi[] = {
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40
};
code char acMSRLo[] = {
0x00,0xC0,0xC1,0x01, 0xC3,0x03,0x02,0xC2, 0xC6,0x06,0x07,0xC7, 0x05,0xC5,0xC4,0x04,
0xCC,0x0C,0x0D,0xCD, 0x0F,0xCF,0xCE,0x0E, 0x0A,0xCA,0xCB,0x0B, 0xC9,0x09,0x08,0xC8,
0xD8,0x18,0x19,0xD9, 0x1B,0xDB,0xDA,0x1A, 0x1E,0xDE,0xDF,0x1F, 0xDD,0x1D,0x1C,0xDC,
0x14,0xD4,0xD5,0x15, 0xD7,0x17,0x16,0xD6, 0xD2,0x12,0x13,0xD3, 0x11,0xD1,0xD0,0x10,
0xF0,0x30,0x31,0xF1, 0x33,0xF3,0xF2,0x32, 0x36,0xF6,0xF7,0x37, 0xF5,0x35,0x34,0xF4,
0x3C,0xFC,0xFD,0x3D, 0xFF,0x3F,0x3E,0xFE, 0xFA,0x3A,0x3B,0xFB, 0x39,0xF9,0xF8,0x38,
0x28,0xE8,0xE9,0x29, 0xEB,0x2B,0x2A,0xEA, 0xEE,0x2E,0x2F,0xEF, 0x2D,0xED,0xEC,0x2C,
0xE4,0x24,0x25,0xE5, 0x27,0xE7,0xE6,0x26, 0x22,0xE2,0xE3,0x23, 0xE1,0x21,0x20,0xE0,
0xA0,0x60,0x61,0xA1, 0x63,0xA3,0xA2,0x62, 0x66,0xA6,0xA7,0x67, 0xA5,0x65,0x64,0xA4,
0x6C,0xAC,0xAD,0x6D, 0xAF,0x6F,0x6E,0xAE, 0xAA,0x6A,0x6B,0xAB, 0x69,0xA9,0xA8,0x68,
0x78,0xB8,0xB9,0x79, 0xBB,0x7B,0x7A,0xBA, 0xBE,0x7E,0x7F,0xBF, 0x7D,0xBD,0xBC,0x7C,
0xB4,0x74,0x75,0xB5, 0x77,0xB7,0xB6,0x76, 0x72,0xB2,0xB3,0x73, 0xB1,0x71,0x70,0xB0,
0x50,0x90,0x91,0x51, 0x93,0x53,0x52,0x92, 0x96,0x56,0x57,0x97, 0x55,0x95,0x94,0x54,
0x9C,0x5C,0x5D,0x9D, 0x5F,0x9F,0x9E,0x5E, 0x5A,0x9A,0x9B,0x5B, 0x99,0x59,0x58,0x98,
0x88,0x48,0x49,0x89, 0x4B,0x8B,0x8A,0x4A, 0x4E,0x8E,0x8F,0x4F, 0x8D,0x4D,0x4C,0x8C,
0x44,0x84,0x85,0x45, 0x87,0x47,0x46,0x86, 0x82,0x42,0x43,0x83, 0x41,0x81,0x80,0x40
};
sfr16 SBRL1 = 0xB4;
sbit DQ = P1^2;
sbit LED = P0^7;
sbit RELAY0 = P1^0; // LED = 1 means ON
sbit RELAY1 = P1^1;
sbit TR = P0^6;
sbit DI1 = P2^0;
sbit DI2 = P2^1;
sbit DI3 = P2^2;
sbit DI4 = P2^3;
Unsigned char ValTemp; // add the variable that even parity check is used, must be internal RAM
void SYSTEMCLOCK_Init (void);
void PORT_Init (void);
void UART0_Init (void);
void UART1_Init (void);
void Delay (void);
void Timer0_Init(void);
void InitVari();
void PCA_Init();
void UART0_RcvProcess();
void PLC_RCV_PROCESS();
void GPRS_RCV_PROCESS();
void OSCILLATOR_Init();
#define UART0_Buffer_Size 200
#define UART0_SendBuffer_Size 20
xdata unsigned char UART0_RcvBuffer[UART0_Buffer_Size+10];
xdata unsigned char UART0_RcvPtr;
xdata unsigned char UART0_RcvLen;
xdata unsigned char UART0_RcvTimeOut;
xdata unsigned char UART0_RcvStatus;
xdata unsigned char UART0_SendBuffer[UART0_SendBuffer_Size+10];
xdata unsigned char UART0_SendLen;
xdata unsigned char UART0_SendPtr;
#define UART1_Buffer_Size 20
#define UART1_SendBuffer_Size 200
xdata unsigned char UART1_RcvBuffer[UART1_Buffer_Size+10];
xdata unsigned char UART1_RcvLen;
xdata unsigned char UART1_RcvPtr;
xdata unsigned char UART1_RcvTimeOut;
xdata unsigned char UART1_RcvStatus;
xdata unsigned char UART1_SendBuffer[UART1_SendBuffer_Size+10];
xdata unsigned char UART1_SendLen;
xdata unsigned char UART1_SendPtr;
Xdata unsigned int PLC_Node_Data [PLC_NODE_COUNT+1] [4]; // 4 tunnel analog quantitys
Xdata unsigned char PLC_Node_State [PLC_NODE_COUNT+1]; // communication expired times
xdata unsigned char Current_PollNode;
unsigned char Relay0State,Relay1State;
Unsigned char OutState; // output state 1 is for starting, and 0 for closing
unsigned char AlarmSendPtr;
xdata unsigned int Timer_Count_100ms;
xdata int PollTimeOver;
Xdata char Poll_Type; // be 1 o'clock inquiry end points, be 0 o'clock poll ordinary node, 2 o'clock inquiry chromaffin body points
Xdata unsigned char SlaveNodeNum; // chromaffin body the point that inquire about
Xdata unsigned char TempSendBuf [5]; // fault arranged
Xdata unsigned char TempSendTimes; // transmission number of times
Xdata unsigned char TempSendTimer; // interval time, 10 seconds
Xdata unsigned char OutStateChangedToOn; // state has changed, and when having lamp bright, is bright lamp with all base station lamp state exchanges
xdata unsigned char OutStateChangedToOff;
Xdata unsigned char MainNodeErrorCount; // main website does not have the communication counting
Xdata char SkipCheckError; // skip communicating interrupt to detect, go to inquire about main website
unsigned CRC16(char *pcMess,unsigned wLen)
{unsigned char cHi,cLo;
unsigned int w; // CRC Shift In Index
cHi = cLo = 0xFF; // Init CRC
while (wLen--) { // For Each Byte
w = cHi ^*pcMess++; // Next Table Index
cHi = cLo ^acMSRHi[w]; // Next CRC
cLo = acMSRLo[w];}
return (cHi << 8) | cLo;/>/ Return Composite}
void main (void) {unsigned int CRC_Temp;
unsigned int i;
unsigned int j;
xdata unsigned char TempMax,ADDMax;
unsigned char TempRSTSource;
PCA0MD &= ~0x40; // Disable Watchdog timer
TempRSTSource = RSTSRC;
SYSTEMCLOCK_Init (); // initialize oscillator
// if electrification reset, then relay breaks off, if other reason resets, then keeps original state
if((TempRSTSource&1)==1)
{Relay0State = 0; Relay1State = 0; OutState = 0; }
else
{ }
PORT_Init (); // initialize crossbar and GPIO
InitVari();
Timer0_Init();
UART0_Init (); // initialize UART0
UART1_Init (); // initialize UART1
for(j=0;j<10;j++)
{ for(i=0;i<30000;i++) PCA0CPH4 = 0x00;LED = ~LED;}
PCA_Init();
EA = 1;
TR = 0;
while (1)
{ PCA0CPH4 = 0x00;
//PollTimeOver the stand-by period, do not send out a subcommand and all will wait for, after wait finishes, carry out instruction newly
if(PollTimeOver ≤ 0) {
// judge whether the data of confiscating are arranged in the main end points
//Especial_Node_ADD = 0;
TempMax = 0;
ADDMax = 0;
if(SkipCheckError==0)
{
for(i=1;i≤PLC_NODE_COUNT;i++)
{
if(i≤POLL_COUNT_EVERYTIME)
{
if(PLC_Node_State[i] != 0) MainNodeErrorCount++;
}
if((TempMax<PLC_Node_State[i])&&(PLC_Node_State[i] != 0xFF))
{
TempMax = PLC_Node_State[i];
ADDMax = i;
}
}
}
else SkipCheckError = 0;
if(SlaveNodeNum != 0)
{
UART0_SendBuffer[0] = SlaveNodeNum;
UART0_SendBuffer[1] = SlaveNodeNum;
Poll_Type = 1;
}
An else if (ADDMax!=0) // explained that base station data does not postback
{
UART0_SendBuffer[0] = ADDMax;
UART0_SendBuffer[1] = ADDMax;
Poll_Type = 1;
}
Else if (Poll_Type==1) // 1 inquires about main end points
{
UART0_SendBuffer[0] = 1;
UART0_SendBuffer[1] = POLL_COUNT_EVERYTIME;
Poll_Type = 0;
}
else
{
Poll_Type = 1;
UART0_SendBuffer[0] = Current_PollNode;
UART0_SendBuffer[1] = Current_PollNode+POLL_COUNT_EVERYTIME-1;
if(UART0_SendBuffer[1]>PLC_NODE_COUNT) UART0_SendBuffer[1] = PLC_NODE_COUNT;
Current_PollNode += POLL_COUNT_EVERYTIME;
if(Current_PollNode >PLC_NODE_COUNT) Current_PollNode = POLL_COUNT_EVERYTIME+1;
}
// inquire about once, just the node of being looked into, communication state adds 1
for(i=UART0_SendBuffer[0];i≤UART0_SendBuffer[1];i++)
{
if(PLC_Node_State[i] < 3) PLC_Node_State[i]++;
// interrupted a little
if(PLC_Node_State[i] == 3)
{
PLC_Node_State[i] = 0xff;
SkipCheckError = 1;
Poll_Type = 1;
// if main node
if(i ≤ POLL_COUNT_EVERYTIME)
{ // its chromaffin body point is also disconnected, then inquires about its chromaffin body point, if there is not chromaffin body point directly to report an error
if((PLC_Node_State[SlaveNode[i-1]]!=0xff)&&(SlaveNode[i-1] !=0)) SlaveNodeNum = SlaveNode[i-1];
Else // as resolute, direct hair line road fault
{
UART1_SendBuffer [0]=0xad; // line fault
UART1_SendBuffer[1] = i;
UART1_SendBuffer[2] = 0;
CRC_Temp = CRC16(UART1_SendBuffer,3);
UART1_SendBuffer[3] = CRC_Temp>>8;
UART1_SendBuffer[4] = CRC_Temp&0x00ff;
UART1_Send(5);
TempSendBuf [0]=0xad; // line fault
TempSendBuf[1] = i;
TempSendBuf[2] = 0;
TempSendBuf[3] = UART1_SendBuffer[3];
TempSendBuf[4] = UART1_SendBuffer[4];
TempSendTimer = 0;
TempSendTimes = 2;
}
}
// chromaffin body point is disconnected
else
{
for(j=0;j<POLL_COUNT_EVERYTIME;j++)
{
If (SlaveNode [j]==i) // what break is one of chromaffin body point
{
// his host node such as resolute
SlaveNodeNum = 0;
if(PLC_Node_State[j+1] == 0xff)
{
UART1_SendBuffer [0]=0xad; // line fault
UART1_SendBuffer[1] = j+1;
UART1_SendBuffer[2] = 0;
CRC_Temp = CRC16(UART1_SendBuffer,3);
UART1_SendBuffer[3] = CRC_Temp>>8;
UART1_SendBuffer[4] = CRC_Temp&0x00ff;
UART1_Send(5);
TempSendBuf[0] = 0xad;
TempSendBuf[1] = j+1;
TempSendBuf[2] = 0;
TempSendBuf[3] = UART1_SendBuffer[3];
TempSendBuf[4] = UART1_SendBuffer[4];
TempSendTimer = 0;
TempSendTimes = 2;
}
}
}
}
if((TempSendTimes == 0)||(TempSendBuf[0] != 0xad))
{
UART1_SendBuffer[0] = 0xaa;
UART1_SendBuffer[1] = i;
UART1_SendBuffer[2] = 0;
CRC_Temp = CRC16(UART1_SendBuffer,3);
UART1_SendBuffer[3] = CRC_Temp>>8;
UART1_SendBuffer[4] = CRC_Temp&0x00ff;
UART1_Send(5);
TempSendBuf [0]=0xaa; // fault arranged
TempSendBuf[1] = i;
TempSendBuf[2] = 0;
TempSendBuf[3] = UART1_SendBuffer[3];
TempSendBuf[4] = UART1_SendBuffer[4];
TempSendTimer = 0;
TempSendTimes = 2;
}
}
}
UART0_SendBuffer[2] = POLL_INTERVAL;
// on the most significant digit of the 3rd byte, adding output state, 0 expression does not also receive the data of computing machine
if(OutState != 0)
{
If (OutState==1) UART0_SendBuffer [2] |=0xC0; // start
If (OutState==2) UART0_SendBuffer [2] |=0x80; // stop
}
CRC_Temp = CRC16(UART0_SendBuffer,3);
UART0_SendBuffer[3] = CRC_Temp>>8;
UART0_SendBuffer[4] = CRC_Temp&0x00ff;
UART0_Send (5); // querying command
PollTimeOver = 15+(UART0_SendBuffer[1]-UART0_SendBuffer[0]+1)*POLL_INTERVAL; ////////////////////////////////////////
}
The processing that // reception slave station is replied
if(UART0_RcvStatus == 2) PLC_RCV_PROCESS();
if(UART1_RcvStatus == 2) GPRS_RCV_PROCESS();
// refresh relay to export
RELAY0 = Relay0State;
RELAY1 = Relay1State;
}
}
void InitVari()
{
unsigned char i;
Current_PollNode = 1;
for(i=1;i≤PLC_NODE_COUNT;i++)
{
PLC_Node_State[i] = 0;
}
UART0_RcvTimeOut = 0;
UART0_RcvStatus = 0;
UART0_RcvLen = 0;
UART0_RcvPtr = 0;
UART1_RcvTimeOut = 0;
UART1_RcvStatus = 0;
UART1_RcvLen = 0;
UART1_RcvPtr = 0;
Current_PollNode = POLL_COUNT_EVERYTIME+1;
PollTimeOver = 0;
Poll_Type = 1;
TempSendTimer = 0;
TempSendTimes = 0;
OutStateChangedToOn =0;
OutStateChangedToOff = 0;
SlaveNodeNum = 0;
SkipCheckError= 0;
}
void PLC_RCV_PROCESS()
{
xdata unsigned int CRC_Temp;
xdata unsigned char Addr_Temp;
unsigned char i;
if(UART0_RcvLen == 11)
{
CRC_Temp = CRC16(UART0_RcvBuffer,UART0_RcvLen-2);
if((UART0_RcvBuffer[UART0_RcvLen-2] ==(CRC_Temp>>8))&&(UART0_RcvBuffer[UART0_RcvLen-1] ==(CRC_Temp&0x00ff)))
{
The slave station data that // preservation receives
// note, be the difference of CD and E here, most significant digit need shield
Addr_Temp = UART0_RcvBuffer[0] & 0x7f;
PLC_Node_Data[Addr_Temp][0] = UART0_RcvBuffer[1]<<8 |UART0_RcvBuffer[2];
PLC_Node_Data[Addr_Temp][1] = UART0_RcvBuffer[3]<<8 |UART0_RcvBuffer[4];
PLC_Node_Data[Addr_Temp][2] = UART0_RcvBuffer[5]<<8 |UART0_RcvBuffer[6];
PLC_Node_Data[Addr_Temp][3] = UART0_RcvBuffer[7]<<8 |UART0_RcvBuffer[8];
If // receive orders, by closing out, and received a circuit-switched data greater than 300, think that then lamp lights
if(OutStateChangedToOn > 0)
{
if((PLC_Node_Data[Addr_Temp][0] > 300)||
(PLC_Node_Data[Addr_Temp][1] > 300)||
(PLC_Node_Data[Addr_Temp][2] > 300))
{
if(OutStateChangedToOn == 10)
{
UART1_SendBuffer[0] = 0xac;
UART1_SendBuffer[1] = 1;
UART1_SendBuffer[2] = 0;
CRC_Temp = CRC16(UART1_SendBuffer,3);
UART1_SendBuffer[3] = CRC_Temp>>8;
UART1_SendBuffer[4] = CRC_Temp&0x00ff;
UART1_Send(5);
TempSendBuf [0]=0xac; // lamp state changes
TempSendBuf[1] = 1;
TempSendBuf[2] = 0;
TempSendBuf[3] = UART1_SendBuffer[3];
TempSendBuf[4] = UART1_SendBuffer[4];
TempSendTimer = 0;
TempSendTimes = 2;
}
for(i=1;i≤PLC_NODE_COUNT;i++)
{
PLC_Node_Data [i] [3]=0xffab; //ffab represents interim lighting lamp state
}
OutStateChangedToOn--;
}
}
if(OutStateChangedToOff > 0)
{
if((PLC_Node_Data[Addr_Temp][0] < 300)&&
(PLC_Node_Data[Addr_Temp][1] < 300)&&
(PLC_Node_Data[Addr_Temp][2] < 300))
{
if(OutStateChangedToOff == 10)
{
UART1_SendBuffer [0]=0xac; // line fault
UART1_SendBuffer[1] =0;
UART1_SendBuffer[2] = 0;
CRC_Temp = CRC16(UART1_SendBuffer,3);
UART1_SendBuffer[3] = CRC_Temp>>8;
UART1_SendBuffer[4] = CRC_Temp&0x00ff;
UART1_Send(5);
TempSendBuf [0]=0xac; // lamp state changes
TempSendBuf[1] = 0;
TempSendBuf[2] = 0;
TempSendBuf[3] = UART1_SendBuffer[3];
TempSendBuf[4] = UART1_SendBuffer[4];
TempSendTimer = 0;
TempSendTimes = 2;
}
for(i=1;i≤PLC_NODE_COUNT;i++)
{
PLC_Node_Data [i] [3]=0xffac; //ffab represents interim lighting lamp state
}
OutStateChangedToOff--;
}
}
if((PLC_Node_State[Addr_Temp] == 0xff)&&(TempSendTimes ==0))
{
UART1_SendBuffer[0] = 0xab;
UART1_SendBuffer[1] = Addr_Temp;
UART1_SendBuffer[2] = 0;
CRC_Temp = CRC16(UART1_SendBuffer,3);
UART1_SendBuffer[3] = CRC_Temp>>8;
UART1_SendBuffer[4] = CRC_Temp&0x00ff;
UART1_Send(5);
}
if(Addr_Temp == SlaveNodeNum) SlaveNodeNum = 0;
PLC_Node_State[Addr_Temp] = 0;
}
}
UART0_RcvStatus = 0;
UART0_RcvPtr = 0;
UART0_RcvLen = 0;
}
void GPRS_RCV_PROCESS()
{
xdata unsigned int CRC_Temp;
xdata unsigned char i,ptr;
// order length is 5
if(UART1_RcvLen == 5)
{
CRC_Temp = CRC16(UART1_RcvBuffer,UART1_RcvLen-2);
if((UART1_RcvBuffer[UART1_RcvLen-2] ==(CRC_Temp>>8))&&(UART1_RcvBuffer[UART1_RcvLen-1] ==(CRC_Temp&0x00ff)))
{
// reading of data
if(UART1_RcvBuffer[0] == 3)
{
ptr = 0;
UART1_SendBuffer[ptr++] = UART1_RcvBuffer[1];
UART1_SendBuffer[ptr++] = UART1_RcvBuffer[2];
UART1_SendBuffer[ptr++] = Relay0State | (Relay1State <<1) | (OutState<<4);
for(i=UART1_RcvBuffer[1];i≤UART1_RcvBuffer[2];i++)
{
// if this is a communicating interrupt, then is changed to 0XFF to voltage, 0xAA
if(PLC_Node_State[i] == 0xff)
{
UART1_SendBuffer[ptr++] = 0;
UART1_SendBuffer[ptr++] = 0;
UART1_SendBuffer[ptr++] = 0;
UART1_SendBuffer[ptr++] = 0;
UART1_SendBuffer[ptr++] = 0;
UART1_SendBuffer[ptr++] = 0;
UART1_SendBuffer[ptr++] = 0xff;
UART1_SendBuffer[ptr++] = 0xaa;
}
If else // this node communication is normal, then upload data
{
UART1_SendBuffer[ptr++] = PLC_Node_Data[i][0]>>8;
UART1_SendBuffer[ptr++] = PLC_Node_Data[i][0] & 0xff;
UART1_SendBuffer[ptr++] = PLC_Node_Data[i][1]>>8;
UART1_SendBuffer[ptr++] = PLC_Node_Data[i][1] & 0xff;
UART1_SendBuffer[ptr++] = PLC_Node_Data[i][2]>>8;
UART1_SendBuffer[ptr++] = PLC_Node_Data[i][2] & 0xff;
UART1_SendBuffer[ptr++] = PLC_Node_Data[i][3]>>8;
UART1_SendBuffer[ptr++] = PLC_Node_Data[i][3] & 0xff;
}
}
CRC_Temp = CRC16(UART1_SendBuffer,ptr);
UART1_SendBuffer[ptr++] = CRC_Temp >>8;
UART1_SendBuffer[ptr++] = CRC_Temp & 0xff;
UART1_Send(ptr);
}
Relay, output control simultaneously during else if (UART1_RcvBuffer [0]==4) // 4 order
{
Relay0State = UART1_RcvBuffer[1] & 0x01;
Relay1State = (UART1_RcvBuffer[1] & 0x10)>>4;
if((OutState !=1)&&(UART1_RcvBuffer[2] ==1)) OutStateChangedToOn = 10;
if((OutState ==1)&&(UART1_RcvBuffer[2] !=1)) OutStateChangedToOff = 10;
OutState = UART1_RcvBuffer[2];
ptr = 0;
UART1_SendBuffer[ptr++] = UART1_RcvBuffer[0];
UART1_SendBuffer[ptr++] = 0;
UART1_SendBuffer[ptr++] = Relay0State | (Relay1State <<1) | (OutState<<4);
CRC_Temp = CRC16(UART1_SendBuffer,ptr);
UART1_SendBuffer[ptr++] = CRC_Temp >>8;
UART1_SendBuffer[ptr++] = CRC_Temp & 0xff;
UART1_Send(ptr);
}
}
}
UART1_RcvStatus = 0;
UART1_RcvPtr = 0;
UART1_RcvLen = 0;
}
void PCA_Init()
{
PCA0CN = 0x40; // PCA counter enable
PCA0MD &= ~0x40 ; // Watchdog timer disabled-clearing bit 6
PCA0MD &= 0xF1; // timebase selected - System clock / 12
PCA0CPL4 = 0xFF; // Offset value
PCA0MD &= ~0x40; // WDTE = 0 (clear watchdog timer enable)
PCA0L = 0x00; // Set lower byte of PCA counter to 0
PCA0H = 0x00; // Set higher byte of PCA counter to 0
PCA0CPL4 = 0xFF; // Write offset for the WDT
PCA0MD |= 0x40; // Enable the WDT
}
void SYSTEMCLOCK_Init (void)
{
OSCICN |= 0x03; // Configure internal oscillator for
// its maximum frequency and enable
// missing clock detector
CLKMUL = 0x00; // Select internal oscillator as
// input to clock multiplier
CLKMUL |= 0x80; // Enable clock multiplier
Delay(); // Delay for clock multiplier to begin
CLKMUL |= 0xC0; // Initialize the clock multiplier
Delay(); // Delay for clock multiplier to begin
while(!(CLKMUL & 0x20)); // Wait for multiplier to lock
CLKSEL = 0x03; // Select system clock
}
void Timer0_Init(void)
{
TH0 = TIMER0_RELOAD_HIGH; // Init Timer0 High register
TL0 = TIMER0_RELOAD_LOW ; // Init Timer0 Low register
TMOD &= 0xf0;
TMOD |= 0x01; // Timer0 in 16-bit mode
CKCON |= 0x04; // Timer0 uses a 1:48 prescaler
// notice that minimum 2 of CKCON is set to 01 by UART0_Init, i.e. 4 frequency divisions,
// but baud rate when changing, this position can change, and should note
ET0 = 1; // Timer0 interrupt enabled
TCON |= 0x10; // Timer0 ON
}
void PORT_Init (void)
{
XBR0 = 0x01; // route UART 0 to crossbar
XBR2 = 0x01; // route UART 1 to crossbar
XBR1 = 0x40; // enable crossbar
RELAY0 = 0;
RELAY1 = 0;
P0MDOUT |= 0xD1; // set P0.4 to push-pull output
P1MDOUT = 0x03;
P2MDOUT |= 0x00; //
}
void UART0_Init (void)
{
SCON0 = 0x90; // SCON0: 9-bit variable bit rate
if (SYSCLK/BAUDRATE0/2/256 < 1) {
TH1 = -(SYSCLK/BAUDRATE0/2);
CKCON &= ~0x0B; // T1M = 1; SCA1:0 = xx
CKCON |= 0x08;
} else if (SYSCLK/BAUDRATE0/2/256 < 4) {
TH1 = -(SYSCLK/BAUDRATE0/2/4);
CKCON &= ~0x0B; // T1M = 0; SCA1:0 = 01
CKCON |= 0x09;
} else if (SYSCLK/BAUDRATE0/2/256 < 12) {
TH1 = -(SYSCLK/BAUDRATE0/2/12);
CKCON &= ~0x0B; // T1M = 0; SCA1:0 = 00
} else {
TH1 = -(SYSCLK/BAUDRATE0/2/48);
CKCON &= ~0x0B; // T1M = 0; SCA1:0 = 10
CKCON |= 0x02;
}
TL1 = TH1; // init Timer1
TMOD &= ~0xf0; // TMOD: timer 1 in 8-bit autoreload
TMOD |= 0x20;
TR1 = 1; // START Timer1
ES0 = 1;
}
void UART1_Init (void)
{
SMOD1 = 0x0C;
SCON1 = 0x10; // SCON1: 8-bit variable bit rate
if (SYSCLK/BAUDRATE1/2/0xFFFF < 1) {
SBRL1 = -(SYSCLK/BAUDRATE1/2);
SBCON1 |= 0x03; // set prescaler to 1
} else if (SYSCLK/BAUDRATE1/2/0xFFFF < 4) {
SBRL1 = -(SYSCLK/BAUDRATE1/2/4);
SBCON1 &= ~0x03;
SBCON1 |= 0x01; // set prescaler to 4
} else if (SYSCLK/BAUDRATE1/2/0xFFFF < 12) {
SBRL1 = -(SYSCLK/BAUDRATE1/2/12);
SBCON1 &= ~0x03; // set prescaler to 12
} else {
SBRL1 = -(SYSCLK/BAUDRATE1/2/48);
SBCON1 &= ~0x03;
SBCON1 |= 0x02; // set prescaler to 4
}
EIE2 |=2; // allow to interrupt
// SCON1 |= 0x02; // indicate ready for TX
SBCON1 |= 0x40; // enable baud rate generator
}
void Timer0_ISR (void) interrupt 1
{
TH0 = TIMER0_RELOAD_HIGH; // Reinit Timer0 High register
TL0 = TIMER0_RELOAD_LOW;
// 100ms time-delay is used for counting
Timer_Count_100ms++;
if(Timer_Count_100ms>=100)
{
Timer_Count_100ms = 0;
if(PollTimeOver >0) PollTimeOver--;
// when interim order is arranged, sent once in 10 seconds
if(TempSendTimes > 0)
{
if(TempSendTimer<100) TempSendTimer++;
else
{
TempSendTimer = 0;
TempSendTimes --;
UART1_SendBuffer[0] = TempSendBuf[0];
UART1_SendBuffer[1] = TempSendBuf[1];
UART1_SendBuffer[2] = TempSendBuf[2];
UART1_SendBuffer[3] = TempSendBuf[3];
UART1_SendBuffer[4] = TempSendBuf[4];
UART1_Send(5);
}
}
}
if(UART0_RcvStatus == 1) UART0_RcvTimeOut++;
if(UART0_RcvTimeOut>=10)
{
UART0_RcvTimeOut = 0;
UART0_RcvStatus=2; // expression has Data Receiving to arrive
UART0_RcvLen = UART0_RcvPtr;
}
if(UART1_RcvStatus == 1) UART1_RcvTimeOut++;
if(UART1_RcvTimeOut>=10)
{
UART1_RcvTimeOut = 0;
UART1_RcvStatus=2; // expression has Data Receiving to arrive
UART1_RcvLen = UART1_RcvPtr;
}
}
void UART0_Interrupt (void) interrupt 4
{
unsigned char Byte,SByte;
if (RI0 == 1)
{
RI0 = 0;
UART0_RcvStatus = 1;
UART0_RcvTimeOut = 0;
Byte = SBUF0;
if (UART0_RcvPtr < UART0_Buffer_Size)
{
UART0_RcvBuffer[UART0_RcvPtr] = Byte; // Store in array
UART0_RcvPtr++; // Update array's size
}
}
if (TI0 == 1) // Check if transmit flag is set
{
TI0 = 0; // Clear interrupt flag
// Clear interrupt flag
if(UART0_SendPtr < UART0_SendLen )
{
// be in order to add even parity check here
SByte = UART0_SendBuffer[UART0_SendPtr];
ValTemp = 0;
SByte +=ValTemp;
TB80 = P ;
SBUF0 = SByte;
UART0_SendPtr++;
}
else
{
TR = 0;
return;
}
}
}
void UART1_Interrupt (void) interrupt 16
{
unsigned char Byte,Byte1;
if (SCON1 & 0x01)
{
SCON1 &= ~0x01; // Clear interrupt flag
UART1_RcvStatus = 1;
UART1_RcvTimeOut = 0;
Byte = SBUF1; // Read a character from UART
Byte1 = SBUF1;
Byte1 = SBUF1;
if (UART1_RcvPtr < UART1_Buffer_Size)
{
UART1_RcvBuffer[UART1_RcvPtr] = Byte; // Store in array
UART1_RcvPtr++; // Update array's size
}
}
if(SCON1 & 0x02) // Check if transmit flag is set
{
SCON1 &= ~0x02; // Clear interrupt flag
if(UART1_SendPtr < UART1_SendLen )
{
SBUF1 = UART1_SendBuffer[UART1_SendPtr];
UART1_SendPtr++;
}
else return;
}
if((SCON1 & 0x80)!=0) SCON1 &=~0x80;
SCON1 &=~0x01;
}
void Delay(void)
{
int x;
for(x = 0;x < 500;x)
x++;
}
The communication base station program
Control each road lighting lantern open and close, gather each branch current magnitude of voltage, with each branch road data upload to the communication main website
#include <c8051f410.h> // SFR declarations
#include <stdio.h>
#include <math.h>
#define ZPoint 2387
typedef unsigned long ULONG;
typedef unsigned int UINT;
typedef unsigned char UCHAR;
typedef UINT FLADDR;
//-----------------------------------------------------------------------------
// 16-bit SFR Definitions for 'F41x
//-----------------------------------------------------------------------------
typedef union LONG {
unsigned long l;
unsigned char byte[4];
} LONG;
#define RTC0CN 0x06 // RTC address of RTC0CN register
#define RTC0XCN 0x07 // RTC address of RTC0XCN register
sfr16 TMR2RL = 0xca; // Timer2 reload value
sfr16 TMR2 = 0xcc; // Timer2 counter
sfr16 ADC0 = 0xbd; // ADC0 result
#define NO_COMM_TURNON_TIMER 60 //in second
//-----------------------------------------------------------------------------
// Global CONSTANTS
//-----------------------------------------------------------------------------
#define SYSCLK 24500000 // SYSCLK frequency in Hz
#define BAUDRATE 9600 // Baud rate of UART in bps
#define UART0_Send(UART0_SendLen_Temp) do{\
TR485 = 1;\
UART0_SendLen = UART0_SendLen_Temp;\
UART0_SendPtr = 0;\
TI0 = 1;\
}while(0)
sbit TR485 =P0^3;
sbit RELAY1 =P0^0;
sbit RELAY2 =P0^1;
sbit RELAY3 =P0^2;
sbit LED =P0^7;
Xdata unsigned char current_ch; // one has 4 road AD, circulating sampling
xdata unsigned char current_ptr; //
xdata unsigned char SampleStartCounter;
xdata unsigned char tempstart;
xdata unsigned char temptestuart;
xdata unsigned char tempa;
xdata unsigned char needprint;
xdata int sampbuf[32];
xdata unsigned int SampleData[5][5];
xdata unsigned char SamplePtr[5];
xdata unsigned char TempFlashReadBuf[20];
xdata unsigned char TempFlashWriteBuf[20];
xdata unsigned char TempSampleBuf[10];
#define UART0_Buffer_Size 20
#define UART0_SendBuffer_Size 20
xdata unsigned char UART0_RcvBuffer[UART0_Buffer_Size];
xdata unsigned char UART0_RcvPtr;
xdata unsigned char UART0_RcvLen;
xdata unsigned char UART0_RcvTimeOut;
xdata unsigned char UART0_RcvStatus;
xdata unsigned char UART0_SendBuffer[UART0_SendBuffer_Size];
xdata unsigned char UART0_SendLen;
xdata unsigned char UART0_SendPtr;
xdata unsigned char LastLen;
xdata unsigned char LastChar;
xdata unsigned char InitState;
xdata int ReplyTimer;
xdata unsigned char ReplyNeeded;
xdata unsigned char NeedSend;
//xdata LONG CurrentTime;
unsigned int Timer_Count;
unsigned int NoCommTimer;
Unsigned int StartTimer, StopTimer; // to be divided into unit
unsigned char MyAddr;
xdata unsigned int flashledtimer;
unsigned char ValTemp;
unsigned char NeedReset;
//OutState_CMD is the order output state, from main frame
//OutState_TIME is overtime output state
// these two variablees be or relation, have a condition to set up, then start
xdata unsigned char OutState_CMD,OutState_TIME;
xdata unsigned char OutputState;
//-----------------------------------------------------------------------------
// Function PROTOTYPES
//-----------------------------------------------------------------------------
void SYSCLK_Init (void);
void PORT_Init (void);
void Timer2_Init(void);
void ADC0_Init(void);
void UART0_Init (void);
void Timer0_Init(void);
void UART0_RcvProcess();
void InitVari();
void Output(unsigned char OutState);
void PCA_Init();
void FLASH_Write (FLADDR dest, char *src, unsigned int numbytes);
char * FLASH_Read (char *dest, FLADDR src, unsigned int numbytes);
void FLASH_ByteWrite (FLADDR addr, char byte);
unsigned char FLASH_ByteRead (FLADDR addr);
void FLASH_PageErase (FLADDR addr);
LONG RTC_Read_s(void);
void RTC_Set(LONG s_counts);
LONG RTC_DateToSecs (RTCfull);
code char acMSRHi[] = {
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40, 0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41,
0x00,0xC1,0x81,0x40, 0x01,0xC0,0x80,0x41, 0x01,0xC0,0x80,0x41, 0x00,0xC1,0x81,0x40
};
code char acMSRLo[] = {
0x00,0xC0,0xC1,0x01, 0xC3,0x03,0x02,0xC2, 0xC6,0x06,0x07,0xC7, 0x05,0xC5,0xC4,0x04,
0xCC,0x0C,0x0D,0xCD, 0x0F,0xCF,0xCE,0x0E, 0x0A,0xCA,0xCB,0x0B, 0xC9,0x09,0x08,0xC8,
0xD8,0x18,0x19,0xD9, 0x1B,0xDB,0xDA,0x1A, 0x1E,0xDE,0xDF,0x1F, 0xDD,0x1D,0x1C,0xDC,
0x14,0xD4,0xD5,0x15, 0xD7,0x17,0x16,0xD6, 0xD2,0x12,0x13,0xD3, 0x11,0xD1,0xD0,0x10,
0xF0,0x30,0x31,0xF1, 0x33,0xF3,0xF2,0x32, 0x36,0xF6,0xF7,0x37, 0xF5,0x35,0x34,0xF4,
0x3C,0xFC,0xFD,0x3D, 0xFF,0x3F,0x3E,0xFE, 0xFA,0x3A,0x3B,0xFB, 0x39,0xF9,0xF8,0x38,
0x28,0xE8,0xE9,0x29, 0xEB,0x2B,0x2A,0xEA, 0xEE,0x2E,0x2F,0xEF, 0x2D,0xED,0xEC,0x2C,
0xE4,0x24,0x25,0xE5, 0x27,0xE7,0xE6,0x26, 0x22,0xE2,0xE3,0x23, 0xE1,0x21,0x20,0xE0,
0xA0,0x60,0x61,0xA1, 0x63,0xA3,0xA2,0x62, 0x66,0xA6,0xA7,0x67, 0xA5,0x65,0x64,0xA4,
0x6C,0xAC,0xAD,0x6D, 0xAF,0x6F,0x6E,0xAE, 0xAA,0x6A,0x6B,0xAB, 0x69,0xA9,0xA8,0x68,
0x78,0xB8,0xB9,0x79, 0xBB,0x7B,0x7A,0xBA, 0xBE,0x7E,0x7F,0xBF, 0x7D,0xBD,0xBC,0x7C,
0xB4,0x74,0x75,0xB5, 0x77,0xB7,0xB6,0x76, 0x72,0xB2,0xB3,0x73, 0xB1,0x71,0x70,0xB0,
0x50,0x90,0x91,0x51, 0x93,0x53,0x52,0x92, 0x96,0x56,0x57,0x97, 0x55,0x95,0x94,0x54,
0x9C,0x5C,0x5D,0x9D, 0x5F,0x9F,0x9E,0x5E, 0x5A,0x9A,0x9B,0x5B, 0x99,0x59,0x58,0x98,
0x88,0x48,0x49,0x89, 0x4B,0x8B,0x8A,0x4A, 0x4E,0x8E,0x8F,0x4F, 0x8D,0x4D,0x4C,0x8C,
0x44,0x84,0x85,0x45, 0x87,0x47,0x46,0x86, 0x82,0x42,0x43,0x83, 0x41,0x81,0x80,0x40
};
int code SINV[32]={
0, 5853, 11481, 16667, 21213, 24944, 27716, 29423,
30000, 29423, 27716, 24944, 21213, 16667, 11481, 5853,
0, -5853, -11481, -16667, -21213, -24944, -27716, -29423,
-30000,-29423, -27716, -24944, -21213, -16667, -11481, -5853
};
int code COSV[32]={
30000, 29423, 27716, 24944, 21213, 16667, 11481, 5853,
0, -5853, -11481, -16667, -21213, -24944, -27716, -29423,
-30000,-29423, -27716, -24944, -21213, -16667, -11481, -5853,
0, 5853, 11481, 16667, 21213, 24944, 27716, 29423
};
void Output(unsigned char OutState)
{
RELAY1 = OutState;
RELAY2 = OutState;
RELAY3 = OutState;
}
unsigned char GetAddr()
{
unsigned char TempByte,TempByte1,TempByte2;
P1 |= 0xfb;
TempByte = P1;
if((TempByte & 0x80) == 0 ) TempByte1 = 0;
else TempByte1 = 0x04;
TempByte2 = (TempByte & 0xFB)|TempByte1;
return (~TempByte2)&0x7f;
}
unsigned CRC16(char *pcMess,unsigned wLen)
{
unsigned char cHi,cLo;
unsigned int w; // CRC Shift In Index
cHi = cLo = 0xFF; // Init CRC
while (wLen--) { // For Each Byte
w = cHi ^*pcMess++; // Next Table Index
cHi = cLo ^acMSRHi[w]; // Next CRC
cLo = acMSRLo[w];
}
return (cHi << 8) | cLo; />/ Return Composite
}
void SendBack()
{
// this is trunking application, one of them byte, and the expression coomand mode is chosen one the tunnel emptyly, writes OutState_CMD
unsigned int CRC_Temp;
MyAddr = GetAddr();
// add to start here and cease and desist order
if(OutState_CMD == 1) UART0_SendBuffer[0] = MyAddr |0x80;
else UART0_SendBuffer[0] = MyAddr ;
UART0_SendBuffer[1] = TempSampleBuf[4];
UART0_SendBuffer[2] = TempSampleBuf[5];
UART0_SendBuffer[3] = TempSampleBuf[6];
UART0_SendBuffer[4] = TempSampleBuf[7];
UART0_SendBuffer[5] = TempSampleBuf[2];
UART0_SendBuffer[6] = TempSampleBuf[3];
UART0_SendBuffer[7] = TempSampleBuf[8];
UART0_SendBuffer[8] = TempSampleBuf[9];
CRC_Temp = CRC16(UART0_SendBuffer,9);
UART0_SendBuffer[9] = CRC_Temp>>8;
UART0_SendBuffer[10]= CRC_Temp&0x00ff;
UART0_Send(11);
}
Unsigned long dig_sqrt (int * result, int n) // the try to achieve effective value of one group of alternating current discrete sampling point--one-period
{
unsigned long xdata sum;
long xdata anlog_cos,anlog_sin;
unsigned char xdata i;
// unsigned int xdata j;
anlog_cos=0;
anlog_sin=0;
for(i=0;i<n;i++)
{
// if(RcvStatus == 1) return -1;
Anlog_cos+=(long) (result [i]) * COSV [i]; // square value
Anlog_sin+=(long) (result [i]) * SINV [i]; // square value
}
// if(RcvStatus == 1) return -1;
anlog_cos>>=14;
// if(RcvStatus == 1) return -1;
anlog_sin>>=14;
// if(RcvStatus == 1) return -1;
sum=anlog_cos*anlog_cos;
// if(RcvStatus == 1) return -1;
sum+=anlog_sin*anlog_sin;
// if(RcvStatus == 1) return -1;
return sqrt(sum);
}
//-----------------------------------------------------------------------------
// MAIN Routine
//-----------------------------------------------------------------------------
void UART0_RcvProcess()
{
if(((UART0_RcvBuffer[2] & 0x80)!=0)&&(UART0_RcvLen == 5))
{
NoCommTimer = 0;
OutState_TIME = 0;
if((UART0_RcvBuffer[2] & 0x40)!=0) OutState_CMD = 1;
else OutState_CMD = 0;
}
if(UART0_RcvLen == 11)
{
if((UART0_RcvBuffer[0] & 0x80)!=0)
{
OutState_CMD = 1;
}
else
{
OutState_CMD = 0;
NoCommTimer = 0;
OutState_TIME = 0;
}
}
MyAddr = GetAddr();
if((UART0_RcvBuffer[0]≤MyAddr)&&(UART0_RcvBuffer[1]>=MyAddr))
{
UART0_RcvBuffer[2] &=0x3f;
ReplyTimer = (MyAddr - UART0_RcvBuffer[0]) * UART0_RcvBuffer[2] *100;
ReplyNeeded = 1;
}
}
void Flash_Led()
{
unsigned int j,i;
for(i = 0;i<300;i++) for(j = 0;j<100;j++)PCA0CPH5 = 0x00;
LED=1;
for(i = 0;i<300;i++) for(j = 0;j<100;j++)PCA0CPH5 = 0x00;
LED=0;
for(i = 0;i<300;i++) for(j = 0;j<100;j++)PCA0CPH5 = 0x00;
LED=1;
for(i = 0;i<300;i++) for(j = 0;j<100;j++)PCA0CPH5 = 0x00;
LED=0;
for(i = 0;i<300;i++) for(j = 0;j<100;j++)PCA0CPH5 = 0x00;
LED=1;
for(i = 0;i<300;i++) for(j = 0;j<100;j++)PCA0CPH5 = 0x00;
LED=0;
}
void main (void)
{
unsigned int CRC_Temp;
unsigned char TempRSTSource;
PCA0MD &= ~0x40;
TempRSTSource = RSTSRC;
SYSCLK_Init (); // Initialize system clock to
if((TempRSTSource&1)==1)
{
Output(0);
OutputState =0;
OutState_CMD = 0;
}
else
{
if(OutState_CMD!=0) Output(1);
else Output(0);
}
PORT_Init (); // Initialize crossbar and GPIO
Timer2_Init(); // Init Timer2 to generate
Timer0_Init();
current_ch = 0; // overflows to trigger ADC
current_ptr = 0;
InitState = 1;
SamplePtr[0] = 0;
SamplePtr[1] = 0;
SamplePtr[2] = 0;
SamplePtr[3] = 0;
SamplePtr[4] = 0;
UART0_Init(); // Initialize UART0 for printf's
ADC0_Init(); // Initialize ADC0
PCA_Init();
InitVari();
Flash_Led();
InitState = 0;
NeedReset = 0;
while (1)
{
if(NeedReset ==0) PCA0CPH5 = 0x00; //Feet Dog
if(UART0_RcvStatus == 2)
{
if((UART0_RcvLen == 5)||(UART0_RcvLen == 11))
{
CRC_Temp = CRC16(UART0_RcvBuffer,UART0_RcvLen-2);
if((UART0_RcvBuffer[UART0_RcvLen-2] == (CRC_Temp/256))&&
(UART0_RcvBuffer[UART0_RcvLen-1] == (CRC_Temp%256)))
{
if(OutputState == 0)
{
NoCommTimer = 0;
OutState_TIME = 0;
}
UART0_RcvProcess();
}
}
UART0_RcvStatus = 0;
UART0_RcvPtr = 0;
UART0_RcvLen = 0;
}
if((OutState_CMD!=0)||(OutState_TIME!=0))
{
OutputState = 1;
}
else
{
OutputState = 0;
}
Output(OutputState);
if(NeedSend == 1)
{
NeedSend = 0;
SendBack();
}
}
}
void InitVari()
{
NoCommTimer = 0;
UART0_RcvStatus = 0;
UART0_RcvTimeOut = 0;
TR485 = 0;
UART0_RcvLen = 0;
UART0_RcvPtr = 0;
ReplyNeeded = 0;
PS0 =1;
EA = 1;
OutState_TIME = 0;
//OutputState =0;
//OutState_CMD = 0;
ReplyTimer = 0;
ReplyNeeded = 0;
NeedSend = 0;
}
void SYSCLK_Init (void)
{
OSCICN |= 0x04; // Force Internal Osc. 1:8 prescaler
while ((OSCICN & 0x40 ) == 0); // Wait until stable
RSTSRC = 0x04; // enable missing clock detector
}
void PCA_Init()
{
PCA0CN = 0X40; // PCA COUNTER ENABLE
PCA0MD &= ~0X40 ; // WATCHDOG TIMER DISABLED-CLEARING BIT 6
PCA0MD &= 0XF1; // TIMEBASE SELECTED - SYSTEM CLOCK / 12
PCA0CPL5 = 0XFF; // OFFSET VALUE
PCA0MD &= ~0X40;
PCA0L = 0X00; // SET LOWER BYTE OF PCA COUNTER TO 0
PCA0H = 0X00; // SET HIGHER BYTE OF PCA COUNTER TO 0
PCA0CPL5 = 0XFF; // WRITE OFFSET FOR THE WDT
PCA0MD |= 0X40; // ENABLE THE WDT
}
void PORT_Init (void)
{
XBR0 = 0x01; // Enable UART0
// Enable crossbar and weak pull-ups
P0MDOUT |= 0x9F; // Set TX pin to push-pull
P1 =0xff;
P1MDIN=0xFB; //P12, if use inner, external voltage reference any one, this position can not be again as numeral
P1MDOUT |= 0x00;
P2MDOUT |= 0x00;
XBR1 |= 0x40;
}
void Timer2_Init (void)
{
CKCON &= ~0x60; // Timer2 uses SYSCLK/12
TMR2CN &= ~0x01;
// 1600 is SF
TMR2RL = -(SYSCLK/8/12/1600); // Reload value to be used in Timer2
TMR2 = TMR2RL; // Init the Timer2 register
TMR2CN = 0x04; // Enable Timer2 in auto-reload mode
//ET2 = 1;
}
void ADC0_Init (void)
{
ADC0CN = 0x03; // ADC0 disabled, normal tracking,
// conversion triggered on TMR2 overflow
REF0CN = 0x13; // Enable on-chip VREF = 2.2v and buffer
ADC0MX = 0x16; // Set P1.1 as positive input
ADC0CF = ((SYSCLK/3000000)-1)<<3; />/ set SAR clock to 3MHz
ADC0CF |= 0x00; // right-justify results
EIE1|=0x08; // allow ADC0 to interrupt
// EIP1|=0x08; // be high priority
AD0EN = 1; // enable ADC0
}
void Timer0_Init(void)
{
TH0 = 0x20; // Init Timer0 High register
TL0 = 0x20; // Init Timer0 Low register
TMOD &=0xF0;
TMOD |= 0x02; // Timer0 in 16-bit mode
ET0 = 1; // Timer0 interrupt enabled
TCON = 0x10; // Timer0 ON
}
void UART0_Init (void)
{
SCON0 = 0x90; // SCON0: 9-bit variable bit rate
CKCON = 0x08;
TH1 = 0x60;
TL1 = TH1; // init Timer1
TMOD &= ~0xf0; // TMOD: timer 1 in 8-bit autoreload
TMOD |= 0x20;
TR1 = 1; // START Timer1
//TI0 = 1; // Indicate TX0 ready
ES0 = 1;
}
void ADC0_ISR (void) interrupt 10
{
xdata unsigned long result=0;
xdata unsigned long youxiaozhi; // measured voltage in mV
int tempad;
unsigned char i,j,LessCount;
unsigned int tempint;
if(ReplyNeeded == 1)
{
if(ReplyTimer >0) ReplyTimer --;
else
{
ReplyNeeded = 0;
NeedSend = 1;
}
}
if(InitState == 0)
{
if(UART0_RcvStatus == 1) LED = 1;
else LED = 0;
}
Timer_Count++;
if(Timer_Count>=1600)
{
//LED = ~LED; // Toggle the LED
Timer_Count = 0;
// a period of time does not have communication, starts
if(NoCommTimer > NO_COMM_TURNON_TIMER) OutState_TIME = 1;
else NoCommTimer++;
}
AD0INT = 0;
tempad= ADC0;
if((tempstart==0)&&(tempad<ZPoint)) tempstart = 1;
if((tempstart==1)&&(tempad>ZPoint)) tempstart = 2;
if(tempstart == 2)
{
sampbuf[current_ptr] = tempad;
current_ptr ++;
}
else if(SampleStartCounter > 40)
{
current_ptr=32;
for(j=0;j<32;j++) sampbuf[j] = ZPoint;
}
SampleStartCounter++;
if(current_ptr>=32)
{
tempstart = 0;
SampleStartCounter = 0;
If // accepting serial data, then abandon result here
if(UART0_RcvStatus !=1) youxiaozhi = dig_sqrt(sampbuf,32);
else
{
//youxiaozhi=-1;
goto TempLine;
}
// effective value may be not enough greater than 65535, two bytes, so divided by 10
SampleData[current_ch][SamplePtr[0]] = youxiaozhi/10;
// sampling 5 times is got intermediate value after 5 times
SamplePtr[current_ch]++;
if(SamplePtr[current_ch]>=5)
{
SamplePtr[current_ch] = 0;
for(i=0;i<5;i++)
{
LessCount = 0;
tempint = SampleData[current_ch][i];
for(j=0;j<5;j++)
{
//tempint;
if(SampleData[current_ch][j]>tempint) LessCount++;
}
if(LessCount == 2) break;
}
TempSampleBuf[current_ch*2+0] = tempint/256;
TempSampleBuf[current_ch*2+1] = tempint%256;
if(tempint!=0) tempint=0;
}
current_ch++;
if(current_ch >=5)
{
current_ch = 0;
}
ADC0MX = 0x12+current_ch;
TempLine:
current_ptr = 0;
}
}
void UART0_Interrupt (void) interrupt 4
{
unsigned char Byte,SByte;
if (RI0 == 1)
{
RI0 = 0;
UART0_RcvStatus = 1;
UART0_RcvTimeOut = 0;
Byte = SBUF0;
if (UART0_RcvPtr < UART0_Buffer_Size)
{
UART0_RcvBuffer[UART0_RcvPtr] = Byte; // Store in array
UART0_RcvPtr++; // Update array's size
}
}
if(TI0 == 1) // Check if transmit flag is set
{
TI0 = 0; // Clear interrupt flag
// Clear interrupt flag
if(UART0_SendPtr < UART0_SendLen )
{
// be in order to add even parity check here
SByte = UART0_SendBuffer[UART0_SendPtr];
ValTemp = 0;
SByte +=ValTemp;
TB80 = P ;
SBUF0 = SByte;
UART0_SendPtr++;
}
else
{
TR485 = 0;
return;
}
}
}
void Timer0_ISR (void) interrupt 1
{
if(UART0_RcvStatus == 1) UART0_RcvTimeOut++;
if(UART0_RcvTimeOut>=10)
{
UART0_RcvTimeOut = 0;
UART0_RcvStatus=2; // expression has Data Receiving to arrive
UART0_RcvLen = UART0_RcvPtr;
}}。

Claims (5)

1. street lamp carrier wave monitoring and alarming system, it comprises the Communication Control mainboard, carrier communication module, power module; Voltage transformer (VT), current transformer, integral operation circuit, relay drive and the output module; It is characterized in that: by the Communication Control mainboard, carrier communication module, power module, voltage transformer (VT); Current transformer, integral operation circuit, relay drive and the output module is formed communication base station; Upper layer network adopts the GPRS wireless telecommunications, and lower floor adopts electric line carrier communication, and the carrier controller that increases carrier wave main website and each node is realized the monitoring to light fixture; The C8051F340 single-chip microcomputer is as the nucleus module of system, and single-chip microcomputer connects carrier module through 232 interfaces, and single-chip microcomputer connects the GPRS module through 485 interfaces.
2. street lamp carrier wave monitoring and alarming system according to claim 1; It is characterized in that: the electric current of communication base station is with this road current signal sampling through current transformer CT; LM324 handles through the amplifier amplifier, and analog quantity is inputed to single-chip microcomputer IA pin, in like manner collects other two-way current signal and inserts single-chip microcomputer IB, IC mouth respectively; Drive pilot relay along separate routes through chip for driving; With this road voltage signal sampling, LM324 handles through the amplifier amplifier through voltage transformer pt, and analog quantity is inputed to single-chip microcomputer U pin.
3. street lamp carrier wave monitoring and alarming system according to claim 1 is characterized in that: chip for driving ULN2003 is the Darlington chip, and be equipped with and force output toggle switch SWDIP-4 at the pilot relay place along separate routes.
4. street lamp carrier wave monitoring and alarming system according to claim 2 is characterized in that: be equipped with and force output toggle switch SWDIP-4 at the pilot relay place along separate routes.
5. street lamp carrier wave monitoring and alarming system according to claim 2 is characterized in that: single-chip microcomputer connects LED3 as the communication state pilot lamp through resistance R 6 in the warning system.
CN2012200554530U 2012-02-21 2012-02-21 Street lamp carrier wave monitoring alarm system Expired - Fee Related CN202615556U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012200554530U CN202615556U (en) 2012-02-21 2012-02-21 Street lamp carrier wave monitoring alarm system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012200554530U CN202615556U (en) 2012-02-21 2012-02-21 Street lamp carrier wave monitoring alarm system

Publications (1)

Publication Number Publication Date
CN202615556U true CN202615556U (en) 2012-12-19

Family

ID=47349234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012200554530U Expired - Fee Related CN202615556U (en) 2012-02-21 2012-02-21 Street lamp carrier wave monitoring alarm system

Country Status (1)

Country Link
CN (1) CN202615556U (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103687244A (en) * 2013-12-19 2014-03-26 柳州铁道职业技术学院 Smart home illumination centralized control host and wiring method thereof
CN105141343A (en) * 2015-07-24 2015-12-09 河北省电力建设调整试验所 Cable tunnel positioning and broadcasting system employing VLC-PLC technologies

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103687244A (en) * 2013-12-19 2014-03-26 柳州铁道职业技术学院 Smart home illumination centralized control host and wiring method thereof
CN105141343A (en) * 2015-07-24 2015-12-09 河北省电力建设调整试验所 Cable tunnel positioning and broadcasting system employing VLC-PLC technologies

Similar Documents

Publication Publication Date Title
Chen et al. A vision of IoT: Applications, challenges, and opportunities with china perspective
CN201845232U (en) Wireless sensor network monitoring system for grain conditions in grain depot
Mahbub et al. IoT-Cognizant cloud-assisted energy efficient embedded system for indoor intelligent lighting, air quality monitoring, and ventilation
CN102981484B (en) Greenhouse intelligent control system based on internet of things
CN202663440U (en) 3G wireless Internet of Things-based intelligent greenhouse information push system
CN103905558A (en) Dairy farm wireless monitoring system based on internet of things
Parbat et al. Data visualization tools for WSNs: a glimpse
CN102445933A (en) System for monitoring, alarming and managing farmland greenhouses based on Internet of things
CN202615556U (en) Street lamp carrier wave monitoring alarm system
CN103051682B (en) Method for wireless interaction of vehicle-mounted terminal
CN101141339A (en) Embedded SoC chip based wireless network industry monitoring management system
Georgieva et al. Design of wireless sensor network for monitoring of soil quality parameters
CN106453529A (en) Hen house Internet of Things sensor node data collecting, monitoring and controlling device based on WIFI
CN206894675U (en) A kind of NB IoT low speed things-internet gateways based on multifunctional streetlamp post
Kim et al. An overview on industrial Internet of Things
Noureddine et al. Field experiment testbed for forest fire detection using wireless multimedia sensor network
CN103906048A (en) Method and apparatus for securely transmitting data through Bluetooth technology
CN106210086A (en) A kind of Intelligent Data Collection System Terminal system calculated based on mist
CN214409640U (en) Bulk curing barn remote monitoring device based on low-time-delay Internet of things technology
Xue et al. A Drip Irrigation Remote Control System Using 5G-IoT Technology
CN201976125U (en) Distributed analyzing system for real-time monitoring data streams
CN202979031U (en) Vehicle terminal wireless interaction system
Hu et al. Design of wireless temperature monitoring and control system based on Zigbee technology in communication room
CN107610443A (en) A kind of information integrated system with wireless collection data function
Wu et al. Design of farmland information acquisition system based on LoRa wireless sensor network

Legal Events

Date Code Title Description
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121219

Termination date: 20130221