Introduction: Wireless Mesh With Graphics LCD
16 node mesh, up to 1000m between nodes, sample two analog voltages per node, link any node to any other node, display data on any node with either graphics or text display, turn on relays based on data at any node, fault tolerant with data going via multiple paths.
Step 1: Wireless Mesh With Graphics LCD
This Instructable merges two existing Instructables - one using 20x4 text displays https://www.instructables.com/id/Simple-Arduino-Wir... and some great work by Bodmer on graphics and text modes for the ILI9341 https://www.instructables.com/id/Arduino-serial-UAR...
A wireless mesh exchanges information between all nodes, with a common clock that is also exchanged, so that all nodes are synchronised and each node transmits in its own time slot. The mesh is tolerant of faults, including nodes not functioning, and messages will find their way around the network via multiple paths. This network keeps things simple - each node can sense two analog values, and output two analog values. Outputs can be linked to any input from another node.
Parts are an Arduino UNO clone ($5), ILI9341 display ($5), APC220 ($20) PCB ($3) and sundry components. The APC220 module is expensive compared to other wireless options, but it has a long range (1000m) and is reliable through walls and trees.
Step 2: Schematic
Resistors are needed to drop the voltage from 5V to 3.3V. Analog inputs A0 and A1 have optional capacitors to smooth any inputs that might come in on long leads, such as a temperature sensor. The board is powered from an external supply - 7V on Vin minimises heat losses but ensures that the 5V is stable on the Arduino. Library parts for the Arduino layout are available from Sparkfun.
Step 3: PCB Layout
PCB layout is shown for Eagle. This board is small enough that it can be made with the free version of Eagle. I get boards made by Seeed Studios https://www.seeedstudio.com/service/index.php?r=pcb The autorouter on eagle works fine for laying out the board.
Step 4: Text Display
With a change to one line of code it is possible to either display the text the mesh is using to talk amongst itself, or to display a value from any node as a graphical display. Having both options does fill the arduino memory to 98% (with about half of that as fonts), but it makes it easier to work with the code as only one program is needed.
Step 5: Arduino Code
Program is attached. See Bodmer's instructables (search Instructables Bodmer on Google) for the display driver and font files.
This line of code changes between text and graphic mode
boolean displayMeter = true; // false displays text from the mesh, true displays just the meter
There are also a node number which needs to be 0 to 15 for each node in the mesh.
There is also a font include file that determines which fonts are loaded - this is in the package from Bodmer's instructable, and to fit in the memory only font 2 and font 4 are used. Please contact me in the comments section if you are having trouble fitting it all into the UNO as it is likely the fonts are the problem.
For the solar watt display on the first page, this uses a kilowatt meter with a pulse output, and an arduino to measure the time between pulses and convert to an analog voltage, which is then fed into the mesh.
There are enough spare pins on the arudino to turn on a couple of relays and control things based on values that might be measured many kilometers away.
Have fun!