Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MATLAB to automatically create a wireless network.

Status
Not open for further replies.
voronoi based for wireless sensor networks using matlab \

can u help me?
 

Hi
I am trying to put the base station or gateway node in my created wsn network.
I have used matlab to design my sensor network of 100 nodes.
please help me out!!!!!!

Thanks
 

HI,

Is there anyone know how to use inpolygon function for a circle? I wanted to figure out how many points ( randomly generated) locates inside and outside a circle..
Any help is so much appreciated..
 

Dear sir

I'm master student, searching for someone to help me in programming in WSN IEEE 802.15.4
I'm searching someone who has matlab code for this standard IEEE 802.15.4 to apply fuzz logic
can any one help me?

u can contact me: oyas2007@yahoo.com
or skype : oyas20042002
 

hi ellobazo,
could you please send me some basic code in matlab to simulate wsn.please share it with me dear.its very very urgent.i cannot progress my thesis work due to this.please......
 

hi.. m doing thesis in wireless sensor network.. i am trying to implement LEACH algorithm in MATLAB. Can anyone help me regarding dis?
 

Hi..

could i have a look at your code or examples. so that i can try to modify and make it work with the GUI ?. perhaps after doing so i might get and new idea of how to implement mine. because now that you talk about sensor networks, i also need my program to sense when something is too close to a base station, for example. if there are 2 base stations but there is a third which is not needed and is making contact with the other two, it could be deleted or disable or something.

thanks

pls...can u help me in designing matlab code for clustered homogeneous wireless sensor network...................
 

hi can u plz send me pseudocode for pegasis?? i need it for my thesis work under wireless sensor networks

---------- Post added at 02:14 ---------- Previous post was at 02:09 ----------

clear;

%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;

%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;

%Number of Nodes in the field
n=100

%Optimal Election Probability of a node
%to become cluster head
p=0.1;

%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;

%Values for Hetereogeneity
%Percentage of nodes than are advanced
m=0.1;
%\alpha
a=1;

%maximum number of rounds
rmax=9999

%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%

%Computation of do
do=sqrt(Efs/Emp);

%Creation of the random Sensor Network
figure(1);
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
S(i).G=0;
%initially there are no cluster heads only nodes
S(i).type='N';

temp_rnd0=i;
%Random Election of Normal Nodes
if (temp_rnd0>=m*n+1)
S(i).E=Eo;
S(i).ENERGY=0;
plot(S(i).xd,S(i).yd,'o');
hold on;
end
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a)
S(i).ENERGY=1;
plot(S(i).xd,S(i).yd,'+');
hold on;
end
end

S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
plot(S(n+1).xd,S(n+1).yd,'x');


%First Iteration
figure(1);

%counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;

countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;

for r=0:1:rmax
r

%Operation for epoch
if(mod(r, round(1/p) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
end
end

hold off;

%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;

%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
packets_TO_CH=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;

figure(1);

for i=1:1:n
%checking if there is a dead node
if (S(i).E<=0)
plot(S(i).xd,S(i).yd,'red .');
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
hold on;
end
if S(i).E>0
S(i).type='N';
if (S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,'o');
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,'+');
end
hold on;
end
end
plot(S(n+1).xd,S(n+1).yd,'x');

---------- Post added at 02:15 ---------- Previous post was at 02:14 ----------

google it

clear;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;

%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;

%Number of Nodes in the field
n=100

%Optimal Election Probability of a node
%to become cluster head
p=0.1;

%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;

%Values for Hetereogeneity
%Percentage of nodes than are advanced
m=0.1;
%\alpha
a=1;

%maximum number of rounds
rmax=9999

%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%

%Computation of do
do=sqrt(Efs/Emp);

%Creation of the random Sensor Network
figure(1);
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
S(i).G=0;
%initially there are no cluster heads only nodes
S(i).type='N';

temp_rnd0=i;
%Random Election of Normal Nodes
if (temp_rnd0>=m*n+1)
S(i).E=Eo;
S(i).ENERGY=0;
plot(S(i).xd,S(i).yd,'o');
hold on;
end
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a)
S(i).ENERGY=1;
plot(S(i).xd,S(i).yd,'+');
hold on;
end
end

S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
plot(S(n+1).xd,S(n+1).yd,'x');


%First Iteration
figure(1);

%counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;

countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;

for r=0:1:rmax
r

%Operation for epoch
if(mod(r, round(1/p) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
end
end

hold off;

%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;

%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
packets_TO_CH=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;

figure(1);

for i=1:1:n
%checking if there is a dead node
if (S(i).E<=0)
plot(S(i).xd,S(i).yd,'red .');
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
hold on;
end
if S(i).E>0
S(i).type='N';
if (S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,'o');
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,'+');
end
hold on;
end
end
plot(S(n+1).xd,S(n+1).yd,'x');
 
hi can u plz send me pseudocode for pegasis?? i need it for my thesis work under wireless sensor networks

---------- Post added at 02:14 ---------- Previous post was at 02:09 ----------

clear;

%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;

%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;

%Number of Nodes in the field
n=100

%Optimal Election Probability of a node
%to become cluster head
p=0.1;

%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;

%Values for Hetereogeneity
%Percentage of nodes than are advanced
m=0.1;
%\alpha
a=1;

%maximum number of rounds
rmax=9999

%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%

%Computation of do
do=sqrt(Efs/Emp);

%Creation of the random Sensor Network
figure(1);
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
S(i).G=0;
%initially there are no cluster heads only nodes
S(i).type='N';

temp_rnd0=i;
%Random Election of Normal Nodes
if (temp_rnd0>=m*n+1)
S(i).E=Eo;
S(i).ENERGY=0;
plot(S(i).xd,S(i).yd,'o');
hold on;
end
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a)
S(i).ENERGY=1;
plot(S(i).xd,S(i).yd,'+');
hold on;
end
end

S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
plot(S(n+1).xd,S(n+1).yd,'x');


%First Iteration
figure(1);

%counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;

countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;

for r=0:1:rmax
r

%Operation for epoch
if(mod(r, round(1/p) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
end
end

hold off;

%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;

%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
packets_TO_CH=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;

figure(1);

for i=1:1:n
%checking if there is a dead node
if (S(i).E<=0)
plot(S(i).xd,S(i).yd,'red .');
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
hold on;
end
if S(i).E>0
S(i).type='N';
if (S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,'o');
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,'+');
end
hold on;
end
end
plot(S(n+1).xd,S(n+1).yd,'x');

---------- Post added at 02:15 ---------- Previous post was at 02:14 ----------

google it

clear;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;

%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;

%Number of Nodes in the field
n=100

%Optimal Election Probability of a node
%to become cluster head
p=0.1;

%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;

%Values for Hetereogeneity
%Percentage of nodes than are advanced
m=0.1;
%\alpha
a=1;

%maximum number of rounds
rmax=9999

%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%

%Computation of do
do=sqrt(Efs/Emp);

%Creation of the random Sensor Network
figure(1);
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
S(i).G=0;
%initially there are no cluster heads only nodes
S(i).type='N';

temp_rnd0=i;
%Random Election of Normal Nodes
if (temp_rnd0>=m*n+1)
S(i).E=Eo;
S(i).ENERGY=0;
plot(S(i).xd,S(i).yd,'o');
hold on;
end
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a)
S(i).ENERGY=1;
plot(S(i).xd,S(i).yd,'+');
hold on;
end
end

S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
plot(S(n+1).xd,S(n+1).yd,'x');


%First Iteration
figure(1);

%counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;

countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;

for r=0:1:rmax
r

%Operation for epoch
if(mod(r, round(1/p) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
end
end

hold off;

%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;

%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
packets_TO_CH=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;

figure(1);

for i=1:1:n
%checking if there is a dead node
if (S(i).E<=0)
plot(S(i).xd,S(i).yd,'red .');
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
hold on;
end
if S(i).E>0
S(i).type='N';
if (S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,'o');
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,'+');
end
hold on;
end
end
plot(S(n+1).xd,S(n+1).yd,'x');



thank u................this will be very helpfull............
 

Hi
very informative, but am working on localization in wireless sensor network, and am trying to simulate the localizationtion process using matlab. someone actually wrote a journal paper on how it can be achieve and the title of the paper is RSSI Based localization in wireless sensor network which can be downloaded online. but he didnt gave the matlab code but he wrote down the steps to do the simulation using matlab. please can you help me in actually developing a code where by the positions of some of the nodes deployed are known (i.e their coordinates) while other node positions are not known but using the simulation to get the coordinates of the unknown node position
Thanks
 

can you please suggest me a link or source for learning how to write matlab programs for simulation
 

Sir
i also want to insert the sink mobility......Please help me.....
 

hi can u plz send me pseudocode for pegasis?? i need it for my thesis work under wireless sensor networks

---------- Post added at 02:14 ---------- Previous post was at 02:09 ----------

clear;
.
.
.
%counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;

countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;

for r=0:1:rmax
r

I'm trying to run this code by creating new script and paste it on, but there is an error (missing end 'for').
how can I fix this? thanks a LOT
 

hi..
can u please help me in coding.. i am beginner in implementation part of my protocol in wsn using MATLAB.. kindly help me by providing code how to create nodes in wsn using matlab..
 

Hi ellobazo,

What do you mean by "to move it around"? Do you want something with a graphical user interface?

I'm currently working on a project where I randomly place nodes in a two-dimentions space. It's useful in Wireless Sensor Networks simulations. Let me know if this is useful and I can share it with you (it's a very simple code)

Hi i m working to develop cluster whose cluster head can be rotated.here the nodes are randomly placed.can u please mail me the code.
 

Hi ellobazo,

Wireless Sensor Networks (WSN) is different than the Cellular Networks as I mentioned earlier.

A WSN is composed of a large number of sensor nodes that communicate using a wireless medium (air).
The sensor nodes are deployed randomly in the environment to be monitored.
The sensor nodes distributed in ad hoc structure.
In WSN there is no base station and not all nodes hear each other.
The WSN is a multi-hop network.

Basic part of my code is to randomly place the sensor nodes in the given space then connecting each two nodes if the distance between them less than or equal to the communication radius. Please check Matlab code below.

clear;
noOfNodes = 50;
rand('state', 0);
figure(1);
clf;
hold on;
L = 1000;
R = 200; % maximum range;
netXloc = rand(1,noOfNodes)*L;
netYloc = rand(1,noOfNodes)*L;
for i = 1:noOfNodes
plot(netXloc(i), netYloc(i), '.');
text(netXloc(i), netYloc(i), num2str(i));
for j = 1:noOfNodes
distance = sqrt((netXloc(i) - netXloc(j))^2 + (netYloc(i) - netYloc(j))^2);
if distance <= R
matrix(i, j) = 1; % there is a link;
line([netXloc(i) netXloc(j)], [netYloc(i) netYloc(j)], 'LineStyle', ':');
else
matrix(i, j) = inf;
end;
end;
end;

Hi,

How can I insert a curve in the same figure

best regards
 

hi.. m doing thesis in wireless sensor network.. ...how to create sensor node forwarding circle ...plz me some basic code

- - - Updated - - -

Hi ellobazo,
plz tell how to create circle every node given range...plz reply me
 

Hi,
I have the heed code in matlab and I'm trying to add multi hops to the network ,can anyone help me because I need it as soon as possible pleeeeeeeeese !!!!!!
I will be grateful.

- - - Updated - - -

Hi,
I have the heed code in matlab and I'm trying to add multi hops to the network ,can anyone help me because I need it as soon as possible pleeeeeeeeese !!!!!!
I will be grateful.
 

Hi,

I am working on Wireless sensor network. Can u share your work with me so that I ca n construct the wireless sensor network using matlab.
I have placed the sensor nodes randomly in a 2D Space. I would like to construct the network between the randomly generated senors nodes.
For constructing, I am using the All pair shortest path (Floyd's algorithm) and for establishing the path between sink to the remaining network I am using Dijkstra's algorithm ( Single Source Shortest path).
I am in a confusion state what I am doing is correct r not.
One more doubt that, can I use the same path which is generated using Floyd's algorithm for the sink to remaining all nodes.
Please help I have struked at a intial phase only.

Regards
Vasavi

Hi ellobazo,

What do you mean by "to move it around"? Do you want something with a graphical user interface?

I'm currently working on a project where I randomly place nodes in a two-dimentions space. It's useful in Wireless Sensor Networks simulations. Let me know if this is useful and I can share it with you (it's a very simple code)
 

Hi,

i am working on ESEP protocol in MATLAB which is the advance version of SEP and LEACH protocol. i have run the code of LEACH and it is giving output. but i dont know that

-how nodes are behaving like a sensor network and doing the work of sensing,sending?

-are the properties of WSN inbuilt in MATLAB?

-where the methods used like[S(i).xd,S(i).type] in code are declared and is the work of xd and type are defined in MATLAB??
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top