Sunday, June 26, 2016

LoRaWAN FeatherWing for Adafruit Feather

In this post I will document a new custom FeatherWing I have designed to add the MicroChip RN2483/RN2903 LoRaWAN module to Adafruit Feather.

Help your Feather fly into the IoT clouds with this awesome
LoRaWAN module from MicroChip.


Introduction


I have designed some FeatherWings in the past to add a LoRa transceiver module to Feather. I did the LoRa FeatherWing Development Breakout and the LoRa FeatherWing IOX that used the HopeRF RFM95/96(W) modules. The RFM modules are small and cheap, which is great for IoT projects. However, they have a limitation if you want to use them with LoRaWAN: the stack is not implemented in the module, leaving that burden to the microcontroller. The LoRaWAN stack takes a fair amount of code space, and it's difficult to implement in some 8-bit microcontrollers.

This new FeatherWing uses the RN2483 (868 MHz) or RN2903 (915 MHz) from MicroChip. It's an excellent module that fully implements the LoRaWAN stack itself. The microcontroller talks to it over USART with a simple command structure to configure it and send/receive messages. The module also has several GPIO pins available. This is the preferred module on The Things Network, and there are a lot of great example projects and code on the Internet to help you get started.

My FeatherWing is very simple. It connects the module serial pins and the module Reset pin to the Feather. It has an SMA connector for attaching an antenna, and a small white silk-screen box for writing in a node ID or other information. GPIO10 from the RN module is attached to an LED for status indication. Finally, I added an ICSP connector for the module that is compatible with the PicKit3. You'll probably never need this, but it can be used to update the firmware on the module if that is ever necessary.

Challenges


Despite the simplicity of the FeatherWing, there was a unique challenge along the way. The RN module is a bit wide, and in fact nearly as wide as the header spacing on the Feather boards. My first revision of this board used a very narrow footprint for the module and normal through-hole headers. It was extremely difficult to solder. Though I made two functional boards with that PCB, I didn't think it was suitable to release as a shared project.

My solution was to make the FeatherWing a bit wider (1" wide instead of the normal 0.9") and use surface mount headers on the bottom. This is the first "wide-body" FeatherWing that I have seen.

 Surface mount headers on the bottom of the LoRaWAN FeatherWing.
Notice that the board is a bit wider than normal FeatherWings.

Compatability


This board is compatible with Feather M0, Feather 32U4, and Feather WICED.

It is NOT compatible (as-is) with Feather HUZZAH (ESP8266). The single hardware USART on the HUZZAH is tied to the USB-Serial chip, and other things shouldn't be connected to those pins. If you really want to use the HUZZAH, you can:
  • Pick a software serial library for ESP8266
  • Download the Eagle design files
  • Modify the board so that the serial pins from the RN module go to the pins you want to use for software serial
  • Order your custom PCB on OSH Park or whatever service you like

Because this FeatherWing is wider than normal FeatherWings, it probably won't work on a Doubler. The board will overlap with the Feather and prevent it from being fully seated.

Shared as Open Source Hardware (OSHW)


Eagle Files: Shared on Github
Grab my Eagle parts library if you want to edit the footprints: Shared on Github

LoRaWAN FeatherWing: Order PCBs on OSH Park!

LoRaWAN FeatherWing Schematic

LoRaWAN FeatherWing Board Layout
 
Parts List:

LoRaWAN Module: MicroChip RN2483 (868 MHz) or RN2903 (915 MHz)
RF Connector: SMA or RP-SMA Edge-Launch for 1.6mm/0.062" board thickness
12-pin Header: 0.1" SMD, Female (Digikey) or make your own Male connector (see below)
16-pin Header: 0.1" SMD, Female (Digikey) or make your own Male connector (see below)
R1, R2: 680 ohm 0603 SMD (or adjust value to change brighness of LED)
PWR, G10 LEDs: 0805 SMD (color of your choice)
C1: 1uF 0603 SMD
C2: 470nF 0603 SMD

Notes: C1 and C2 are located on the bottom of the board. The ICSP header is rarely used and you don't need to solder headers to that. Be sure to pick the correct LoRaWAN module (frequency) for your country/region.

Make Your Own Male Surface Mount Headers


I typically avoid surface mount headers because they are more expensive and not something I have sitting around in the parts bin. Thankfully you can make your own surface mount male headers from right-angle breakway header strips.

Using a pair of pliers, pull every other pin on the header out of the plastic spacer, rotate it 180 degrees, then re-insert it. Next cut the pins a bit shorter so that they fit within the footprint on the PCB. Super easy and cheap. The below picture should make that more clear:

Make your own SMD male headers from right-angle breakway strips.


Software and Usage


These are the pin connections from the RN module to the Feather. On all three of these Feather variants, call "Serial1" to talk to the module instead of "Serial" in the Arduino IDE. The default baud rate is 57600. Drive Reset HIGH to enable the module.

Pin connections for Feather M0, 32U4 and WICED.

Here are some good software examples available on the Internet for using this module:
  • Great blog post on using the RN2483/2903 in Peer-to-Peer mode. This is useful for testing your boards and learning about the command interface to the modules.
  • Write-up on taking the next step into LoRaWAN and making a TTN node. The software is shared on Github.
  • This is the Command Reference for the RN modules. Definitely download a copy of this.
Finally, the status LED on the LoRaWAN FeatherWing is connected to a GPIO pin on the RN module, not the Feather. If you can make it blink with your program, that is great confirmation that the module is operational and talking to the Feather. The command is "sys set pindig GPIO10 1" to turn it on and "sys set pindig GPIO10 0" to turn it off.

Conclusion


This was a long post for a simple board! I hope you find this little FeatherWing useful. If you have any questions or feedback please post in the comments below. Finally, if you make your own LoRaWAN FeatherWing definitely tweet me a picture @sync_channel.

Thanks for reading!

- Dan W.

12 comments:

  1. Very nice, Dan. Thanks for the tip on the right angle headers becoming SMD headers. It appears your softbox is turning out some great lighting for these projects.

    ReplyDelete
  2. Dan, very impressive. Thanks for the efforts you are sharing with the LoRaWAN community.

    >>You'll probably never need this, but it can be used to update the firmware on the module if that is ever necessary.

    Why did you say this? Why don't you think MicroChip will need to update their firmaware?

    Asking as a novice.
    Terrence

    ReplyDelete
    Replies
    1. I didn't want people to see that header and assume they'll need a PicKit3 to use this board. But it's certainly a good feature if we ever need to update our firmware! Thanks for your interest in the project.

      Delete
  3. Put me down for an 'assembled' order. I don't do SMD. (yes, I know, everyone says it's easy)

    ReplyDelete
  4. Good job Dan, is the module easily be mounted on a breadboard ?

    ReplyDelete
    Replies
    1. The header spacing is breadboard compatible, but it's meant to be mounted on a Feather, not really used by itself. You would be better off with a breakout board for use on a breadboard. There is at least one on Tindie.

      Delete
  5. hi Dan
    I would also take one "assebled version"
    b.t.w. using it with a doubler a pair of headers could be put in between.

    ReplyDelete
    Replies
    1. Hi Urs, yes if you pick the correct combination of headers (stacking headers to raise it above the Feather) then it will work. I just didn't want to give the impression that it's 100% compatible and make someone disappointed when they try the board out. Thanks as always for your feedback.

      Delete
  6. Very original the SMD Headers, thanks for sharing!

    ReplyDelete
  7. on your next board, if it has so much space for the components, PLEASE use 1206 size. the smaller ones are ugly difficult to solder by hand. thanks!

    ReplyDelete
  8. Many thanks Dan for sharing this design. We made 12 of them, work like a charm with our Kerlink LoRaWAN base station.

    Franck

    ReplyDelete