Skip to content

movement-disorders/lab-nmes-tens-bluetooth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NMES/TENS Bluetooth Lab

A Python lab project exploring NMES (Neuromuscular Electrical Stimulation) and TENS (Transcutaneous Electrical Nerve Stimulation) protocols via Bluetooth Low Energy.

Lab Project: This is experimental research software. Use responsibly with proper medical guidance. See LEGAL.md for details.

What This Does

  • Connects to BLE-enabled NMES/TENS devices
  • Runs evidence-based stimulation protocols
  • Real-time parameter control and monitoring
  • GUI (PyQt6) and CLI interfaces
  • Dual-device support for bilateral sessions

Quick Start

# Clone and setup
git clone <repository-url>
cd lab-nmes-tens-bluetooth
./setup.sh

# Run
source venv/bin/activate
python main.py          # GUI
python nmes_cli.py      # CLI

WSL Users: Bluetooth doesn't pass through to WSL natively. See WSL_BLUETOOTH.md for workarounds.

Requirements

  • Python 3.8+
  • Bluetooth Low Energy adapter
  • Linux recommended (native BLE), also works on macOS/Windows

Included Protocols

Research-based protocols from peer-reviewed literature:

Protocol Frequency Use Case
Stroke Rehab 30Hz Upper/lower extremity recovery
ACL Recovery 50Hz Post-surgery strengthening
Pain Relief (TENS) 2-100Hz Various pain management
Muscle Strengthening 20-50Hz General conditioning

See src/core/protocols.py for full details and citations.

Project Structure

src/
├── core/           # Config, protocols, safety limits
├── bluetooth/      # BLE device communication
└── gui/            # PyQt6 interface

Safety Features

  • Parameter validation against clinical limits
  • Emergency stop functionality
  • Session time limits
  • Connection monitoring with auto-stop

Documentation

Technical Stack

  • BLE: bleak library
  • GUI: PyQt6 + qasync
  • Config: pydantic
  • Plotting: matplotlib

Contributing

Contributions welcome! See DEVELOPMENT.md for guidelines.

References

Protocols are based on peer-reviewed research:

  1. Marquez-Chin & Popovic (2020). FES therapy for motor function restoration. Biomed Eng Online. PMC5683854
  2. Johnson et al. (2015). TENS for acute pain. Cochrane Database Syst Rev. CD006142
  3. Gibson et al. (2017). TENS for neuropathic pain. Cochrane Database Syst Rev. CD011976
  4. Gondin et al. (2011). High-frequency NMES for muscle performance. Eur J Appl Physiol. doi:10.1007/s00421-011-2101-2
  5. Bax et al. (2005). NMES for quadriceps strengthening. Sports Med. doi:10.2165/00007256-200535030-00002
  6. ACSM Guidelines for Exercise Testing and Prescription, 11th ed. (2021)
  7. IEC 60601-2-10:2012 - Safety standards for nerve/muscle stimulators

License

MIT License with medical disclaimers. See LICENSE.


Always prioritize safety when working with electrical stimulation devices.

About

Control NMES/TENS Bluetooth devices for neuromuscular electrical stimulation and transcutaneous electrical nerve stimulation devices

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages