Skip to main content

Inkplate 10 MicroPython - Battery and temperature

Inkplate 10 includes built-in functions for measuring battery voltage and board temperature. This example shows how to read these values and display them on screen.

⚠️
You need a Li-ion battery for this example to work, to learn more, check out battery docs page.

Battery should be connected like this:

Inkplate 10 running the example code
Battery connected to Inkplate 10.

Reading battery voltage and temperature

from inkplate10 import Inkplate
import time

inkplate = Inkplate(Inkplate.INKPLATE_1BIT)
inkplate.begin()
inkplate.clearDisplay()
inkplate.display()

# Get battery voltage as a string
battery = str(inkplate.readBattery())
inkplate.setTextSize(2)
inkplate.printText(350, 350, "Battery voltage: " + battery + "V")
inkplate.partialUpdate()

# Get temperature reading as a string
temperature = str(inkplate.readTemperature())
inkplate.printText(350, 400, "Temperature: " + temperature + "C")
inkplate.partialUpdate()

inkplate.readBattery()

Measure the current battery voltage of the Inkplate board.

Returns type: float

Returns value: Battery voltage in volts.

inkplate.readTemperature()

Measure the temperature of the Inkplate board’s internal sensor.

Returns type: float

Returns value: Temperature in degrees Celsius.

Inkplate 10 running the example code
Displaying battery and temperature data on Inkplate display.