# Wireless sensor network in practical for beginner

I am a master student, and I used to implement my protocol or scheme of WSN in the simulator(e.g., N3S or MATLAB). I am currently want to know how to touch the WSN with the real device. Can anyone share some suggestions:

• Which type of sensor can achieve the capabilities: organizing network topology, implementing router protocol, etc.
• How to code these sensors to obey my scheme? Should I have a Raspberry Pi?
• I am skilled in C/C++, Python. It's enough to build my WSN from scratch?

Industry WSN is too complex for me now. I just want to have my own simple&small WSN in this stage. Thanks in advance.

## 1 Answer

Which type of sensor can achieve the capabilities: organizing network topology, implementing router protocol, etc.

A wireless sensor node usually consists of 3 parts.

1. A sensor
2. A radio
3. A processor (which in some cases is included on the same chip as the radio).

Routing and handling of network traffic is typically performed by the processor.

• For just handling network traffic, just about any 8-bit MCU (Like PIC, AVR, or HCS08) would work and would be relatively simple to get up and running. They typically cost under \$5.

How to code these sensors to obey my scheme? Should I have a Raspberry Pi?

A Raspberry Pi would work but its overkill. Unless you are processing video or radar/sonar data you won't need that much processing power. The drawbacks to using it are that its going to be bigger, more expensive, and consume more power than just using a single chip 8-bit MCU.

There are also various 32-bit MCUs out there that could work (like ARM, PIC32, AT32UC3L), but configuring them is likely to be much more complex, and they will burn more power (which is a consideration if the nodes are battery powered).

I am skilled in C/C++, Python. It's enough to build my WSN from scratch?

Of those three languages, "C" is probably the most appropriate choice to use on a small 8-bit MCU. You might also use C++ if the compiler supports it, but the use of object oriented programming often leads to slower performance on small systems like this.

With firm knowledge of "C" you can build a network.

• Doing the RF design from scratch is probably too advanced for a beginner, so I would recommend using an off the shelf RF module.

• Many off the shelf modules implement their own network protocols. The intention of the manufacturer is to make something that people can just plug together and get working. But that's not really suitable when one's goal is to test their own custom network protocols (as you seem to be doing).

• For your wireless radios I would recommend the MRF24J40MA or MRF24J40MD sold by Microchip corporation. I have had good luck with them. They transmit raw 802.15.4 physical layer packets, and you have total control of what goes in the packets and when they transmit. The range is either 400feet or 4000 feet depending on which module you get. The interface is a 4 wire SPI bus. In sleep mode they only consume a few uA, so they can be used in low power systems.

• You may also consider some of the wireless modules made by Nordic Semiconductor. Some of those offer both the radio and micro-controller in one chip, which can lead to a smaller and more integrated solution.

• Shocked by your detailed answer. Thank you very much. I would follow your reply to solve my problem; however, it may take me some while. Dec 8 '20 at 6:41