Experimental project around RFM radio modules using an AVR MCU
| nbproject | 1 year ago | ||
| .gitignore | 1 year ago | ||
| CODE_OF_CONDUCT.md | 1 year ago | ||
| LICENSE | 1 year ago | ||
| Makefile | 1 year ago | ||
| README.md | 1 year ago | ||
| avrrfm.c | 1 year ago | ||
| bitmaps.c | 1 year ago | ||
| bitmaps.h | 1 year ago | ||
| colorspace.c | 1 year ago | ||
| colorspace.h | 1 year ago | ||
| dejavu.c | 1 year ago | ||
| dejavu.h | 1 year ago | ||
| display.c | 1 year ago | ||
| display.h | 1 year ago | ||
| font.c | 1 year ago | ||
| font.h | 1 year ago | ||
| i2c.c | 1 year ago | ||
| i2c.h | 1 year ago | ||
| mcp9808.c | 1 year ago | ||
| mcp9808.h | 1 year ago | ||
| pins.h | 1 year ago | ||
| rfm69.c | 1 year ago | ||
| rfm69.h | 1 year ago | ||
| spi.c | 1 year ago | ||
| spi.h | 1 year ago | ||
| tft.c | 1 year ago | ||
| tft.h | 1 year ago | ||
| types.h | 1 year ago | ||
| unifont.c | 1 year ago | ||
| unifont.h | 1 year ago | ||
| usart.c | 1 year ago | ||
| usart.h | 1 year ago | ||
| utils.h | 1 year ago | ||
Experimental project to drive an RFM69HCW radio module with plain avr-libc
and an Atmega328p MCU.
This is work in progress. Simple Tx-Rx is working so far.
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 ~57 uA, which is still quite a lot (< 10 uA should be possible), but already
better than 8 mA :-)
The receiver currently just converts the raw temperature reading to °C and
displays it with the RSSI value on a nice IPS TFT display.
With the default ouput power setting (register RegPaLevel (0x11) set to 0x9f),
which should give +13 dBm with PA0, the range was very bad; just up to 10 m indoor
plain sight. Setting RegPaLevel to 0x5f, which also gives +13 dBm but with PA1,
changes it all: very good RSSI everywhere and in an actual "field" test, at 1.6 km,
packet reception was still reliable with an RSSI of about -100 dBm.
Looking at the payload in the transmitted signal in URH (with an RTL-SDR Blog V4):
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 MCP98080b01010011 Lower byte of raw temperature value from MCP9808Calculating 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: