The new Mindstorms v4 and SPIKE Prime hubs include a 2100mAh Lithium-ion battery. How long is it expected to last when running a program?
Power consumption and battery life will of course vary based on the load that the hub is driving. Philo has an extensive analysis for motor power consumption, so I'll just look at what the hub itself consumes while running a program to come up with a baseline battery life estimate.
I've uploaded a test Python program to my hub that gently blinks a heartbeat LED:
import hub,utime while True: hub.led(0,0,10) utime.sleep_ms(500) hub.led(0,0,0) utime.sleep_ms(500)
In order to measure the current draw, I first wired up the battery to the hub with the battery outside the hub:
I then connected a basic multimeter up in series with the hub as a current sensor:
We can see that the Hub with the simple program running consumes about 150mA of current. Assuming ideal usage of the included 2100mAh battery, the hub should be able to run for approximately 2100mAh / 150mA = 14 hours while not driving any peripherals.
Peripherals such as motors (and even the LED display) quickly dwarf the power consumption of the hub itself, but under normal usage we should expect to see several hours of battery life.