Sobre
A idéia principal aqui é coletar dados ECG com a intenção de tentar prever crises epiléticas. Mais sobre o projeto em Dispositivo para prever crises epiléticas.
O estudo está “on going”, vou atualizando essa nota com updates.
Por agora, apenas testes com a controladora e sensor. A próxima etapa é saber como lidar com os dados. Já vi uma possibilidade usando talvez neurokit.
Depois, possivelmente podemos usar um MQTT para receber os dados do dispositivo e processa-los. Nesse ponto, parece ser possível usar técnicas descritas nesse artigo An approach to detect and predict epileptic seizures with high accuracy using CNN and single-lead-ECG signal.
Implementação
Usei uma Placa ESP32 como controladora e Placa AD8232 para coleta do sinal analógico dos Eletrodos.
Fonte: 1 (com adaptação do código arduino para ESP32 pelo modelo OpenAI O1)
Minha conexão dos pinos entre as placas:
Lo- (amarelo): D19
Lo+ (verde): D18
Output (analog): 39 - Usando GPIO39 (Porta VN na ESP32)
Exemplo de dados coletados
Python para coleta dos dados da porta serial usando a lib pyserial.
Sample rate de 120hz
Dados: ecg_data_120.csv
Sample rate de 360hz
Dados: ecg_data_360.csv
Código pandas com hvplot usado para “plotar” os dados:
Interpretação do ECG
Possibilidade de usar a lib neurokit
Exemplo ECG
Link ao original
Fontes