Build the RPal BT IRx1T (infrared + thermocouple)

The IRx1T measures the bean temperature (BT) with an infrared sensor: it looks at the beans instead of touching them, which suits roasters where a probe can't sit in the bean mass, such as hot-air and fluid-bed roasters. A thermocouple reads the environment temperature (ET), and the screen shows both, plus the infrared sensor's own temperature (ROOM).

If a probe can sit in your beans, the x2T LCD is simpler and usually more accurate.

Parts

  • 1 × LilyGO TTGO T-Display (the ESP32 version with the 1.14" screen, 135 × 240 pixels)
  • 1 × MLX90614 infrared sensor board, 3.3 V version (often sold as GY-906)
  • 1 × MAX6675 board with a K-type thermocouple (see choosing thermocouples)
  • About 10 female-to-female jumper wires, or a small breadboard to share the 3V and G lines
  • A USB data cable and a USB power supply or power bank

Choosing the infrared sensor

The sensor sees everything inside a cone in front of it, and the reading is the average of all of it. The common, cheapest MLX90614 (with BAA in its full name) has a very wide 90° cone, so it also sees the roaster's walls. If you can, buy a narrow one: BCF (10°) or DCI (5°). It then only sees the beans from further away.

1. Wire it

Wiring: MLX90614 VIN to 3V, GND to G, SDA to GPIO 21, SCL to GPIO 22; MAX6675 VCC to 3V, GND to G, SCK to 12, CS to 13, SO to 15
RPal BT IRx1T wiring

The infrared sensor:

  1. VIN → 3V
  2. GND → G
  3. SDA → 21
  4. SCL → 22

The MAX6675:

  1. VCC → 3V
  2. GND → G
  3. SCK → 12
  4. CS → 13
  5. SO → 15

Both boards share 3V and G, so join those lines first: a small breadboard, a jumper wire with two ends crimped together, or a short soldered "Y". The T-Display usually comes without pins fitted, so you may need to solder its two pin strips on.

Screw the thermocouple's two wires into the MAX6675's + and − terminals. Thermocouple wire colours differ between standards (yellow or green is usually +), so if the temperature falls when the probe warms up, swap the two wires.

Use 3V, not 5V: the board reads its pins at 3.3 volts.

2. Put the code on the board

  1. Set up Arduino IDE once: Set up Arduino IDE for ESP32.
  2. Install two libraries in Tools › Manage Libraries:
  3. TFT_eSPI by Bodmer
  4. Adafruit MLX90614 Library. When it asks to install Adafruit BusIO too, press Install all.
  5. Tell the screen library which screen you have. This is a one-time edit of one file:
  6. Open the folder Documents › Arduino › libraries › TFT_eSPI and open User_Setup_Select.h in a text editor (or in Arduino IDE with File › Open).
  7. Near the top, find the line that ends with User_Setup.h (it starts with #include) and put // at its start.
  8. Further down, find the line with Setup25_TTGO_T_Display.h and remove the // at its start.
  9. Save the file.
  10. Download RPal_BT_IRx1T.ino and open it in Arduino IDE.
  11. Plug in the T-Display, choose ESP32 Dev Module and the port, and press Upload.

A warning about TOUCH_CS while it builds is normal: this screen has no touch.

If you update TFT_eSPI later, the library manager replaces User_Setup_Select.h, so make the edit in step 3 again.

3. Test it

Open Tools › Serial Monitor at 115200 baud. You should see a line every second, and the same numbers on the screen:

BT (IR): 21.40 C ROOM: 22.10 C ET: 22.50 C

  • Point the infrared sensor at your hand from a few centimetres: BT climbs towards 33 °C.
  • Hold the thermocouple tip between your fingers: ET climbs towards 30 °C.
  • If BT and ROOM say nan and the Serial Monitor says MLX90614 not found, check the SDA, SCL, 3V and G wires. Swapped SDA and SCL is the most common mistake.
  • If ET says nan (and the screen shows a red ---), check the MAX6675's wires and that the thermocouple is screwed in tightly.

The screen shows ROOM at the top, BT in yellow and ET in blue, with the status above: Waiting for app or App connected.

The two buttons beside the screen:

  • one (GPIO 0) switches between °C and °F
  • the other (GPIO 35) changes the brightness

The app gets the unit shown on the screen. Set it to the same unit as the app before you roast, and don't switch it during a roast. The device remembers your choice when it's switched off.

Colours look wrong (white background, odd colours)? In the code, change INVERT_DISPLAY from true to false and upload again.

4. Connect Roasters Pal

  1. Power the thermometer from USB (the computer, a phone charger or a power bank).
  2. In the app open Settings › Bluetooth › Connect and press the search button.
  3. Press Connect next to RPal BT IRx1T.
  4. Tap the BT card and the ET card: each starts its readings. The ROOM card is optional.

Want to use the thermocouple as BT instead, for example to compare the two? Turn on Use ET for BT in the app's Settings.

5. Fit it to your roaster

  • Point the infrared sensor at the moving beans, as close as you can without heating the sensor, and keep the walls of the roaster out of its view as much as possible.
  • Keep the sensor itself cool. It works up to 85 °C. The ROOM reading is the sensor's own temperature: if it climbs above about 60 °C during a roast, move the sensor further away or shield it from the hot air.
  • Normal glass blocks infrared, so the sensor can't look through a glass window. It needs an open hole or gap.
  • Infrared reads the bean surface, and the code assumes a surface that gives off heat perfectly. Beans read a few degrees low, but the same way every roast, so curves from roast to roast compare well.
  • Keep the T-Display and the MAX6675 away from heat and the thermocouple cable away from heater and motor cables.

Changing settings in the code

Near the top of the code, under Settings:

  • READ_INTERVAL_MS · how often it reads and sends (1000 = once a second). Don't go below 250: the MAX6675 needs that long for a reading.
  • IR_SMOOTHING · 3 calms the infrared reading as beans tumble past. 1 turns smoothing off.
  • SMOOTHING · the same for the thermocouple (5 by default).
  • INVERT_DISPLAY · change to false if the screen's colours look inverted.

Don't change the device name or the UUIDs: the app recognises the thermometer by them.

Something not working? See When something doesn't work.