Week 6 – Wireless Sensor Networks (WSN)!

Hi! Thanks for clicking in! 🙂

This week’s post will be mainly about the Wireless Sensor Network (WSN) device. WSN is a magical device, I would say, as it is able to monitor physical or environmental conditions, such as temperature, sound, pressure, etc, and simultaneously transmit its data through the network to a central node.

Isn’t this amazing?!

In this post, we will be exploring more about it by using:

  1. XBee Unit
  2. XBee Explorer Dongle
  3. Arduino

4e104900b1502d215c83e16e46c4c150

Figure 1: XBee Unit

We first embarked on a brief introduction to this cool device. Ms Rubaina got us to configure the XBee unit by using XCTU, a configuration program which can be downloaded online for free. All we needed to do was follow the instructions step by step in the handout given to us.

This slideshow requires JavaScript.

To download: http://www.digi.com/support/productdetail?pid=3352

To ensure the program worked, we connected an LED to the Arduino to run a test. We set up a program whereby sending the character ‘a’ from the XCTU console to the XBee Unit on the Arduino board would light up the LED and sending the letter ‘b’ would turn off the LED.

12285782_10153563006127891_745959033_n

Figure 3: This is when ‘a’ is sent from the XCTU console to the XBee Unit.

It was quite disappointing at first when we could not get it working. Errors kept occurring and we could not figure it out why. Fortunately, Hwee Peng & Ajay were patient enough to troubleshoot the problem by Googling for solutions. There were initially some synchronisation errors with some USB ports on our laptop, and we had to test each port individually.

Furthermore, after we configured the unit once, when we tried reconfiguring it there were some synchronisation errors thrown up despite us using working USB ports. We could not figure out why this was the case and hence decided to clear the boards memory by pressing the RESET button found on the board. This then allowed us to upload new configuration settings to the board without any errors, since the board’s memory was wiped.

Then, we connect the End Node XBee unit to the Arduino, and uploaded the code provided to the Ardunio board.

a

Figure 4: Wiring diagram for the XBee Unit

And here comes the fun part!

After getting the XBee Unit configured, Ms. Rubaina got us to team up with Group 5 to further exploring its function. We continued the adventure by carrying out the activity – ‘You Can Ring My Bell’.

12312509_10153563005622891_623847149_n

Figure 5: Collaborating with Group 5!

In essence, one group has to be the ‘switch’ and the other one the ‘bell’. The objective of this activity is to activate other group’s bell or buzzer by sending a signal. As seen previously, this was done by transmitting the character ‘a’ or ‘b’ through the console. However in this case, a switch was used to simulate sending the ‘a’ or ‘b’ to control the buzzer. We tried configuring the XBee Unit accordingly and uploaded the new program to the Arduino board.

b

Figure 6: Wiring diagram of the switch & buzzer circuit

12308940_10153563006002891_454294749_n

Figure 7: The switch – using 2 wires to act as one

Instead of ringing Group 5’s buzzer, we accidentally rang another group’s buzzer, which I must say was quite comical! Only then did we realise that our XBee Unit was not configured to be in the same channel as the receiving XBee Unit and that the destination address was not correct.

After we found out the reason behind this, we then reconfigured the XBee Unit to make sure it sounds the (correct!) buzzer when the wires touch together.

Taaadaaaa! Here are the results! 🙂

Finally, after some trials & error, Ms Rubaina got us to integrate it into our water level sensor code (Week 1’s Activity).

This time round, we were required to send our readings to her central node using the same method. Our sensor readings had to be sent to Ms Rubaina’s XBee Unit together with all the other group’s sensors, and the end result was this whole invisible network of sensors transmitting information to a central node. This would come in very useful for our project if we want to make use of a variety of sensors.

This slideshow requires JavaScript.


To conclude, we learnt a lot about interfacing sensors and forming a whole wonderful network of sensors very elegantly! We appreciate the fact that we weren’t guided every single step of the way and instead were given freedom to test and break things and carry out our own research to fix any problems we encountered.

That’s all for this week’s update! Stay tuned as we are starting work on our project soon! 🙂

Thomas Wong

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s