{"id":28254478,"url":"https://github.com/styriaelectronics/can_accelerometer_logger","last_synced_at":"2025-06-15T06:30:51.109Z","repository":{"id":288559817,"uuid":"968509827","full_name":"StyriaElectronics/CAN_Accelerometer_Logger","owner":"StyriaElectronics","description":"STM32 data-logger: captures 3-axis ADXL345 acceleration (1 kHz / 1 s buffer) and streams it over UART \u0026 CAN-FD.","archived":false,"fork":false,"pushed_at":"2025-05-04T09:36:15.000Z","size":785,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T19:21:19.824Z","etag":null,"topics":["accelerometer","adxl345","can-bus","data-logger","stm32"],"latest_commit_sha":null,"homepage":"https://styria-electronics.at","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StyriaElectronics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-18T07:56:17.000Z","updated_at":"2025-05-04T09:36:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"af082ff8-402e-43bc-b7b9-7852e9313035","html_url":"https://github.com/StyriaElectronics/CAN_Accelerometer_Logger","commit_stats":null,"previous_names":["styriaelectronics/can_accelerometer_logger"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/StyriaElectronics/CAN_Accelerometer_Logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyriaElectronics%2FCAN_Accelerometer_Logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyriaElectronics%2FCAN_Accelerometer_Logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyriaElectronics%2FCAN_Accelerometer_Logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyriaElectronics%2FCAN_Accelerometer_Logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StyriaElectronics","download_url":"https://codeload.github.com/StyriaElectronics/CAN_Accelerometer_Logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyriaElectronics%2FCAN_Accelerometer_Logger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259934322,"owners_count":22934309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accelerometer","adxl345","can-bus","data-logger","stm32"],"created_at":"2025-05-19T19:20:06.695Z","updated_at":"2025-06-15T06:30:51.101Z","avatar_url":"https://github.com/StyriaElectronics.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📦 CAN Accelerometer Logger\n is a small STM32-based project that reads 3-axis acceleration data from an ADXL345 sensor, buffers it for 1 second at 1 kHz, and then transmits it via UART and CAN bus. Perfect for capturing impact or vibration events in embedded systems.\n\n[![Platform](https://img.shields.io/badge/platform-STM32-blue.svg)]()\n[![Interface](https://img.shields.io/badge/interface-CAN%2FUART-green.svg)]()\n[![Status](https://img.shields.io/badge/status-Stable-brightgreen.svg)]()\n[![License](https://img.shields.io/badge/license-CC0--1.0-lightgrey.svg)]()\n[![Build](https://img.shields.io/badge/build-passing-brightgreen.svg)]()\n[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)]()\n\n## 🚀 Features\n\n- 🧭 3-axis accelerometer data from ADXL345 via SPI  \n- ⏱️ 1000 samples per second (1 kHz), total 1000 samples in buffer  \n- 🟢 Trigger signal via GPIO (rising edge)  \n- 💾 Data is buffered in RAM, sent after acquisition  \n- 📤 Data output via UART and optionally via CAN  \n- 📦 CAN data transmission in chunks with custom protocol  \n- 🧪 Simple and compact C code, ideal for lab testing or automotive debug setups  \n\n## ⚙️ Requirements\n\nSTM32 microcontroller with:\n\n- SPI (ADXL345)\n- UART (for output)\n- GPIO (for trigger input)\n- CAN (for data transmission)\n- ADXL345 accelerometer (3.3 V logic)\n- STM32CubeMX / STM32CubeIDE (for initial setup)\n\n## 🔌 Wiring\n\n| Signal       | STM32 Pin  | ADXL345       |\n|--------------|------------|----------------|\n| SPI MOSI     | e.g. PA7   | SDI            |\n| SPI MISO     | e.g. PA6   | SDO            |\n| SPI SCK      | e.g. PA5   | SCL            |\n| SPI CS       | e.g. PB0   | CS             |\n| Trigger Input| e.g. PA8   | (external source) |\n| UART TX      | e.g. PA9   | (debug terminal) |\n| CAN TX / RX  | any FDCAN-capable pins |\n\n## 🧪 Example Workflow\n\n1. **Boot**  \n2. **Wait** for trigger (PA8 ↑)  \n3. **Acquire** 1000 XYZ samples (1 ms cadence)  \n4. **Transmit**  \n   - UART: CSV line per sample  \n   - CAN FD: Header + chunked payload → CRC-8 terminator  \n\n---\n\n## 💬 CAN Protocol Overview\n\n| Frame | CAN ID | DLC | Payload |\n|-------|--------|-----|---------|\n| **Request**  | `0x123` | 1 | `0xAB` (host → logger) |\n| **Header**   | `0x321` | 3 | `LEN_H`, `LEN_L`, `CHUNK_CNT` |\n| **Payload**  | `0x322` … `0x32F` | up to 64 | Raw data bytes (XYZ buffer) |\n| **CRC**      | `0x330` | 1 | CRC-8 (XOR of `LEN` + payload) |\n\n- **LEN** = 2000 bytes (1000 samples × 2 bytes per axis)  \n- **CHUNK_CNT** = ceil(LEN / 64)  \n- CRC is calculated after the final payload frame and sent in its own frame.\n\n\u003e *Default bitrate:* 500 kbit/s nominal.\n\n\n## 📂 Folder Structure\n\n```\nCAN_Accelerometer_Logger/\n├── Core/\n│   ├── Src/\n│   └── Inc/\n├── Drivers/\n├── .gitignore\n├── README.md\n└── LICENSE (CC0-1.0)\n```\n\n## 📄 License\n\nThis project is licensed under **CC0 1.0 Universal (Public Domain Dedication)**. You can use it freely without attribution – though a ⭐ on GitHub is always appreciated :)\n\n## ⚠️ Disclaimer  \nThis project is provided \"as is\" without warranty of any kind, either expressed or implied.  \nIn no event shall the author(s) be liable for any claim, damages, or other liability arising from, out of, or in connection with the use or other dealings in this project.\n\n## ✨ Credits\n\nMade with ❤️ by **Styria Electronics** for high-performance embedded data acquisition over CAN bus.\n\n🛠️ Contributions welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyriaelectronics%2Fcan_accelerometer_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyriaelectronics%2Fcan_accelerometer_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyriaelectronics%2Fcan_accelerometer_logger/lists"}