Wireless Data Acquisition - Wireless, Low-Cost, and Portable EMG System
Wireless, Low-Cost, and Portable EMG System
WDA (Wireless Data Acquisition) — WizFi360과 Teensy 4.1을 활용한 저비용·무선·휴대형 EMG(근전도) 데이터 수집 시스템
배경 & 동기
기존 유선 EMG(근전도) 시스템은 피험자의 움직임을 심하게 제한합니다. 센서와 컴퓨터를 연결하는 케이블은 복잡한 동작을 기록할 때 걸리거나 엉키기 쉬우며, 유선 환경은 전원 노이즈(Power Line Interference) 에도 취약합니다. 상용 무선 EMG 시스템은 존재하지만 가격이 매우 비싸고, 다채널 동시 기록과 시간 동기화가 까다롭다는 문제가 있습니다.
이 프로젝트는 석사 논문 연구의 일환으로, 스포츠 과학, 의족 제어, 인간-기계 인터페이스 등 비전통적 EMG 응용 분야를 위해 저비용·무선·휴대형 시스템을 자체 제작하는 것을 목표로 했습니다. 무선 통신 방식으로는 메모리와 대역폭이 제한된 임베디드 환경에 적합한 MQTT 프로토콜을 선택했고, 이를 기본 지원하는 WizFi360 모듈을 채택하게 되었습니다.
시스템 구조 & 동작 원리
전체 시스템은 크게 임베디드 블록과 PC 블록 두 파트로 구성됩니다.
- 임베디드 블록 — Teensy 4.1은 MyoWare 2.0 센서로부터 EMG 신호를 인터럽트 기반으로 일정 간격마다 샘플링하고, WizFi360이 Wi-Fi를 통해 데이터를 MQTT 브로커로 전송합니다. 시스템은 최대 두 대의 임베디드 장치를 동시에 지원합니다.
- PC 블록 — Windows PC에서 로컬 MQTT 브로커(Mosquitto) 와 Python Core Application이 실행됩니다. Core Application은 사용자가 샘플링 주파수, 측정 시간, 채널 수를 설정하면 설정 메시지를 임베디드 장치로 전송하고, 수신된 데이터를 실시간으로 그래프에 표시하며 CSV 파일로 저장합니다.
- 시간 동기화 — 두 대의 장치를 동시에 시작하기 위해 GPIO 인터럽트를 활용한 RTC 동기화 방식을 사용합니다. RTC 동기화 핀을 연결하고 버튼 하나를 누르면 두 장치의 RTC가 동시에 0으로 리셋됩니다. Teensy 4.1 내부 RTC는 CR2032 배터리로 약 40일간 유지되므로 매 전원 인가 시마다 동기화가 필요하지 않습니다.
통신 흐름을 요약하면: EMG 센서 → Teensy 4.1 (ADC + 인터럽트 샘플링) → WizFi360 (Wi-Fi / MQTT) → Mosquitto Broker → Python Core Application → CSV 저장 & 실시간 시각화
구현 세부사항
하드웨어 연결
Teensy 4.1의 UART 포트를 통해 WizFi360과 통신합니다. MyoWare 2.0 센서는 Teensy의 아날로그 핀에 연결되며, RTC 동기화를 위한 핀은 내부 풀업 저항이 있는 GPIO 핀에 연결됩니다. 배터리 팩으로 전체 임베디드 시스템을 구동해 완전 무선 휴대형으로 동작합니다.
소프트웨어 & 개발 환경
- 펌웨어: Arduino IDE + Teensy용 Teensyduino 애드온, C++ 로 작성
- Core Application: Python (PyQt GUI), FFT·Linear Envelope 분석 함수 내장
- 사용자 확장 가능한 func1.py ~ func5.py 커스텀 분석 함수 템플릿 제공
설정 방법
git clone https://github.com/lordlynn/WDA로 저장소를 클론- Mosquitto MQTT 브로커를 로컬 PC에 설치 및 실행
- Arduino IDE에서 Teensy 4.1 보드 설정 후
TeensyWiFi_ARDUINO폴더의 펌웨어를 빌드·플래시 CoreApplication폴더에서 Python 의존성을 설치하고 GUI 실행- Wi-Fi SSID·비밀번호 및 브로커 IP를 펌웨어 설정 파일에 입력
주의사항
- RTC 동기화는 두 장치를 동시에 사용하는 경우 측정 전 반드시 수행해야 합니다.
- 피부 준비 상태(세정, 전극 부착 위치)가 EMG 신호 품질에 직접적인 영향을 미칩니다.
- Wi-Fi 환경 불안정 시 MQTT QoS 설정을 확인하세요.
시장 가치 & WIZnet Maker 커뮤니티에 주는 의미
이 프로젝트가 특히 주목할 만한 이유는, WizFi360 모듈의 실전 활용 가능성을 의료·스포츠 과학 영역에서 직접 검증했다는 점입니다. 단순한 IoT 토이 프로젝트를 넘어 석사 논문 수준의 연구 목적으로 채택되었다는 사실은 WIZnet 모듈의 안정성과 신뢰성을 잘 보여줍니다. MQTT 기본 지원이라는 WizFi360의 강점이 임베디드 환경에서 어떻게 실질적인 개발 시간을 줄여주는지 체감할 수 있는 좋은 사례이기도 합니다.
WIZnet 제품을 사용하는 메이커 입장에서는 이 프로젝트가 생체 신호(EMG, ECG 등) 수집 + MQTT + 실시간 데이터 시각화라는 파이프라인의 완성된 레퍼런스로 기능합니다. WizFi360 → WizFi630A, 또는 W5500을 활용한 유선 버전으로의 확장도 자연스럽게 고려해볼 수 있으며, 스포츠 과학·재활 의학·HMI(인간-기계 인터페이스) 분야에서 저비용 데이터 수집 시스템을 구축하려는 연구자와 메이커 모두에게 즉시 재현 가능한 오픈소스 출발점이 될 것입니다.
결과 & 마무리
검증 실험으로 균형 연구(3가지 안정성 조건) 와 피로 연구(4채널 EMG 신호 충실도 확인) 를 수행했습니다. 균형 연구에서는 MSC(Magnitude Squared Coherence) + 신경 밴드 평균 분석이 기존 유선 시스템의 선행 연구 결과와 전반적으로 일치했으며, 피로 연구에서는 MAV(진폭 분석) 와 MDF(주파수 분석) 모두 기존 연구와 부합하여 시스템의 데이터 신뢰성을 확인했습니다.
이 결과가 가능했던 핵심 이유 중 하나는 WizFi360의 안정적인 MQTT 기본 지원 덕분입니다. 두 대의 임베디드 장치가 동시에 Wi-Fi를 통해 데이터를 전송하는 상황에서도 패킷 손실 없이 일관된 통신을 유지했고, QoS(Quality of Service) 설정을 활용해 데이터 전달 신뢰성을 추가로 보장할 수 있었습니다. 만약 Wi-Fi 모듈에서 MQTT를 별도로 구현해야 했다면 개발 복잡도가 크게 높아졌을 것입니다.
파일럿 결과는 충분한 가능성을 보여줬으며, 향후 커스텀 PCB 설계를 통해 WizFi360을 더욱 긴밀하게 통합하면 장치 소형화와 전력 효율 개선도 기대할 수 있습니다.
Background & Motivation
Traditional wired EMG systems significantly restrict subject movement. The cables connecting sensors to a computer tend to snag or tangle during complex motion recording, and wired setups are also vulnerable to Power Line Interference. While commercial wireless EMG systems exist, they are prohibitively expensive and present challenges with multi-channel simultaneous recording and time synchronization.
This project was developed as part of a Master's Thesis research, with the goal of building a low-cost, wireless, and portable system for non-traditional EMG applications such as sports science, prosthetic limb control, and human-machine interfaces. The MQTT protocol was chosen for wireless communication due to its lightweight footprint suited for memory- and bandwidth-constrained embedded environments — and the WizFi360 module was selected precisely because it supports MQTT natively out of the box.
System Architecture & How It Works
The overall system is divided into two main blocks: the Embedded Block and the PC Block.
- Embedded Block — The Teensy 4.1 samples EMG signals from MyoWare 2.0 sensors at consistent intervals using interrupt-driven sampling, while the WizFi360 transmits the data to an MQTT broker over Wi-Fi. The system supports up to two embedded devices simultaneously.
- PC Block — A local MQTT broker (Mosquitto) and a Python Core Application run on a Windows PC. Once the user configures the sampling frequency, test duration, and number of channels, a configuration message is sent to the embedded devices. Incoming data is plotted in real time and simultaneously saved to a CSV file.
- Time Synchronization — To ensure both devices begin sampling at exactly the same moment, a GPIO interrupt-based RTC synchronization method is used. By connecting the RTC sync pins of both devices and pressing a single button, both RTCs reset to 0 simultaneously. Since the Teensy 4.1's internal RTC is powered by a CR2032 battery lasting up to 40 days, re-synchronization is not required after every power cycle.
The full communication flow: EMG Sensor → Teensy 4.1 (ADC + Interrupt Sampling) → WizFi360 (Wi-Fi / MQTT) → Mosquitto Broker → Python Core Application → CSV Save & Real-time Visualization
Implementation Details
Hardware Connections
The WizFi360 communicates with the Teensy 4.1 via UART. MyoWare 2.0 sensors connect to the Teensy's analog input pins, and the RTC synchronization pin uses a GPIO pin with an internal pull-up resistor. The entire embedded system runs on a battery pack, making it fully wireless and portable.
Software & Development Environment
- Firmware: Arduino IDE + Teensyduino add-on, written in C++
- Core Application: Python (PyQt GUI) with built-in FFT and Linear Envelope analysis functions
- Five user-extensible custom analysis templates provided: func1.py ~ func5.py
Setup Instructions
- Clone the repository:
git clone https://github.com/lordlynn/WDA - Install and run the Mosquitto MQTT Broker on your local PC
- In Arduino IDE, configure the Teensy 4.1 board and flash the firmware from the
TeensyWiFi_ARDUINOfolder - Install Python dependencies and launch the GUI from the
CoreApplicationfolder - Enter your Wi-Fi SSID, password, and broker IP in the firmware configuration file
Notes & Troubleshooting
- RTC synchronization must be performed before each session when operating two devices simultaneously.
- Skin preparation (cleaning and proper electrode placement) directly affects EMG signal quality.
- If Wi-Fi connectivity is unstable, review the MQTT QoS settings.
Results & Conclusion
Two validation experiments were conducted: a balance study (3 stability conditions) and a fatigue study (verifying EMG signal fidelity across all 4 channels). In the balance study, MSC (Magnitude Squared Coherence) with neural band averaging analysis aligned with results from prior research using wired systems. In the fatigue study, both MAV (amplitude analysis) and MDF (frequency analysis) agreed with existing literature, confirming the data fidelity of the system.
A key reason these results were achievable is the WizFi360's native MQTT support. Even with two embedded devices transmitting data simultaneously over Wi-Fi, the system maintained consistent communication without packet loss, and QoS (Quality of Service) settings provided an additional layer of delivery reliability. Had MQTT needed to be implemented separately on a generic Wi-Fi module, the development complexity would have increased substantially.
Pilot results show strong promise. Going forward, designing a custom PCB to more tightly integrate the WizFi360 will help reduce the device footprint and further improve power efficiency and portability.
Original Link: https://github.com/lordlynn/WDA
Market Value & What It Means for the WIZnet Maker Community
What makes this project stand out is that it validates the WizFi360 in a real-world research context — not just a hobby IoT build, but a system adopted for Master's Thesis-level academic research in medical and sports science. This speaks directly to the reliability and robustness of WIZnet modules under demanding conditions.
For makers already working with WIZnet products, this project serves as a complete, reproducible reference pipeline for biosignal acquisition + MQTT + real-time data visualization. The architecture is modular enough to adapt for ECG, EEG, or other analog biosignals, and the communication layer can be extended to WizFi630A for higher throughput or swapped for a W5500-based wired Ethernet setup in security-sensitive environments. For researchers and makers building low-cost data acquisition systems in sports science, rehabilitation, or HMI, this project is an open-source starting point ready to build on.

