Experimental project around RFM radio modules using an AVR MCU

.github/ workflows Update build.yml 1 year ago
nbproject Include header and .a files from libs instead of copying them 8 months ago
.gitignore librfm (#20) 1 year ago
CODE_OF_CONDUCT.md Initial commit 1 year ago
LICENSE Initial commit 1 year ago
Makefile More colourful 16-Bit RGB Tux 8 months ago
README.md Update README.md 10 months ago
avrrfm.c More colourful 16-Bit RGB Tux 8 months ago
bitmaps.c More colourful 16-Bit RGB Tux 8 months ago
dejavu.c Use libtft (#33) 8 months ago
dejavu.h Include header and .a files from libs instead of copying them 8 months ago
i2c.c Add I2C, some cleanup 1 year ago
i2c.h Add I2C, some cleanup 1 year ago
mcp9808.c Resolve suspectibility to temperature changes (#7) 1 year ago
mcp9808.h Do not block CPU while waiting to receive temp. reading (#1) 1 year ago
pins.h Add SD card to transmit larger amount of data (#16) 1 year ago
rfm.c Include header and .a files from libs instead of copying them 8 months ago
sdc.c Include header and .a files from libs instead of copying them 8 months ago
spi.c RFM95 (#25) 11 months ago
spi.h RFM95 (#25) 11 months ago
tft.c Include header and .a files from libs instead of copying them 8 months ago
types.h Include header and .a files from libs instead of copying them 8 months ago
usart.c Improve RSSI - output power control loop by averaging (#23) 12 months ago
usart.h Improve RSSI - output power control loop by averaging (#23) 12 months ago
utils.h Read and display RSSI value (#4) 1 year ago
README.md

avrrfm

make

About

Experimental project around RFM radio modules using an ATmega328P MCU
and librfm69 (FSK)/librfm95 (FSK + LoRa).

To do something really extraordinary, the temperature reading of an MCP9808
sensor is periodically transmitted to the receiver.
To save battery power, the controller, radio module and temperature sensor
are put to power down/sleep mode in between transmissions. The idle current
is ~75µA, which is still quite a lot, but already better than 8mA 🙂
MCU, radio and temp sensor take about 5µA, so the TC1262 3.3V regulator seems
to account for ~70µA.
There is basic SD card support
that might be useful for something like a data logger.

IMG_20250413_184140

The receiver currently converts the raw temperature reading to °C and displays
it with the RSSI value, CRC result and transmitter output power on a nice IPS
TFT display. It responds to the transmitter as kind of ack with the RSSI, which
is used for some very basic power management in the transmitter, significantly
reducing the supply current by reducing the output power i.e. on short distance.
The transmitter waits for this response with a timeout so it won't be blocked
and consumes a lot of power just because there is no response coming back.

IMG_20250413_190306

Fun Stuff

Looking at the payload in the FSK modulated signal from the transmitter in URH (with an RTL-SDR Blog V4):

urh

The four selected payload bytes are:

  • 0b00000011 Payload length (address byte + 2 byte temperature value)
  • 0b01000010 Address (0x42)
  • 0b11000001 Upper byte of raw temperature value from MCP9808
  • 0b01010011 Lower byte of raw temperature value from MCP9808

Calculating the temperature (assuming >= 0°C):

jshell> (0b11000001 & 0x1f) * 16 + 0b01010011 / 16f
$1 ==> 21.1875

So, 21.2 °C 🙂

The first 15 0b10101010 bytes are the preamble, then there are 4 sync word
bytes. After the 4 payload bytes, there are 2 CRC bytes as described in the
datasheet of the RFM69HCW:

PackageFormat

LoRa

With LoRa, the signal of course looks a bit different:

urhLoRa

And it doesn't look like URH can decode LoRa for the time being.
Interesting information about decoding LoRa can be found at DecodingLora - RevSpace.

The chirps of the LoRa signal in the waterfall view of SDR++:

41_7kHz-SF10s

Silly Stuff

A hopelessly underpowered RFM95 in FSK mode going haywire (turn on sound):

https://github.com/user-attachments/assets/85de6b50-0ec8-4264-92a5-a77f90162c87