IdentiTwin a system for structural monitoring.
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
IdentiTwin
Overview
IdentiTwin is developed under the project Gemelo digital como herramienta de gestión del plan de conservación programada. Caso de estudio: foyer y fumadores del Teatro Nacional de Costa Rica. The library provides comprehensive tools for structural vibration and displacement acquisition using Raspberry Pi and associated sensors.
Core Features
Real-time Monitoring
- Multi-threaded data acquisition system optimized for Raspberry Pi.
- Support for LVDT displacement sensors (via ADS1115 ADC) and MPU6050 accelerometers.
- Continuous performance tracking (sampling rate, jitter).
- Automated event detection based on configurable thresholds.
- Thread-safe data handling and buffering (pre-event and post-event).
- Status reporting and LED indicators.
Event Detection & Recording
- Configurable trigger/detrigger thresholds for acceleration and displacement.
- Pre-event and post-event data buffering to capture the full event context.
- Minimum event duration setting to filter noise.
- Automated data persistence: saves event data to CSV and NPZ files.
- Background processing for saving data and generating analysis without interrupting acquisition.
Signal Processing & Analysis
- Basic time-domain analysis (peak values).
- Fast Fourier Transform (FFT) analysis for frequency domain insights.
- Calculation of dominant frequencies.
- Automated generation of analysis plots (time series and FFT) for each event.
- Generation of summary reports for monitoring sessions and individual events.
Hardware Support & Configuration
- Designed for Raspberry Pi with specific hardware (ADS1115, MPU6050).
- Utilizes
gpiozerofor LED indicators. - I2C communication setup for sensors.
- Simulation mode for development and testing on non-Raspberry Pi platforms.
- Flexible configuration via Python script (
initialization.py).
Installation
pip install identitwin
Prerequisites
- Raspberry Pi (tested on Raspberry Pi 5) with Raspberry Pi OS (or compatible Linux distribution).
- Python 3.8+
- Git
Hardware Setup
- Connect ADS1115 ADC and MPU6050 sensors to the Raspberry Pi's I2C pins (SDA, SCL, VCC, GND). Ensure unique I2C addresses if using multiple MPU6050 sensors (e.g., 0x68, 0x69).
- Connect LVDTs to the ADS1115 analog input channels.
- Connect status and activity LEDs to the specified GPIO pins.
Software Setup (Raspberry Pi)
-
Clone the Repository:
git clone https://github.com/estructuraPy/IdentiTwin.git cd IdentiTwin
-
Set up Virtual Environment (Recommended):
- Give execute permissions to the setup script:
chmod +x setup_env/setup_env.sh
- Run the setup script:
./setup_env/setup_env.sh
This creates a virtual environment namedvenvand installs dependencies.
- Give execute permissions to the setup script:
-
Activate the Virtual Environment:
source venv/bin/activate
(Your terminal prompt should now show
(venv)) -
Install the Library (if not done by setup script): If you didn't use the setup script or need to reinstall:
pip install .
(The
.refers to the current directory wheresetup.pyis located) -
Configure and Run:
- Navigate to the examples directory:
cd examples
- (Optional) Copy the example initialization file if you want to keep the original:
# cp initialization.py my_config.py # nano my_config.py
- Edit
initialization.py(or your copy) to match your hardware setup:- Set
NUM_LVDTS,NUM_ACCELS. - Define correct
LVDT_SLOPESbased on your sensor calibration. - Adjust sampling rates (
ACCEL_SAMPLING_RATE,LVDT_SAMPLING_RATE) if needed. - Modify trigger/detrigger thresholds and event timing parameters as required.
nano initialization.py - Set
- Run the initialization script:
python initialization.py(Add command-line arguments if needed, e.g.,--output-dir /path/to/data)
- Navigate to the examples directory:
-
Deactivate Virtual Environment (When finished):
deactivate
Installation for Simulation/Development (Non-Raspberry Pi)
- Clone the Repository:
git clone https://github.com/estructuraPy/IdentiTwin.git cd IdentiTwin
- Create and Activate Virtual Environment:
python -m venv venv # On Windows: .\venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
- Install:
pip install .
(Hardware-specific libraries will fail to install, which is expected) - Run in Simulation Mode:
The
initialization.pyscript should automatically detect a non-Raspberry Pi environment and run in simulation mode.cd examples python initialization.py
(Or use the--simulationflag explicitly:python initialization.py --simulation)
Documentation
Full documentation is available at Read the Docs.
Further details on configuration options, data formats, and analysis interpretation can be found in the project's technical documentation (link to be added).
Requirements
- Python 3.8+
- numpy
- matplotlib
Raspberry Pi Specific:
- gpiozero
- adafruit-circuitpython-ads1x15
- mpu6050-raspberrypi
- adafruit-blinka (for CircuitPython compatibility)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Authors
- Ing. Angel Navarro-Mora M.Sc (ahnavarro@itcr.ac.cr / ahnavarro@anmingenieria.com)
- Alvaro Perez-Mora (alvaroenrique2001@estudiantec.cr)
Copyright
© 2025 Instituto Tecnológico de Costa Rica (ITCR). All rights reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file identitwin-0.1.0.tar.gz.
File metadata
- Download URL: identitwin-0.1.0.tar.gz
- Upload date:
- Size: 59.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e5da74c7f812ec4637648cab656995bd70029b1237fdb8bcf806703f402a2ac
|
|
| MD5 |
e1e0a42b8fbd31269dfb56983321f119
|
|
| BLAKE2b-256 |
3b159019434308b8dee5159a61f05b181d520fbe35fa4a73a84077bc0ae17274
|
File details
Details for the file identitwin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: identitwin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 64.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81af06874acaab86ce8bdc450c3cfa798a04f0ff0b727ef2e5c68a6fc35d9fad
|
|
| MD5 |
d7d7f1f30c9816f7f1eab6c0f4dcd8a6
|
|
| BLAKE2b-256 |
fbf0e6ef02ec8c63a9da26db613deabc320880ca79654beb6692ee0efc97182e
|