Protocentral easyEMG MicroPython Library
MicroPython library for the Protocentral easyEMG Breakout: single-channel surface EMG (sEMG) over I²C / Qwiic. It gives you the raw band-limited waveform and computes the RMS envelope in software. The same driver also runs on a Raspberry Pi.
Don't have one? Buy it here
Wiring, electrode placement and troubleshooting are in the easyEMG Getting Started guide.
Links
| Product page | https://protocentral.com/product/easyemg-surface-emg-breakout-qwiic/ |
| Getting Started guide | https://protocentral.com/product/easyemg-surface-emg-breakout-qwiic/docs/getting-started/ |
| Arduino library | https://github.com/Protocentral/protocentral_easyemg_arduino |
| Hardware design files | https://github.com/Protocentral/protocentral_easyemg_hardware |
Features
- Raw sEMG in µV at the electrodes, on a paced 500 SPS clock with missed-sample counting
- Sliding-window RMS envelope, activation threshold and %MVC
MvcRecorder, the same MVC recording step as the Arduino OpenView sketch- Optional mains notch (fundamental or every harmonic) and digital high-pass
- A port of the Arduino library 1.1.0: the same API in snake_case, and a Python version of every Arduino example
Not a medical device. For research and education only. The breakout has no patient isolation: when electrodes are on a person, power the host from a battery or connect through an easyISO isolated Qwiic adapter. On a mains-powered host you get no EMG at all.
Installation
MicroPython (Raspberry Pi Pico, ESP32, …):
mpremote mip install github:Protocentral/protocentral-micropython-easyemg
This also installs the TLA20xx driver. With Thonny, copy protocentral_easyemg.py and protocentral_tla20xx.py to the board instead.
Raspberry Pi, with I²C enabled (sudo raspi-config nonint do_i2c 0):
python3 -m venv ~/easyemg && source ~/easyemg/bin/activate
pip install protocentral-easyemg
Quick Start
from machine import Pin, I2C
from protocentral_easyemg import EasyEMG
i2c = I2C(0, scl=Pin(5), sda=Pin(4), freq=400000) # Pico: GP5, GP4. Change for your board
emg = EasyEMG(i2c) # default address 0x48
if not emg.begin():
raise OSError("easyEMG not found")
emg.calibrate_baseline() # muscle relaxed, electrodes on
n = 0
while True:
if emg.update(): # True once per sample, 500 SPS
n += 1
if n % 50 == 0: # print 10 times a second
print(emg.last_envelope(), emg.missed_samples())
On a Raspberry Pi, replace the I²C lines with from protocentral_tla20xx_linux import I2C and EasyEMG(I2C(bus=1)).
Call update() as often as you can; it samples only when the clock is due, and never blocks. If missed_samples() grows, print less or lower the rate with set_sample_rate(). Filters need that same rate: set_mains_notch(50, emg.sample_rate_hz()).
API Reference
| Method | Description |
|---|---|
EasyEMG(i2c, address=0x48) / begin() |
Construct / configure the ADC. begin() returns False if the board doesn't answer |
update() |
Non-blocking. Takes one sample when the clock is due; True if it did |
last_microvolts() / last_envelope() |
The latest sample and RMS envelope, in µV at the electrodes |
set_sample_rate(hz) / missed_samples() |
Paced clock, default 500 SPS / samples it couldn't take on time |
set_envelope_window(n) |
1–128 samples, default 64 (128 ms at 500 SPS) |
set_mains_notch(hz, fs) / set_notch(hz, fs) / set_high_pass(hz, fs) |
Optional filters, off by default |
calibrate_baseline(n) / set_baseline(n) |
Measure and subtract the resting offset |
set_activation_threshold(uv) / is_active() |
Compare the envelope with a threshold |
set_mvc(uv) / read_percent_mvc() / MvcRecorder |
%MVC normalisation and the MVC recording step |
The full API, including the unpaced reads and low-level ADC passthroughs, is documented in protocentral_easyemg.py.
Examples
| # | Example | Description |
|---|---|---|
| 01 | easyemg_simpletest.py / easyemg_raspberrypi.py |
Raw µV and envelope (MicroPython / Raspberry Pi) |
| 02 | easyemg_plotter.py |
sEMG and envelope for Thonny's plotter |
| 03 | easyemg_calibration.py |
Baseline zeroing and your resting noise floor |
| 04 | easyemg_envelope.py |
RMS envelope, MVC recording and %MVC |
| 05 | easyemg_activation_led.py |
Flex to light an LED, with an automatic threshold and hysteresis |
| 06 | easyemg_openview.py |
Stream to OpenView 3.4+ (easyEMG Breakout), with the MVC step. Save it to the board as main.py, then close Thonny or mpremote before connecting OpenView |
| 07 | easyemg_diagnostics.py |
I²C, ADC, sample-rate, noise and mains-hum checks. Run this first if something is wrong |
The examples default to QT Py ESP32-C3 pins: change the I2C(...) line for your board.
License
- Software: MIT, see LICENSE.md
- Hardware: CERN-OHL-P v2, in the hardware repo
Copyright (c) 2026 Protocentral Electronics.
Support
Open an issue on GitHub or email support@protocentral.com.
Metadata
Release files for protocentral-easyemg 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| protocentral_easyemg-0.2.0.tar.gz | 28.1 kB | With provenance | Details for protocentral_easyemg-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| protocentral_easyemg-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for protocentral_easyemg-0.2.0-py3-none-any.whl |
Total release size: 40.3 kB
Release files / protocentral_easyemg-0.2.0.tar.gz
| Download URL | protocentral_easyemg-0.2.0.tar.gz |
|---|---|
| Size | 28.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4331275920c4cb7ddc56f1eefaa8dcc36ad75ec8bd9b0c4b0ae4240d7568bd46
|
|
BLAKE2b-256 checksum How to use checksums |
d5dcc5013903034e4958773c2f21aaca5a30884ebe08860fd3de0da54a6cf9e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logRelease files / protocentral_easyemg-0.2.0-py3-none-any.whl
| Download URL | protocentral_easyemg-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5243083d8dae1b45a6f09f5203328f04e8a842c55883d59435dcd40e34c8d918
|
|
BLAKE2b-256 checksum How to use checksums |
5e237b3241420161da9fb9fcac0bddbbf03a06ce15e2179a4a0cb0d7cee59bbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logSecurity for protocentral-easyemg 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for protocentral_easyemg-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.