This project is a comprehensive system for acquiring, processing, and visualizing 1-lead ECG signals. It consists of three main components:
- Embedded System: Handles ECG signal acquisition and data transmission.
- Node.js Server: Manages data storage, retrieval, and API endpoints.
- React.js UI: Provides a user-friendly interface for visualizing and analyzing ECG data.
- Real-time ECG signal acquisition using ESP32.
- Data buffering and transmission to the server.
- NTP-based timestamp synchronization.
- Queue-based data handling for reliability.
- RESTful API for data storage and retrieval.
- API key and UID-based authentication.
- Hierarchical log storage by UID and date.
- CORS support for cross-origin requests.
- Error handling for invalid requests.
- Responsive line chart for ECG data visualization.
- Kalman filter for data smoothing.
- Zoom and scroll functionality for detailed analysis.
- Light and dark mode toggle.
- User authentication with UID and API key.
- Install the required libraries for ESP32 (e.g.,
WiFi,HTTPClient,freertos). - Configure WiFi credentials and server URL in the
LVTN.inofile. - Upload the code to the ESP32 using the Arduino IDE.
- Navigate to the
Nodejs serverdirectory:cd Nodejs server - Install dependencies:
npm install
- Create a
config.jsonfile with the following structure:{ "apiKeys": ["your-api-key"], "users": ["user1", "user2"] } - Start the server:
node Server.js
- Navigate to the
Reactjs UIdirectory:cd Reactjs UI - Install dependencies:
npm install
- Create a
.envfile with the following environment variables:REACT_APP_API_KEY=your_api_key REACT_APP_UID=your_uid - Start the development server:
npm start
- The ESP32 collects ECG data and sends it to the server at regular intervals.
- POST Request: Save logs.
- URL:
http://localhost:3800 - Headers:
x-api-key,x-uid - Body:
{ "values": [1, 2, 3, ...] }
- URL:
- GET Request: Retrieve logs.
- URL:
http://localhost:3800?date=YYYY-MM-DD - Headers:
x-api-key,x-uid
- URL:
- Log in using your UID and API key.
- Visualize ECG data in the chart.
- Use controls to zoom, scroll, and apply filters.
- Export data as CSV for further analysis.
- Embedded System: ESP32, Arduino libraries.
- Node.js Server: Node.js, Express.
- React.js UI: React, Recharts, rc-slider, js-cookie.
This project is licensed under the MIT License. See the LICENSE file for details.
- Trần Quốc Duy
- Nguyễn Mạnh Ba
Supervised by Dr. Nguyễn Văn Khanh at Trường Đại học Cần Thơ - Khoa Tự Động Hóa.