Skip to content

Add support for reading transceiver temperature - #1792

Open
martinling wants to merge 8 commits into
greatscottgadgets:mainfrom
martinling:max283x-temp
Open

Add support for reading transceiver temperature#1792
martinling wants to merge 8 commits into
greatscottgadgets:mainfrom
martinling:max283x-temp

Conversation

@martinling

@martinling martinling commented Jul 1, 2026

Copy link
Copy Markdown
Member

All the MAX283x chips include a built-in temperature sensor, but we've never had support for reading it out in the standard firmware.

This PR adds:

  • Support for reading temperature on MAX2837, MAX2839 and MAX2831.
    • Switches the RSSI MUX to output the analog temperature, and samples with the LPC43xx ADC, giving ~0.3 degrees per LSB.
  • A new hackrf_read_temperature function to libhackrf.
  • Transceiver temperature to hackrf_debug:
$ hackrf_debug --temperature
Transceiver temperature: 26°C

@martinling

Copy link
Copy Markdown
Member Author

@miek I've revised this to use the same reading method on all boards - connect the analog temperature output to the LPC43xx ADC and read it that way. That gets us better resolution than was possible with the built in 5-bit ADC on the MAX2837 and MAX2839.

I'm getting responsive and generally similar readings on HackRF One r4 & r9, HackRF Pro, and rad1o, but the absolute numbers feel a bit high, so I think we still need to do some calibration.

@martinling martinling added this to the harmony milestone Jul 14, 2026
@martinling
martinling marked this pull request as ready for review July 25, 2026 20:49
@martinling

Copy link
Copy Markdown
Member Author

I've calibrated this as best as I can with a temperature probe and a hot plate. Refinements welcome :)

image

@martinling

Copy link
Copy Markdown
Member Author

Moved the CLI temperature reporting from hackrf_info to hackrf_debug as requested.

@martinling martinling assigned miek and unassigned martinling Aug 3, 2026
@miek

miek commented Aug 5, 2026

Copy link
Copy Markdown
Member

Looks good!

I did find the temperatures reported deviate a bit from when I test with a thermal camera pointed at the IC:

MAX2837 (r4-p2) reported Measured
29 33
35 39
43 50
50 57
MAX2839 (r9) reported Measured
28 33
32 37
39 45
43 50
MAX2831 (r1.1.1) reported Measured
21 32
26 36
32 42
41 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants