- 3D printer with filament
- Solder iron / solder
- Small cutting plier
- Hot glue gun (or other fixation tools)
- Small screwdriver
See the shopping list an up-to-date overview:
Check the github page for the latest STL files: Node STL files
- 1x NODE_Main_Housing
- 1x NODE_Battery_Tray
- 1x NODE_Backcover
- PETG (preferred and more durable), but PLA also works.
- No support needed
- Infill not necessary
- 0.2 layer height
- 3 outside perimeters (for strength and durability)
- 2x battery case (Side node: You can also use just one battery case for 3 AA batteries but the live range will be shorter!)
- 1x JST 2.0 power connector (included with the Seeed LoRaWan board)
- 1x 3D printed part: battery tray
- 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.
- 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,...
- 1x LoRaWan board
- 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.
- 1x 3D print - "Node main body"
- 1x Digital light sensor (small sensor)
- 1x BME680 sensor (long sensor)
- 2x Grove I2C connector cables
- 4x M2x5 screws
- 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.
- > The parts from step 5
- 1x Battery tray with battery holders
- 1x Seeed LoRaWan board
- 4x M2x5 screws
- 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
- Connect the Grove cables to the i2C slots on the Seeeduino. Only the two connectors closest to the edge are I2C pins and are usable for our sensors. But you may interchange both sensors connector. (see picture - blue rectangle)
-
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.
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.
- 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)
If you already have an application you can skip this step.
A application is an environment where you can store multiple node devices.
- 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".
The payload setup is important for reading your incoming data information correctly.
- In the application overview click on "Payload Formats". (see picture 1 - green rectangle)
- Copy paste the Payload format into the decoder editor. (see picture - blue rectangle)
- Click on the save button to save your result.
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 the application.
- 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.
This Step is really important to get a good connection of the LoRa setup of the devices.
- 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)
This is a bit of a workaround that we needed to make this work properly. It should be possible without, but then we lost a lot of packages in TTN.
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 node.
- Download the mumoV1 directory from the Github page.
- Download the latest version of the arduino IDE from Arduino.cc
- Open the arduino code file
mumoV1.ino
- Make sure to download the entire folder with all the files included.
- 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).
The components we use need libraries for them to work.
- 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.
Also the board we use (Lorawan) needs to be added to Arduino to be able to programm it.
- In you arduino interface click on File > Preferences, and copy the url (underneath) to "Additional Boards Manager URLs" (see picture - red rectangle).
https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
- Click on "ok".
- Back at the arduino interface click on Tools > 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 installing all dependancies.
- 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.
Now that we have our code ready, it's time to put the code on to the LoRaWAN board!
- 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 might 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).
- After a while you should get an "upload done" notification in the bottom right corner.
- 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. (It might take a minute to see the result)
- If you don't see incoming data try to push the rest button on the side of the node device again to re-send the signal again.
- If this is not helping, you back to Step 18 and try to upload the code again.
- You can open the terminal window in Arduino to check if no errors are showing up like bad connections to the sensors or obvious errors that the code can recognize.
- Congrats you have now a working LoRa Node device!
- Remove the USB cable from the lorawan board.
- Push one last time on the rest button on the side of the node device.
- This resets the led's so they don't stay lit.
- > The assembly stack from step 6: Battery tray
- 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.
- If needed: Push it down with something blunt.
- Be careful not to damage the cables.
- 6x AA batteries
- Insert the batteries into the battery holders.
- make sure the batteries have decent contact.
Side node: Check the battery orientation of the battery holder. This may vary per tray type.
- 1x 3D print - Back cover node
- 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 open seams.
- Insert the M3x12mm screws and tighten.
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.
- And the backcover of the node is also provided with a hook.