This project provides a real-time data logger and visualizer for UD18 BLE devices. Using Python, BLE communication, and Streamlit, the app logs voltage, current, power, and D+/D- values, stores the data in a CSV file, and visualizes live metrics with interactive plots.
-
Real-Time BLE Data Logging
Collects data from UD18 BLE devices every few seconds. -
Dynamic Visualizations
Interactive Plotly graphs for power, voltage, current, and D+/D- measurements. -
Dual Data View
Simultaneously visualize data with dynamic plots and access raw data in a table format. -
User-Friendly Control Panel
Start or stop logging with a single click in the app interface. -
Instant Metrics
Displays real-time Voltage, Current, Power, and D+/D- values in intuitive metric boxes.
-
Data Logging
- The
ud18Logger.py
script uses thebleak
library to collect data from the UD18 BLE device. - Logs are saved in real-time to
ble_data_log.csv
.
- The
-
Live Visualization
- The Streamlit app (
ud18_streamlit_app.py
) reads the data, updates key metrics, and renders live visualizations.
- The Streamlit app (
-
User Interaction
- Users can control logging, view metrics, and switch between plots and the raw data table.
Figure 2: Streamlit App Interface
📁 UD18-BLE-Logger/
│
├── ud18_streamlit_app.py - Streamlit app for visualization and control
├── ud18Logger.py - BLE data logger script
├── ble_data_log.csv - CSV file storing logged data (auto-generated)
├── README.md - Project documentation
└── requirements.txt - Python dependencies
- Python 3.8 or higher
- BLE-compatible system (Bluetooth Low Energy support is required).
Run the following command:
pip install -r requirements.txt
To start logging data, run:
python ud18Logger.py
Launch the Streamlit app using:
streamlit run app.py
Open the app in your browser at http://localhost:8501.
- Real-time plots for:
- Voltage (V)
- Current (A)
- Power (W)
- D+ and D- Voltages (dual-line plot).
- Displays logged data in a tabular format directly from
ble_data_log.csv
.
- Streamlit - Web-based interface for Python apps.
- Plotly - Interactive plotting and visualizations.
- Bleak - Bluetooth Low Energy communication.
- Pandas - Data manipulation and CSV handling.
- Data is saved to
ble_data_log.csv
automatically during logging. - The CSV is cleared at the start of each logging session to prevent data overflow.
- Modify logging intervals by editing
LOG_INTERVAL_SECONDS
inud18Logger.py
.
- Alert System: Notify users when metrics exceed thresholds.
- Historical Data Analysis: Load and visualize past CSV files.
- Multi-Device Support: Log data from multiple UD18 devices simultaneously.
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License.
For questions or support, please contact:
Martin Kaiser
martinkaiser.bln@gmail.com