Computer Controlled Embedded Domestic Security System

Introduction

Security is a primary issue in a modern domestic and office environment. Today, almost every house is equipped with a Personal Computer. In this project, we propose a simple model for domestic security against burglary by implementing a simple embedded device which can be controlled and monitored from a PC.

The Embedded Sensor Node

The Embedded Sensor System

The above picture shows the Assembled Embedded sensor system. The four thin wires (two pairs of twisted wires) shown in the left side of the picture is the main sensor cables which will be connected through the gates/doors of the house. They will be connected in such a way that they will be grounded while the doors/gates will be in the closed state. The right side cable is the RS232 interface. The cable in the top (black) is the power cable which will be connected to the 230V mains supply of the house or any uninterrupted power supply.

The following picture is the close-up view of the same sensor system.

 

The Main Citcuit Board

The Sensor Data is Retrieved And Displayed at PC End

The Following screen output shows the sensor data gathered at PC end. The Baud Rate of PC com post was set to 2400 because the 8051 is communicating at that speed.

Monitoring Data from Embedded System

The Embedded Sensor Node Interfaced with the PC

In the following picture the sensor system is interfaced with a pc via serial port. The application specially designed for controlling and monitoring the embedded system is receiving data from the embedded system.

The Embedded System Interfaced with a PC

About the Proposed System

The proposed security system has been implemented using the simple 8051 Microcontroller and can function autonomously and independently without the computer. The system can be connected with the PC through serial port and can be controlled and monitored from the PC using the specially designed serial communication software. This security system will be embedded in a domestic environment to provide some simple security solutions like burglar alarms in different doors and windows. The Firm ware of the embedded system will be developed using a suitable compiler meant for 8051. The remaining part of the project is proposed to be implemented using Microsoft Visual C++ under Windows XP.

The Reasons for Selecting 8051 Micro Controller

The 8051 family of micro controller is selected for implementing the proposed sensor system, because it is the most cheapest and commonly available microcontroller in the market. It is based on an architecture which is highly optimized for embedded control systems. It is used in a wide variety of applications from military equipment to automobiles to the keyboard of the PC. The 8051 family of microcontrollers is available in a wide array of variations from manufacturers such as Intel, Philips, and Siemens. These manufacturers have added numerous features and peripherals to the 8051 such as I2C interfaces, analog to digital converters, watchdog timers, and pulse width modulated outputs. Variations of the 8051 with clock speeds up to 40MHz and voltage requirements down to 1.5 volts are available. This wide range of parts based on one core makes the 8051 family an excellent choice as the base architecture for a company's entire line of products since it can perform many functions and developers will only have to learn this one platform. It has a Full duplex UART, so this micro-controller can be used for constructing the proposed PC vs hardware network.

About the Implementation

The hardware will be assembled on readily available general purpose PCBs and the power for each and every nodes will be provided from a common power source. The Firmware of the 8051 embedded system will be developed by using suitable programming language. The software at the PC side will be developed using VC++ for gathering the sensor data and visualizing the house.

 

The Architecture of 8051 and Serial Communication

The Intel 8051 was a Harvard architecture single chip microcontroller (µC) developed by Intel in 1980 for use in embedded systems. It was extremely popular in the 1980s and early 1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by more than 20 independent manufacturers including Atmel, Maxim IC (via its Dallas Semiconductor subsidiary), Philips, Winbond, and Silicon Laboratories. Intel's official designation for the 8051 family of µCs is MCS 51.

Intel's original 8051 family was developed using NMOS technology, but later versions, identified by a letter "C" in their name, e.g. 80C51, used CMOS technology and were less power-hungry than their NMOS predecessors - this made them eminently more suitable for battery-powered devices.

Important Features of 8051

It contains Processor (CPU), RAM, ROM, Serial Port , Parallel Port, Interrupt logic, Timer etc.

Data bus - 8 bit data bus. Can access 8 bit data in one operation. Hence called 8-bit microprocessor.

Address bus - 16 bit address bus. Can access 216 memory locations i.e 64 KB of memory each of RAM and ROM.

On chip RAM - 128 Bytes (Data Memory).

On chip ROM - 4 KB (Program Memory).

Four Byte bi-directional Input Output port.

UART (Serial Port).

Two 16 - bit Up-Counter.

Two level interrupt priority.

Power saving mode.

A particularly useful feature of the 8051 core is the inclusion of a boolean processing engine which allows bit-level boolean logic operations to be carried out directly and efficiently on internal registers and RAM. This feature helped to cement the 8051's popularity in industrial control applications. Another valued feature is that it has four separate register sets, which can be used to greatly reduce interrupt latency compared to the more common method of storing interrupt context on a stack. The 8051 UART can be configured to use a 9th data bit that can provide addressable communications in an RS-485 multi-point communications environment.

8051 based microcontrollers typically include one or two UARTs, two or three timers, 128 or 256 bytes of internal data RAM (16 bytes of which are bit-addressable), up to 128 bytes of I/O, 512 bytes to 128kb of internal program memory, and sometimes a quantity of extended data RAM (ERAM) located in the program address space. The original 8051 core ran at 12 clock cycles per machine cycle, with most instructions executing in one or two machine cycles. With a 12 MHz clock frequency, the 8051 could thus execute 1 million one-cycle instructions per second or 500,000 two-cycle instructions per second. Enhanced 8051 cores are now commonly used which run at six, four, two, or even one clock per machine cycle, and have clock frequencies of up to 100 MHz, and are thus capable of an even greater number of instructions per second. All SILabs, some Dallas and a few Atmel devices have single cycle cores. Even higher speed single cycle 8051 cores, in the range 130 MHz to 150 MHz, are now available in internet downloadable form for use in programmable logic devices such as FPGAs, and at many hundreds of MHz in ASICs, for example the netlist from e8051.com.

Common features included in modern 8051 based microcontrollers include built-in reset timers with brown-out detection, on-chip oscillators, self-programmable Flash ROM program memory, bootloader code in ROM, EEPROM non-volatile data storage, I2C, SPI, and USB host interfaces, PWM generators, analog comparators, A/D and D/A converters, RTCs, extra counters and timers, in-circuit debugging facilities, more interrupt sources, and extra power saving modes.

The 8051's predecessor, the 8048, was used in the keyboard of the first IBM PC, where it converted keypresses into the serial data stream which is sent to the main unit of the computer. The 8048 and derivatives are still used today for basic model keyboards.

The 8031 was a cut down version of the original Intel 8051 that did not contain any internal program memory. The 8052 was an enhanced version of the original Intel 8051 that featured 256 bytes of internal RAM instead of 128 bytes, 8 kB of ROM instead of 4 kB, and a third 16-bit timer. The 8032 had these same features except for the internal ROM program memory. The 8052 and 8032 are largely considered to be obsolete because these features and more are included in nearly all modern 8051 based microcontrollers.

Since its 1980 introduction, the 8051 and its derivatives have shipped over three billion units world-wide and the production rate is still growing, which is very unusual since sales of an integrated circuit usually start to fall off after a couple of years. And these sales and longevity records were achieved with essentially no changes to the core architecture. Intel's x86 family, by comparison, has undergone three major architecture enhancements and six major redesigns during these same years. Plenty of other semiconductor companies still manufacture versions of this chip.

The 8051 offers 64K (i.e., 64 * 1024) bytes of program memory address space and another 64K bytes of data memory address space. The address space is the range of addresses that a computer can accommodate. The 8051 employs a 16 bit value for each program memory address and since 16 bits can describe 64K different values, the program address space is 64K bytes wide. Similarly, the 8051 employs a 16 bit value for each data memory address. Each of these 64K program memory and data memory locations is a byte wide (that is, holds 1 byte). This makes the 8051 a byte oriented machine (in contrast, the members of Intel's x86 family all gobble 4 bytes at a time).

The address space sets an upper limit on the amount of memory, since there is no point in providing storage that can't be addressed. But each application is free to use less memory to save cost. The most common flavor of 8051 offers only 4K bytes of program memory and 256 bytes of data memory. This is still sufficient for applications such as stoplights, electronic signboards, bathroom scales, etc and for the proposed simple sensor network. The contents of the 8051's program memory can only be read, not written to. Data memory can be both read and written under program control.

Conclusion And Further Enhancements

The proposed model of the embedded security system has been successfully designed and implemented. The embedded security system has been successfully interfaced with a desktop computer and the sensor data were retrieved in regular intervals.

Using the serial communication program, the operations of the sensor nodes can be controlled using the Tx Operation. The performance of the system was evaluated with different operating conditions and modes. The system was tested with different speeds of data transfer. The proposed system achieved the performance which will be sufficient for more practical house security systems.

The Embedded sensor system was designed in such a way to interface it with more similar sensor systems to function as a huge security network. But in this project, that feature was not tested since we developed only a single embedded sensor system. In future, one may extend this functionality to get sensor data from very large house or office environment.