Kmeter Unit
The Kmeter Unit
is a K-type thermocouple sensor with I2C communication interface. The hardware adopts ESP32-C3 main control + MAX31855KASA+T 14bit thermocouple digital conversion chip. The conversion chip supports thermocouple probes with a measuring range of -200°C to 1350°C.
Supported Products:
Micropython Example:
import os, sys, io
import M5
from M5 import *
from hardware import *
from unit import KMeterUnit
import time
i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000)
kmeter_0 = KMeterUnit(i2c0, 0x66)
print(kmeter_0.get_firmware_version())
while True:
print(kmeter_0.get_thermocouple_temperature(kmeter_0.CELSIUS))
print(kmeter_0.get_internal_temperature(kmeter_0.CELSIUS))
time.sleep_ms(250)
UIFLOW2 Example:
class KmeterUnit
Constructors
Methods
- KmeterUnit.get_thermocouple_temperature(scale) float
Get the temperature of the thermocouple in the Kmeter Unit. Returns a float value.
- Parameters:
scale (bool) – accepts values of
KmeterUnit.CELSIUS
orKmeterUnit.FAHRENHEIT
.
UIFLOW2:
- KmeterUnit.get_internal_temperature(scale) float
Get the internal temperature of the Kmeter Unit. Returns a float value.
- Parameters:
scale (bool) – accepts values of
KmeterUnit.CELSIUS
orKmeterUnit.FAHRENHEIT
.
UIFLOW2:
- KmeterUnit.get_sleep_time() int
Get the sleep time in seconds. Returns a int value.
Return:
int
: 0 ~ 65535.
UIFLOW2:
- KmeterUnit.get_firmware_version() float
Get the firmware version of the Kmeter Unit. Returns an integer version number.
Return:
float
UIFLOW2:
- KmeterUnit.get_i2c_address() int
Get the i2c address of this device should be between 0x08 and 0x77.
Return:
int
: 0x08 ~ 0x77.
UIFLOW2:
- KmeterUnit.set_sleep_time(sleep) None
Set the sleep time in seconds.
- Parameters:
sleep (int) – 0 ~ 65535
UIFLOW2: