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
#Hardware - Ordering Parts
Parts to order:
See the github page for a recent overview:
#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)
#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!)
- Solder all the red cables together
- Solder all the black cables together.
- 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:
-
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,...
#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.
- Locate the charging LED (CHR) and the powerLED (PWR) (see top view picture with the green rectangles)
-
Cut the soldering of the LED. The LED should come loose.
-
Remove the leds and check if the parts where removed cleanly without damaging the traces underneath.
#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:
-
Connect one of the grove cables to the digital light sensor. And the other to the BME680 sensor.
- Place the sensors into the 3D print housing ("Node main body").
- 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.
- And screw both into place with the m2x5 mm screws.
#Hardware - Assembly 2: Seeed LoRaWan Board
Parts:
- Battery tray with battery holders
- Seeed LoRaWan board
- Main body node
- 4 x M2x5 screws
Instructions:
- Insert the power cable of the battery tray into the LoRaWan board.
- Bend the power cable over so the cables so they don't take up to much space.
- Insert the LoRaWan board into the housing with the usb connector and power cable first.
- Align the holes of the LoRaWan board with the mounting pins of the housing.
- Make sure to place the LoRaWan board next to the dividing wall. (see pictures)
- Insert the four screws into the indicated position of the board (see top view picture - Green circles)
- 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)
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.
-
Feed the antenna trough the foreseen opening in the battery support block, carefully thus not to break the antenna
#Hardware - Assembly 3: Connect I2C Pins
Instructions:
- 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)
#Hardware - Assembly 4: Cable Management - I2C Cables
Instructions:
-
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.
-
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.
#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:
- Sign up at The Things Network and make an account
- Follow the instruction on the TTN website.
- After Sign up log in to your account
- Go to your console. You will find it in the dropdown menu of your profile (see picture)
#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:
- When you are in the console click on applications (see picture 1).
- Click on "add application"
- You are now located in the add application window (see picture 2).
- Make a Application ID
- Give your Application a description
- Set your handler registration (depending on your location)
- When your done click "add application".
#TTN - Payload Formats Setup
The payload setup is important for reading your incoming data information correctly.
Instructions:
- In the application overview click on "Payload Formats". (see picture 1 - green rectangle)
- Copy paste the function (check github link underneath) into the decoder editor. (see picture - blue rectangle)
- 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
#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:
- Click on register device (see picture 1 - green rectangle)
- Enter a Device ID
- Set Device EUI to auto generated. Click on the crossing arrows on the left side.
- When your done click on "register device".
- The device is now created.
#TTN - Device Settings
This step is really important to get a good connection of the LoRa setup of the devices.
Instructions:
- When you are in the device overview page click on "settings" (see picture 1 - green rectangle)
- In the settings page you can give a description to your device (don't have to)
- Set the activation mode to ABP.
- Check off "Frame Counter checks". You will find on the bottom of the page.
- Leave all the Device EUI, Device Address, Network Session Key, app session key to auto generation.
- Click on the save button to save the new settings.
- Go back to "settings" page. (see picture 3 - green rectangle)
-
Set the activation mode back to OTAA!! (see picture 4 - green rectangle)
-
Leave the App key to auto generation.
-
Click on the save button to save the new settings.(see picture 5 - green rectangle)
#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:
- Download the mumoV1 directory from the Github page.
- Download the latest version of arduino software. (https://www.arduino.cc/en/software)
- Open the arduino code file "mumoV1.ino" ( you will find the Github link underneath the instructions)
Github link:
#Code - Arduino - Device Setup With TTN
Instructions:
- 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.
- In the arduino code go to "mumoV1.h" tab.
Setup node ID:
- Copy the device_EUI from the TTN and paste it in the arduino code (see purple arrow).
- Copy the application_EUI from the TTN and paste it in the arduino code (see blue arrow).
-
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).
-
Copy the device_adress from the TTN and paste it in the arduino code (see yellow arrow).
- 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).
- 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).
#Code - Arduino - Install RTC and Adafruit Library
- In you arduino interface click on Sketch > Include Library > Manage Libraries...
- The library management window will pop up.
- In the search bar type: rtczero
- Install the latest version of the first library
- In the search bar type: adafruit BME680 (For the BME680 sensor)
- Install the latest version of the first library
- In the search bar type: adafruit TSL2561 (For the TSL2561sensor)
- Install the latest version of the first library.
- In the search bar type: flashstorage ATSAM
Install the latest version of the first library.
#Code - Arduino - Seeeduino LoRaWAN Library Install
We install the Seeed boards library to communicate with the board.
Instructions:
- In you arduino interface click on File > Preferences, and copy the url (underneath) to "Additional Boards Manager URLs" (see picture - red rectangle).
- Click on "ok".
- Back at the arduino interface click on Toos > Board > Board Manager.
- In the search bar type "lorawan".
- You will see the library of Seeed LoRaWan board. (see picture - green rectangle).
- Click on "install" and wait until it's done.
URL: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
#Code - Arduino - Board Selection / COM Port
Instructions:
- Connect the LoRaWAN board with a micro usb cable to your computer.
- In you arduino interface click on Tools > Board and select the "Seeeduino LoRaWAN" board. (see picture)
- Select in the same menu the correct COM port.
#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:
- Make sure your LoRaWAN board is still connected to your pc.
- 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.
- Because of the bootloader modus we have to select a new COM port. This is done exacly the same as in step #18.
- Click on the upload button. It's the button with the arrow pointing to the right. (See picture - red circle).
- You should see "upload done" in the bottom right corner.
#Code - Arduino - Test the Code!
Instructions:
- 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)
- To test the data transmission, press the reset button on the side of the node device to send signal.
- 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)
- 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.
- 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!
- Remove the USB from the lorawan board.
- Push one last time on the rest button on the side of the node device.
#Hardware - Assembly 5: Insert Battery Tray
Parts:
- Battery tray
Instructions
- Insert the battery tray into the housing under an angle. Make sure you first position the power cable in the right direction. (see picture)
- First position the tray on to the support block wall where the cables are stuffed behind.
- Push the tray down until you hear a "snap click" sound.
- Check the corner that the tray has a nice fit into the main housing. (see picture 2 / 3 - red circles) // weg
- Insert the power cable on top of the I2C connection cables. Push it down with something blunt. be careful no to damage the cables.
#Hardware - Assembly 6: Insert Batteries
Parts:
- 6 x AA batteries (side node)
Instructions:
- Insert 6 x AA batteries in the correct orientation of the battery holders.
- 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
#Hardware - Assembly 7: Back Cover
Parts:
- 3D print - Back cover node
instructions:
- Insert the back cover lips into the lip grove of the main body housing under a slide angle.
- Push on the side of the housing and make sure it is is the right position.
- 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.
- Insert the M3x16mm screws and tighten.
#Hardware - Attachment of the Device
There are several ways to attach the device.
- Screw slide lock groove on the side.
-
Screw slide lock groove on the back.
-
Tiewrap groves on the side / top and back.
-
The backcover of the node is also provided with a hook.