LoRa Node project



A LoRa node based on RAK4260 (SAMR34) Module

WORK IN PROGRESS, watch this space

RAK 4260 module

My future node designs will all be based on RAK4260 modules which incorporate Atmel/Microchip's SAMR34J18B SiP. The R34 SiP itself comprises an ATSAML21J18B ultra-low-power CotexM0+ processor plus a LoRa compatible UHF transceiver. IMHO this part offers an unbeatable combination of low-power, low-cost, small-size & high-performance currently available for the heart of any LoRa node. Unfortunately it has a couple of drawbacks: it's available only in BGA packaging (which I can't hand-solder) and there's a significant amount of external RF circuitry required before the antenna. Both these issues are swept away by RAK's excellent 4260 module which embeds the SAMR34, all its associated RF circuitry and XTAL oscillators in a neat little 15mm-square screened module:

There's a small down-side: sadly RAK did not adopt the same GPIO usage as on Atmel/Microchip's SAMR34 Xplained board. This means that none of the example software on Microchip's SAMR34 web-site will work out-of-the-box. check-out PB03, PA28, and PA09. RAK's one piece of example code is a copy of Microchip's but with some quick and dirty modifications to fix the above incompatibilities. It's available to clone from github via a link on their 'Quick-Start' -> 'Burning the Firmware' guide and runs on their 4260 eval board, see below. Documentation for RAK's evaluation board is currently rather sketchy, here's a random list of some of the things I've learned so far:

  • RAK's 'Burning the Firmware' documentation is misleading...
  • You DO need a J-Link unit to program RAK's 4260 evaluation board.
  • The J-Link signals must be hand wired to the eval board's J4 connector thusly:
        J-link pin  Signal   J4 pin  RAK4260 pin
        ----------  -------  ------  -----------
        7           SWDATA   2       31
        9           SWDCLK   3       30
        1           Vdd      1       11,12
        4,6,8 etc   GND      4       10,18,28,36 etc
        15          RESET    n/a     29
        Alternatively see our J-link adapter board below 
  • The schematic for the 4260 'stamp' carrier board (that fits to the 5005) is incomplete.
  • The schematic for the RAK5005 base-board is not currently published but...
  • The eval-board USB port is for both power & serial comms.
  • The 5005 base-board includes an FTDI-type chip wired to push UART1 out through the USB port.
  • The SAMR34's native on-chip USB port is not used by RAK's demo software or eval hardware.
  • The demo software actually uses UART1 at 115.2Kbaud for debug and user interaction.
  • The quick-start stuff re Segger J-Flash etc is a waste of time - it demands a s/w license but...
  • You can drive your J-Link/Atmel-SAM-ICE SWD programmer direct from Atmel Studio 7.
  • Don't bother with RAK's serial tool, use TeraTerm or Putty or any of the many others.
  • Refer also to Atmel's SAM-R34-MLS-Getting-Started guide #DS50002812A (for R34 Xplained h/w).
  • There's a Device EUI printed on each 4260 module but it is not actually stored in the device.
  • You must update the device EUI, TTN Application EUI and AppKey fields in conf_app.h
  • The above changes may not take effect until you 'Clear PDS' from the 'Main menu'
  • The sample code requires A LOT of work to make it remotely useful, but all the pieces are there.
  • Check this link re extended sleep times: https://www.microchip.com/forums/FindPost/1121324
  • If you want to use the ADC you'll have to modify temp_sensor.c to release the ADC after use.
  • Bug fix required in RAK's example code to correct missing radio switch chip activation:
       file: radio_driver_hal.c edit these two existing functions like so:
    
        void HAL_TCXOPowerOn(void)
         {
          port_pin_set_output_level(TCXO_PWR_PIN, TCXO_PWR_ACTIVE);
          port_pin_set_output_level(RFSW_PWR_PIN, RFSW_PWR_ACTIVE); // also enable RF switch
          delay_ms(RADIO_CLK_STABILITATION_DELAY);
         }
        void HAL_TCXOPowerOff(void)
         {
          port_pin_set_output_level(TCXO_PWR_PIN, TCXO_PWR_INACTIVE);
          port_pin_set_output_level(RFSW_PWR_PIN, RFSW_PWR_INACTIVE); // also disable RF switch
         }
    


    J-Link adapter board

    We designed this little board to facilitate in-system programming of RAK4260 modules without the need for any on-board JTAG/SWD support. With this board up your sleeve you'll be able to make super-small nodes with no SWD connector or infrastructure. The board uses a 20-pin pin-header to connect to a J-link box and 9 pogo pins to locate onto the 4260 module. Four links are provided for enabling pull-up resistors on the signal pins as required. Eg the datasheet states that a 1K pull up is mandatory on SWCLOCK. Design files available below. Pins: Multicomp p/n P50-B-120-G, Farnell:1568260.



    4-20mA sensor node

    Coming soon is a design for a LoRa node that interfaces to any 4-20mA sensor unit eg water depth, IR temperature etc. To feature:

    • 9-15V supply with reverse polarity fuse protection
    • On-demand 24V boost supply for sensor drive
    • Micro-power 3v3 supply for LoRa module
    • 12-bit resolution ADCs
    • Built-in temperature sensor
    • Battery voltage monitoring
    • SWD programming & async-serial connectors
    • UFL antenna connector
    • Small 40 x 45mm SMT board
    • Very low power consumption - less than 5uA while sleeping
    • Years of life from a cheap rechargeable 12V SLA battery


    Resources
      Gerber file pack for our J-link to RAK4260 adapter PCB
      We highly recommend JLCPCB.com PCB manufacturer.
      RAK Store
      RAK's 4260 Schematics etc
      RAK's 4260 'Datasheet'
      RAK's 4260 Quick start
      RAK's 4260 GitHub
      Atmel/Microchip SAMR34 pages
      Check out our LoRa Gateway design here
     


  •       marvellconsultants.com