Build a low cost simple wireless mesh using arduinos and long range APC220 radio modules. Wireless mesh networks can handle individual nodes not working and are tolerant to environments such as forests and hills where data may not be able to go directly from one point to another.

Step 1: How the mesh works

This is a wireless mesh with a range of up to 1km between nodes. There are 16 nodes in each mesh, and all nodes use the same frequency. Each node can sample two analog voltages and shares these with the mesh. The mesh is tolerant of faults with individual nodes, and data takes multiple paths to get to the destination. Nodes can also interface to the internet, and to other meshes that that been set up for a different frequency. Individual nodes may only be able to talk to a few nearby nodes.

One problem with building meshes is complexity. This mesh simplifies things by using a synchronised clock, and much of the mesh protocol revolves around getting the clock working. Each node exchanges the time with nearby nodes. If a node receives time data from a nearby node it notes the number of the node, and the number of the last node it received a time from, and takes the lower of the two. If node zero is in the mesh, then all the nodes ultimately synchronise to node zero's time. If node zero is shut down, then node 1 will take over this function.

Nodes flash a led in time with their clock, and within a minute or so, all the nodes will be flashing in synch. Once this is working, each node transmits only during its allocated time slot. This avoids data clashes and minimises errors.

Each node collects its own data and adds a time stamp to this. When a node transmits, it transmits the data for the entire mesh, including the time stamps. Any node that hears this data looks at the list, looks at its own list, and replaces any old data with newer data.

This way, new data propagates through the mesh.

There are 16 nodes and each node has two analog values, making a total of 32 integer values to share through the mesh. The number of nodes and the number of analog values per node is limited by the time needed to cycle through the entire network. Each node has 4096ms to transmit all its data (9600 baud), and so it takes 65 seconds for all the nodes to transmit in turn and for new data to move through the mesh.

Read world data that can be shared are temperatures, tank levels, stock trough levels, rainfall, humidity, dam levels, local battery data if a node is solar powered, and other data that needs to be shared over a large distance and where time is not so critical.

Hi Scios, your message from 17/2 appeared on my email feed but it isn't coming up on this comment page - something not working at Instructables. Maybe send me an email moxhamj@internode.on.net
Awesome project. Is it still up and running?
Very much so! The wireless data has to go over a hill and through trees so no direct line of sight. Could have used high power radio, but with low power and short range and multiple hops there is no interference to the neighbours. Data used to go to xively but they are subscription, so instead goes to Thingspeak. Data is here http://www.smarthome.jigsy.com/ Some minor tweaks to the software along the way, now have 32 nodes instead of 16, and also every node has a display - this uses more power, but it makes debugging a lot easier. I like to see each node talking to at least two others, so there are multiple data paths and the system then can handle a few nodes not working.
<p>Oh, I've got so many questions. </p><p>\I am trying to achieve what you have already accomplished. I am playing around with building a sensor network for a farm. I want to use rf as gsm is not available. You mention that you could have used high power radio. This will obviously increase the distance between the nodes. Do you have an example of a high power radio you have considered? What was your reasons for picking the APC220 radio modules. I see there range are up to 1000m, but they seem to be a bit pricey ($40+). What do you think about lora?</p><p>I am amazed at what you have done with Thingspeak. I am going to have a look at it in more detail. What advantages does Thingspeak have for you?</p><p>How do you measure the water level in your tanks? Floaters?</p><p>My apologies for all the questions. I have been playing around with arduino for a few months now and are still a noob.</p><p>Thanks</p><p>Scois</p>
<p>Nice project. I like your code.</p>
<p>Hi. I am building a similar project and ran into the same issue with power consumption. I moved the radio and the temperature sensor to an digital pin. Set up the pin on the temperature sensor to go high every 10 seconds. If something changes the pin the radio is getting its power from goes to high. The radio only transmits if something changes. The rest of the time the arduino sleeps using the narcoleptic library. I don't have screen on transmitter. By making these little changes the arduino nano pulls 8 milli amps most of the time.</p>
<p>Hi Dr. I went through this project, but I dint understood the actual purpose of this project. Are we increasing the range of wifi router in this project? Please dont feel offended if you think that my question is silly. Guide me in the proper direction. Thanks in Advance.</p>
<p>Good question! Well initially I was building wifi router extenders, but found they have limited range, decent range needs large antennas (1 meter dishes) and use a fair bit of power. So this mesh was a way of sending simple data further distances with less power. But of course, the data is very limited and certainly can't do pictures and video etc.</p>
<p>The ESP8266 chip uses a heck of a lot of power setting up and looking for other networks servers and clients . Seems about 40% of its memory is this stuff then yours goes in too.Power supply seems to be the failing and even with ESP.deepSleep() it still seems to eat batteries in days. So if you are considering the work involved in switching I would address the battery problem first.</p>
<p>Agree with those comments. I initially had the idea of a mesh of wifi routers, each acting as a bridge, but a typical router is 5 to 12 watts, plus the power of the ESP8266 modules. Hence this design that uses APC220 modules to do the long haul data comms, and just have one point in the network where it links to the internet. Also 433Mhz is better than 2.4Ghz for going through trees and over hills. The whole &quot;Internet of Things&quot; tends to gloss over the fact that a router is part of the system and really is not something that can be battery powered. Even arduino's out in the field are borderline for battery power. 100mW still tends to need large panels and large batteries to cover a worst case scenario of clouds for a week.</p><p>One thing though with the comment about ESP8266 power supply failing, I agree, and I have had good results putting a beefy capacitor like 4700uF across the ESP8266 supply. </p>
<p>Wow, really interesting!</p>
<p><strong>helena's graduation 24/06/2015</strong></p>

About This Instructable




More by Dr_Acula:Wireless Mesh with Graphics LCD Simple Arduino Wireless Mesh Worldwide microcontroller link for under $20 
Add instructable to: