OMNET++ SENSOR NETWORK

OMNET++ SENSOR NETWORK helps to communicate among them using radio signals, and deployed in quantity to sense, monitor and understand the physical world. Wireless Sensor nodes are called motes. Wireless Sensor Network is a self-configuring network.

Applications of WSN:

  • Industrial applications.
  • Transportation.
  • Civil infrastructure services.
  • Security.
  • Science .

 

Characteristics of WSN:

  • Vast or small number of nodes per unit area, very application-dependent.
  • WSN has to adapt to changes, self-monitoring, adapt operation.
  • Support large number of nodes.
  • Re-programmability of nodes in the field might be necessary, improves flexibility.
  • Lifetime of individual nodes relatively unimportant.
  • Incorporate possible additional resources, say for example newly deployed nodes.
  • Be robust against node failure.
Architecture of WSN
Architecture of WSN

Research work on wsn:

  • Robotic sensor in underwater environment.
  • Research on agricultural environment.
  • Introducing zigbee in WSN.
  • Energy efficient designing in Emergency situation.
  • Distributed computing and decision making.

Sample code for WSN:

double segmentsIntersectAt(Coord p1From, Coord p1To, Coord p2From, Coord p2To) {
		Coord p1Vec = p1To - p1From;
		Coord p2Vec = p2To - p2From;
		Coord p1p2 = p1From - p2From;
		double D = (p1Vec.x * p2Vec.y - p1Vec.y * p2Vec.x);
		double p1Frac = (p2Vec.x * p1p2.y - p2Vec.y * p1p2.x) / D;
		if (p1Frac < 0 || p1Frac > 1) return -1;
		double p2Frac = (p1Vec.x * p1p2.y - p1Vec.y * p1p2.x) / D;
		if (p2Frac < 0 || p2Frac > 1) return -1;
		return p1Frac;
}

double WSN::calculateAttenuation(const Coord& senderPos, const Coord& receiverPos) const {
	if (getShape().size() < 2) return 1;
	std::multiset<double> intersectAt;
	bool doesIntersect = false;
	const Obstacle::Coords& shape = getShape();
	Obstacle::Coords::const_iterator i = shape.begin();
	Obstacle::Coords::const_iterator j = (shape.rbegin()+1).base();
	for (; i != shape.end(); j = i++) {
		Coord c1 = *i;
		Coord c2 = *j;

		double i = segmentsIntersectAt(senderPos, receiverPos, c1, c2);
		if (i != -1) {
			doesIntersect = true;
			intersectAt.insert(i);
		}
	}	
	bool senderInside = isPointInObstacle(senderPos, *this);
	bool receiverInside = isPointInObstacle(receiverPos, *this);
	if (!doesIntersect && !senderInside && !receiverInside) return 1;
	double numWalls = intersectAt.size();
		if (senderInside) intersectAt.insert(0);
	if (receiverInside) intersectAt.insert(1);
	ASSERT((intersectAt.size() % 2) == 0);
		double fractionInObstacle = 0;
	for (std::multiset<double>::const_iterator i = intersectAt.begin(); i != intersectAt.end(); ) {
		double p1 = *(i++);
		double p2 = *(i++);
		fractionInObstacle += (p2 - p1);	}
	
	double totalDistance = senderPos.distance(receiverPos);
	double attenuation = (attenuationPerWall * numWalls) + (attenuationPerMeter * fractionInObstacle * totalDistance);
	return pow(10.0, -attenuation/10.0);
}