Sensor network is a network of autonomous devices that consist of sensors which are spatially distributed to sense the physical environment for certain parameters like temperature, humidity and pollution etc. There are various applications of sensor network, like volcanic eruption, inventory tracking system, military surveillance, homes and industrial automation and automobiles. Different sensors use for specific purpose such as temperature sensor, humidity sensor, light sensor, ultrasonic and multimedia sensor, and all these sensors are used for their own task. In this system, we use ultrasonic sensor for defense and security purpose. The ultrasonic sensor constantly transmits ultrasonic sound (Transmitter) which on striking with an obstacle bounces back and that bounced wave is also received by sensor (Receiver) and from this reflection the distance between sensor and obstacle is calculated. So when a person come close to dangerous area like electric field, river side and explosive material, the system will detect the person and will sound an alarm to inform the authorities. The proposed scheme is implemented and the generated results validates its functionalities.