Introduction: MuMo - Node_draft

### UPDATE 10-03-2021 // the latest information / updates will be available on the github page:
https://github.com/MoMu-Antwerp/MuMo

What is MuMo?

What is MuMo?
MuMo is a collaboration between product development (a department of the University of Antwerp) under the name of Antwerp Design Factory and the Antwerp Fashion Museum. The goal of the project is to build an open source IOT monitor system based on a LoRa network.

  • It should be easy to set up.
  • It should be easy to assemble.
  • It must be scalable in terms of application area.

What the project MuMo contains:

MuMo Node

The MuMo Node is a low power device on AA batteries that can measure and transmit environmental parameters over a LoRa network. The parameters are temperature, humidity, ambient pressure and brightness.
*** The MuMo node can be extended with other functionalities to be used in other applications.***

MuMo Gatway

The MuMo Gateway is an active LoRa gateway that can receive and forward LoRa signals from the Node device over the internet. In this project the gateway will also be equipped with the same sensors of the MuMo Node device, air dust sensor and an bug trap that can be remotely monitored with a camera.

*** The gateway does not need to be equipped with sensors or a camera. It can also only serve to provide a LoRa network (non measuring gaetway).***

MuMo Dashboard

The MuMo Dashboard is provided to create an overview web application of the network that is being created. It is made user-friendly with different functionalities. The dashboard can be fully customized to the wishes and application of the user.

Github page:

https://github.com/MoMu-Antwerp/MuMo

Instructable pages:

MuMo_Node: https://www.instructables.com/MuMo-Node/

MuMo_Gateway: https://www.instructables.com/MuMo-Node/

Required Tools:

  • 3D printer with filament
  • Solder iron / solder
  • Small cutting plier
  • Hot glue gun (or other fixation tools)
  • Small screwdriver

Step 1: #Hardware - Ordering Parts

Parts to order:

See the github page for a recent overview:

https://github.com/jokohoko/Mumo/blob/main/Shopping_list.md

Step 2: #Hardware - 3D Printed Parts

Parts to 3D print:

  • NODE_Main_Housing
  • NODE_Battery_Tray
  • NODE_Backcover

See the github page for the latest STL files:

https://github.com/jokohoko/Mumo/tree/main/STL_NODE

Print filament:

  • PETG (preferred and more durable)
  • PLA

General print settings:

  • No support needed
  • Infill not necessary
  • 0.2 layer height
  • 3 outside perimeters (for strength and durability)

Step 3: #Hardware - Prepare the Battery Tray

Parts:

  • 2 x battery case (Side node: You can also use just one battery case for 3 AA batteries but the live range will be shorter!)
  • 1 x JST 2.0 power connector (included with the Seeed LoRaWan board)
  • 3D printed part: battery tray

Instructions - Soldering: (Warning HOT - be careful!)

  1. Solder all the red cables together
  2. Solder all the black cables together.
  3. Make sure that the soldering work is protected with insulation material. This can be a sleeve that you pull over the cable before soldering or insulation tape that you apply afterwards.

Instructions - Fixation of the battery holder:

  1. Glue the battery holders into the battery tray so that the cables are facing to the side with the cutout (see picture). This can be done with hot glue (preferred), double sided tape, silicone, second glue,...

Step 4: #Hardware - Prepare LoRaWan Board

Part:

  • LoRaWan board

Instruction:

Before removing the led on the board, connect the board to the computer and check if the power led light up. After removing the led we have no power indication anymore.

In order to reduce the power consumption of the Lorawan shield we should remove two LEDs that are purely informative. The power (PWR) and the charge indication (CHG) led.

Be extremely careful not to damage the board during this process! Use a sharp set of pliers.

  1. Locate the charging LED (CHR) and the powerLED (PWR) (see top view picture with the green rectangles)
  2. Cut the soldering of the LED. The LED should come loose.

  3. Remove the leds and check if the parts where removed cleanly without damaging the traces underneath.

Step 5: #Hardware - Assembly 1: TSL2561 / BME680

Parts:

  • 3D print - "Node main body"
  • Digital light sensor (small sensor)
  • BME680 sensor (long sensor)
  • 2 x Grove I2C connector cables
  • 4 x M2x5 screws

Instructions:


  1. Connect one of the grove cables to the digital light sensor. And the other to the BME680 sensor.

  2. Place the sensors into the 3D print housing ("Node main body").
  3. Digital light at the top left / BME680 at the top right. The connection part of the sensor is face down (not visible!). You have to bend the cables that they make a sharp turn.
  4. And screw both into place with the m2x5 mm screws.

Step 6: #Hardware - Assembly 2: Seeed LoRaWan Board

Parts:

  • Battery tray with battery holders
  • Seeed LoRaWan board
  • Main body node
  • 4 x M2x5 screws

Instructions:

  1. Insert the power cable of the battery tray into the LoRaWan board.
  2. Bend the power cable over so the cables so they don't take up to much space.
  3. Insert the LoRaWan board into the housing with the usb connector and power cable first.
  4. Align the holes of the LoRaWan board with the mounting pins of the housing.
  5. Make sure to place the LoRaWan board next to the dividing wall. (see pictures)
  6. Insert the four screws into the indicated position of the board (see top view picture - Green circles)
  7. When you tighten the screws make sure the reset button is properly aligned with the push button on the side of the node. (see top view picture - Blue rectangle)
  8. Check if the reset button is properly working. If the button does not move or doesn't touch the reset button or the board there might be inconsistencies in the 3D print quality. Try moving the board slightly or consider breaking off the plastic printed reset button entirely to solve this. You can still reset the button trough the hole in the print.

  9. Feed the antenna trough the foreseen opening in the battery support block, carefully thus not to break the antenna

Step 7: #Hardware - Assembly 3: Connect I2C Pins

Instructions:

  1. Connect the Grove cables to the i2C slots on the Seeeduino. Only the two outermost connectors are I2C pins and are usable for our sensors. But you may interchange both sensors connector. (see picture - blue rectangle)

Step 8: #Hardware - Assembly 4: Cable Management - I2C Cables

Instructions:

  1. Behind the battery support block there is provided room to push the I2C cables down into. The fit is tight so they won't move back out.

  2. Orient the cables nicely so they don't interfere with the battery tray that will be placed on top in a moment.

Comment: Leave the hardware of the node as is for now. We will setup the code first.

Step 9: #TTN - Sign Up / Log in

The things network provide a set of open tools and a global, open network to build your next IoT application at low cost, featuring maximum security and ready to scale.

* If you already have an account you can skip this step.

Instructions:

  1. Sign up at The Things Network and make an account
  2. Follow the instruction on the TTN website.
  3. After Sign up log in to your account
  4. Go to your console. You will find it in the dropdown menu of your profile (see picture)

Step 10: #TTN - Application Setup

* If you already have an application you can skip this step.

A application is an environment where you can store multiple node devices.

Instructions:

  1. When you are in the console click on applications (see picture 1).
  2. Click on "add application"
  3. You are now located in the add application window (see picture 2).
  4. Make a Application ID
  5. Give your Application a description
  6. Set your handler registration (depending on your location)
  7. When your done click "add application".

Step 11: #TTN - Payload Formats Setup

The payload setup is important for reading your incoming data information correctly.

Instructions:

  1. In the application overview click on "Payload Formats". (see picture 1 - green rectangle)
  2. Copy paste the function (check github link underneath) into the decoder editor. (see picture - blue rectangle)
  3. Click on the save button to save your result.

Function link for the decoder editor:

https://github.com/jokohoko/Mumo/blob/main/documentation/Payload_format.md

Step 12: #TTN - Add Devices

If everything goes well you are now in de Application overview. Where you have control over you application. We are now going to add a new device (node) to or application.

Instructions:

  1. Click on register device (see picture 1 - green rectangle)
  2. Enter a Device ID
  3. Set Device EUI to auto generated. Click on the crossing arrows on the left side.
  4. When your done click on "register device".
  5. The device is now created.

Step 13: #TTN - Device Settings

This step is really important to get a good connection of the LoRa setup of the devices.

Instructions:

  1. When you are in the device overview page click on "settings" (see picture 1 - green rectangle)
  2. In the settings page you can give a description to your device (don't have to)
  3. Set the activation mode to ABP.
  4. Check off "Frame Counter checks". You will find on the bottom of the page.
  5. Leave all the Device EUI, Device Address, Network Session Key, app session key to auto generation.
  6. Click on the save button to save the new settings.
  7. Go back to "settings" page. (see picture 3 - green rectangle)
  8. Set the activation mode back to OTAA!! (see picture 4 - green rectangle)

  9. Leave the App key to auto generation.

  10. Click on the save button to save the new settings.(see picture 5 - green rectangle)

Step 14: #Code - Arduino Code Download

Ok, so far so good. We have our node assembly, we have an account on the TTN, we created an application with the right payload format, and we made a device (OTAA) in that application. So now we only have to setup the Arduino code with the same settings information as the device we made in TTN. In the next step we will upload the code to the LoRaWan board in the node.

Instructions:

  1. Download the mumoV1 directory from the Github page.
  2. Download the latest version of arduino software. (https://www.arduino.cc/en/software)
  3. Open the arduino code file "mumoV1.ino" ( you will find the Github link underneath the instructions)

Github link:

https://github.com/jokohoko/Mumo/tree/main/mumoV1

Step 15: #Code - Arduino - Device Setup With TTN

Instructions:

  1. Open thethingsnetwork (TTN), go to your device overview where you will find all the settings information of the device. We are going to use this for setup the arduino code.
  2. In the arduino code go to "mumoV1.h" tab.

Setup node ID:

  1. Copy the device_EUI from the TTN and paste it in the arduino code (see purple arrow).
  2. Copy theapplication_EUI from the TTN and paste it in the arduino code (see blue arrow).
  3. Copy the app_key from the TTN and paste it in the arduino code (see green arrow).If the network_session_key is not visible click on the "eye" symbol (see the green circle).

  4. Copy the device_adress from the TTN and paste it in the arduino code (see yellow arrow).

  5. Copy the network_session_key from the TTN and paste it in the arduino code (see orange arrow). If the network_session_key is not visible click on the "eye" symbol (see the orange circle).
  6. Copy the app_session_key from the TTN and paste it in the arduino code (see red arrow). If the app_session_key is not visible click on the "eye" symbol (see the red circle).

Step 16: #Code - Arduino - Install RTC and Adafruit Library

  1. In you arduino interface click on Sketch > Include Library > Manage Libraries...
  2. The library management window will pop up.
  3. In the search bar type: rtczero
  4. Install the latest version of the first library
  5. In the search bar type: adafruit BME680 (For the BME680 sensor)
  6. Install the latest version of the first library
  7. In the search bar type: adafruit TSL2561 (For the TSL2561sensor)
  8. Install the latest version of the first library.
  9. In the search bar type: flashstorage ATSAM
    Install the latest version of the first library.

Step 17: #Code - Arduino - Seeeduino LoRaWAN Library Install

We install the Seeed boards library to communicate with the board.

Instructions:

  1. In you arduino interface click on File > Preferences, and copy the url (underneath) to "Additional Boards Manager URLs" (see picture - red rectangle).
  2. Click on "ok".
  3. Back at the arduino interface click on Toos > Board > Board Manager.
  4. In the search bar type "lorawan".
  5. You will see the library of Seeed LoRaWan board. (see picture - green rectangle).
  6. Click on "install" and wait until it's done.

URL: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json

Step 18: #Code - Arduino - Board Selection / COM Port

Instructions:

  1. Connect the LoRaWAN board with a micro usb cable to your computer.
  2. In you arduino interface click on Tools > Board and select the "Seeeduino LoRaWAN" board. (see picture)
  3. Select in the same menu the correct COM port.

Step 19: #Code - Arduino - Upload the Code to the Board

Now that we have our code ready, it's time to put the code on to the LoRaWAN board!

Instructions:

  1. Make sure your LoRaWAN board is still connected to your pc.
  2. Double click the reset button on the side node. You will see that the led are flickering. This means that the device is in bootloader mode.
  3. Because of the bootloader modus we have to select a new COM port. This is done exacly the same as in step #18.
  4. Click on the upload button. It's the button with the arrow pointing to the right. (See picture - red circle).
  5. You should see "upload done" in the bottom right corner.

Step 20: #Code - Arduino - Test the Code!

Instructions:

  1. On the device overview of TTN click on "Data". There you will find all the incoming data that specific node device. (see picture - red rectangle)
  2. To test the data transmission, press the reset button on the side of the node device to send signal.
  3. If the LoRa signal is received by a gateway you will see the incoming data in you application data of the device on the TTN. (wait 30 to 40 second to see the result)
  4. If you don't see incoming data try to push the rest button on the side of the node device to send the signal again.
  5. If this is not helping, you back to step #18 and try to upload the code again.

Congrats you have now a working LoRa Node device!

  1. Remove the USB from the lorawan board.
  2. Push one last time on the rest button on the side of the node device.

Step 21: #Hardware - Assembly 5: Insert Battery Tray

Parts:

  • Battery tray

Instructions

  1. Insert the battery tray into the housing under an angle. Make sure you first position the power cable in the right direction. (see picture)
  2. First position the tray on to the support block wall where the cables are stuffed behind.
  3. Push the tray down until you hear a "snap click" sound.
  4. Check the corner that the tray has a nice fit into the main housing. (see picture 2 / 3 - red circles) // weg
  5. Insert the power cable on top of the I2C connection cables. Push it down with something blunt. be careful no to damage the cables.

Step 22: #Hardware - Assembly 6: Insert Batteries

Parts:

  • 6 x AA batteries (side node)

Instructions:

  1. Insert 6 x AA batteries in the correct orientation of the battery holders.
  2. Carefully push the cables of the battery down so that they do not interfere with the next step.

*side node: check the battery orientation of the battery holder. it may be different from the one in the picture

Step 23: #Hardware - Assembly 7: Back Cover

Parts:

  • 3D print - Back cover node

instructions:

  1. Insert the back cover lips into the lip grove of the main body housing under a slide angle.
  2. Push on the side of the housing and make sure it is is the right position.
  3. If the lips are not fitting because of print issues try to grind some of the surface until it fits. Check that the back cover is completely flat on the housing and that there are no seams.
  4. Insert the M3x16mm screws and tighten.

Step 24: #Hardware - Attachment of the Device

There are several ways to attach the device.

  1. Screw slide lock groove on the side.
  2. Screw slide lock groove on the back.

  3. Tiewrap groves on the side / top and back.

  4. The backcover of the node is also provided with a hook.