LoRa Weather Station

My project for this December is building a LoRa weather station.

I have a short background of programming in embedded C and working with radio. To further that experience, I plan on working with the RN2903 LoRa module from Microchip to send sensor data over an air gap to LoRaWAN, another MCU, or PC base station.

If this project is successful, I will use this technology to adapt my CAN-over-WiFi library to LoRa for longer range.

To begin this project, I will be working on an HCS12 to prototype communication to the RN2903. No reason for this, other than that I can use this as a project in my microprocessors class. Once I have the handshake with the RN2903 down, it can easily be converted to an ESP32 or SAM MCU.

The project goals are as follows:

  • DONE: Establish UART communications
  • DONE: Set radio config and transmit test message.
  • DONE: Error handling from UART responses
  • DONE: Translate ADC voltages into radio packet
  • DONE: Program checksum in packet
  • DONE: Receive packets and display on LCD

Stretch goals:

  • DONE: Program auto-frequency hopping to stay in FCC rules
  • Make program that records COM inputs to DB
  • Increase throughput to 0.5, 1, or 2 mB/s

I’ll probably release the code once I’m done with the class, or on request.

EDIT: Updated goals.

10 Likes

First successful radio transmissions.

2 Likes

Startup with TX unplugged. HCS12 rebooted after 25 errors (Left). TX is plugged back into the RN2903 and startup proceeds as normal (Right).

Moved packet into stuct for easy programming. Added frequency hopping function and currently set to sweeping. 125kHz bw, 25khz CW buffer, 902mHz - 927mHz.

3 Likes

Compiled 143 channels into an array that gets shuffled by the Knuth Fisher Yates algorithm. To sync with a future receive module, each packet transmits the next channel number it will swap to. This module is now legal with part 15 of FCC rules to transmit at 1W. This also guarantees modules will only be out of sync for a maximum of 4.8 seconds. Future goal may be to procedurally generate pseudo-random channels and sync using GPS.

2 Likes

Here’s the demo video of the project working. I’m going to swap to FSK and see how fast I can push the signal. I’m going to need to figure out how a can squeeze a 1mbps CAN bus into roughly 300kbps. Maybe there is some compression to be done or avoid sending the whole can frame if the data hasn’t changed.

I saw the title and thought “ok, here’s another battery sipping esp32 + rfm95 + battery + solar panel in a cute garden friendly looking 3d printed box”…

You have “a lot” going on there. What’s the story? Learning more / exploring radio stuff or…
… what’s the piece of this project that appeals to you most?

I always loved working with radio from the computer science side of things. Been doing a lot of embedded programming the past few years and this is research into wireless solutions. I also feel like there’s a lot more to learn from this approach. Arduino libraries don’t give you an appreciation for what’s going on at the register level.