Power Board API

There are a few things that can be done with the power board, namely current and voltage sensing, and beeping. See the Power Board hardware page for more details.

Accessing the Power Board

The power board can be accessed using the power_board property of the Robot object.

from sr.robot3 import *
robot = Robot()

my_power_board = robot.power_board

Power Outputs

Each of the power board’s controllable outputs has a constant whose name closely matches the name of the output:

  • H0 : OUT_H0
  • H1 : OUT_H1
  • L0 : OUT_L0
  • L1 : OUT_L1
  • L2 : N/A (Not Controllable - This port is used to power the Brain Board)
  • L3 : OUT_L3

Both of the 5V outputs are controlled together.

All the ports are turned on when your code starts running, you can then control whether each output is turned on or off like so:

# Turn output H0 off
robot.power_board.outputs[OUT_H0].is_enabled = False

# Turn output L0 on
robot.power_board.outputs[OUT_L0].is_enabled = True

# Find out whether L3 is enabled

# Find the current (in Amps) being used by L3

You can also control all the outputs together:

If you turn off the power output which is powering another one of your boards, they will appear to be missing and your code will break if you try to control them.

Battery Status

The power board can report both the battery voltage, in Volts, and the current being drawn from it, in Amps. You can access these values like so:

# Print the battery voltage in volts

# Print the battery current in amps
  • A fully charged battery will measure 12.6V.
  • The power board will turn off and signal a low battery at 10.2V.
  • The discharge curve is roughly linear between 11.4V and 10.4V.


The power board has a piezo buzzer which can beep.

The buzz function accepts multiple parameters, depending on what you want to play.

  • The first argument is either the note you want to play, or the frequency of the buzzer in Hertz.
  • The second argument is the duration of the beep, in seconds.

The Note enum provides notes in scientific pitch notation between C6 and C8. You can play other tones by providing a frequency.

The frequency on the buzzer is limited from 8Hz to 10,000Hz

Calling buzz is non-blocking, which means it doesn’t actually wait for the piezo to stop buzzing before continuing with your code. If you want to wait for the buzzing to stop, use the blocking argument.

# Beep for 0.5s in D., 0.5)

# Beep for 2s at 400Hz, 2)

# Beep for 3s at 250Hz and wait for it to finish, 3, blocking=True)

Start Button

You can manually wait for the start button to be pressed, not only at the start.


This method will block until the start button is pressed. This may be useful for testing, but be sure to remove it in the competition, as you won’t be allowed to touch the start button after a match has begun!