{"id":18346257,"url":"https://github.com/infineon/tlx4966-direction-speed-sensor","last_synced_at":"2025-07-20T09:11:50.360Z","repository":{"id":82063693,"uuid":"188708370","full_name":"Infineon/TLx4966-Direction-Speed-Sensor","owner":"Infineon","description":"C/C++ library of Infineon's double Hall-effect direction and speed TLx4966 sensor family","archived":false,"fork":false,"pushed_at":"2025-06-25T05:27:46.000Z","size":3579,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-25T06:32:19.116Z","etag":null,"topics":["aduino","arduino-library","direction","hall","magnetic","makers","prototyping","sensor2go","speed","tle4966-3k","tle4966k","tle4966l","tle4966v-1k","tli4966g"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Infineon.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":"2019-05-26T16:44:28.000Z","updated_at":"2024-06-17T11:23:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc38291b-a476-4747-9c4e-fbcd01970240","html_url":"https://github.com/Infineon/TLx4966-Direction-Speed-Sensor","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Infineon/TLx4966-Direction-Speed-Sensor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Infineon%2FTLx4966-Direction-Speed-Sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Infineon%2FTLx4966-Direction-Speed-Sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Infineon%2FTLx4966-Direction-Speed-Sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Infineon%2FTLx4966-Direction-Speed-Sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Infineon","download_url":"https://codeload.github.com/Infineon/TLx4966-Direction-Speed-Sensor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Infineon%2FTLx4966-Direction-Speed-Sensor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266094054,"owners_count":23875562,"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":["aduino","arduino-library","direction","hall","magnetic","makers","prototyping","sensor2go","speed","tle4966-3k","tle4966k","tle4966l","tle4966v-1k","tli4966g"],"created_at":"2024-11-05T21:10:58.682Z","updated_at":"2025-07-20T09:11:50.354Z","avatar_url":"https://github.com/Infineon.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TLx4966-Direction-Speed-Sensor\n\n[![Compile examples](https://github.com/Infineon/TLx4966-Direction-Speed-Sensor/actions/workflows/compile_examples.yml/badge.svg?branch=devops%2Fadd-build-checks)](https://github.com/Infineon/TLx4966-Direction-Speed-Sensor/actions/workflows/compile_examples.yml)\n\nC/C++ library of Infineon's double Hall-effect **direction and speed sensor** family for magnetic sensing applications.\n\n 1. [Overview](#ovw)\n 2. [Supported Hardware](#s-hw)\n 3. [Software Requirements](#sw-req)\n 4. [Library Usage](#lib-usage)\n 5. [Demo Application Example](#demo-ex)\n 6. [References](#refs)\n\n\u003ca name=\"ovw\"\u003e\u003c/a\u003e\n\n## 1. Overview\n\n### TLx4966 Family Functional Description\n\nThe TLx4966 are a family of integrated circuit double Hall-effect sensors designed specifically for highly accurate applications. Precise magnetic switching points and high temperature stability are achieved by active compensation circuits and chopper techniques on chip. They provide a speed signal at Q2 for every magnetic pole pair and a direction information at Q1, which is provided before the speed signal. \n\n\u003cimg src=\"docs/img/app-diagram-h.png\" height=\"220px\"\u003e \u003cimg src=\"docs/img/signals-diagram.PNG\" height=\"220px\"\u003e\n\n### TLx4966 Family Features \n\n* 2.7 V to 24 V, and 3.5 to 32 V (for TLx4966**V**) supply voltage operation\n* Operation from unregulated power supply\n* High sensitivity and high stability of the magnetic switching points\n* High resistance to mechanical stress by Active Error Compensation\n* Reverse battery protection (-18 V)\n* Superior temperature stability\n* Peak temperatures up to 125°C (for TL**I**4966) and 195° (for TL**E**4966) without damage\n* Low jitter (typ. 1 μs)\n* Digital output signals\n* Excellent matching between the 2 Hall probes\n* Hall plate distance 1.45 mm (except TLx4966**V-1K** with 1.25 mm)\n* Direction \u0026 speed information\n* Direction signal switches before the speed signal\n* SMD package PG-TSOP6-6-5 (for TLx4966 **(K)**), and PG-TSOP6-6-9 (for TLx4996 **(G)**)  \n* THD package PG-SSO-4-1 (for TLx4966 **(L)**)\n\nSpecial Features of the Vertical Variant (TLx4966**V**-(G)/(K)):\n* In-Plane sensing \n* Output over current and over temperature protection\n* Over voltage capability up to 42 V without external resistor\n* Lower jitter (typ. 0.3 μs)\n\n### TLx4966 Family Applications\n\n* Window lifter\n* Sunroof\n* Automatic tailgate\n* Automated doors\n* Sun blinds\n* Any applications with the need of speed and direction detection\n\n\u003ca name=\"s-hw\"\u003e\u003c/a\u003e\n\n## 2. Supported Hardware\n\n### TLx4966 Shields2Go\nThe library has been customized for the **TLE4966K** and **TLI4966G** (coming soon) Shields2Go and the Arduino environment. \n\n\u003cimg src=\"docs/img/tle4966k-pcb-front.jpg\" width=\"200px\"\u003e\n\nThe complete documentation as schematic and pinout diagram of the boards is included in the **Quick Start Guide**:\n* [TLE4966K S2Go](https://www.infineon.com/dgdl/Infineon-Getting%20Started%20TLE4966K-GettingStarted-v01_00-EN.pdf?fileId=5546d4626c1f3dc3016c65fa716c1fd0) \n* [TLI4966G S2Go](websitelink) (coming soon)\n\n### Verified Hardware Platforms\n\nThe library examples have been built and successfully executed on the following hardware platforms:\n\nMCU Platforms |\n---           |\n[XMC 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc_2go_xmc1100_v1/) | \n[XMC1100 Boot Kit](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc11_boot_001/#ispnTab1) |\n[XMC4700 Relax Kit for 5V Shields](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc47_relax_5v_ad_v1/) |\n[Arduino Uno Rev3](https://store.arduino.cc/arduino-uno-rev3) |   \n\nThe Shield2Go form factor is designed to be stacked directly into the XCM 2Go microcontroller board. The [MyIoT Adapter Shield](https://www.infineon.com/cms/en/product/evaluation-boards/my-iot-adapter/) can be used to attach the Shield2Go with any Arduino UNO hardware compatible boards. \n\n\u003cimg src=\"docs/img/xmc2go.jpg\" height=\"70px\"\u003e\u003cimg src=\"https://www.infineon.com/export/sites/default/media/products/Microcontrollers/devel_tools_SW/XMC1100_Boot-Kit.jpg_620533323.jpg\" height=\"120px\"\u003e\n\nThe firmware pin allocation is configured for the usage of **Socket 2/3** of the MyIoT Adapter Shield. The **Socket 1 configuration is not available**.\n\n\u003cimg src=\"https://www.infineon.com/export/sites/default/_images/product/evaluation-boards/Shield2Go_Adapter_board_top_view.jpg_1889680109.jpg\" width=\"150px\"\u003e\n\nCheck the [Quick Start Guide](https://www.infineon.com/dgdl/Infineon-quick_starter_guide-Shield2Go_MY_IoT_Adapter-GS-v01_00-EN.pdf?fileId=5546d462677d0f460167bbdbd8521af9) for the complete information and pinout diagram of the MyIoT adapter.\n\n#### Additional hardware platforms \n\nThe library is meant to be directly compatible with any other Arduino UNO platforms. Any new validated hardware platform will be added to the MCU Platforms list above.\n\nFor any other custom configuration, please check the specific PCB documentation. The information about the IC components can be found in their respective datasheets [TLE4996K](https://www.infineon.com/dgdl/Infineon-TLE4966K-DS-v01_00-en.pdf?fileId=db3a30431f848401011fbc945ed46383) and [TLI4966G](https://www.infineon.com/dgdl/Infineon-TLI4966G-DS-v01_00-EN.pdf?fileId=5546d46269e1c019016a2acfa3af258c), and the overall Infineon´s [Hall switches documentation](https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/hall-switches/) on the Infineon website. \n\n#### Additional compatible sensors\n\nAlthough there is no official Shield2Go or evaluation PCB, this firmware library can be configured to operate the following sensors of the TLx4966 family:\n\n* TLE4966V-1K\n* TLE4966L\n* TLE4966-3K\n\nFind out more about their particular features on the links to each product page in the [References](#refs) section. \n\n\u003ca name=\"sw-req\"\u003e\u003c/a\u003e\n\n## 3. Software Requirements\n\n### Supported Toolchain Software \n\nThe library examples has been built successfully with the following toolchain software:\n\nFramework | IDE         | Versions                    | MCU Platform Core Libs        | Versions  \n---       | ---         |---                          | ---                           |--- \nArduino   | Arduino IDE | 1.8.9                       | [XMC for Arduino](https://github.com/Infineon/XMC-for-Arduino)     | 1.2.1     \nArduino   | PlatformIO  | Home 2.0.2·Core + 4.0.0a8   | [Infineon XMC](https://github.com/Infineon/platformio-infineonxmc) | 1.1.2 \n\n### Software Dependencies\n\nThere are no additional library dependencies required by the TLx4966 library or its examples other than the **MCU Platform Core Libs** (check how to install them in the Library Usage [section](#lib-usage)).\n\n\u003ca name=\"lib-usage\"\u003e\u003c/a\u003e\n\n## 4. Library Usage\n\n### Source Code Documentation\n\nFind the source code documentation in **Doxygen** format on the following [link](https://infineon.github.io/TLx4966-Direction-Speed-Sensor/).\n\n### Arduino IDE\n\nIf you are new to Arduino IDE, please [download](https://www.arduino.cc/en/Main/Software) and install it first.\n\nThe official Arduino Boards are already available in the IDE, but other third party boards as the Infineon XMC MCU based need to be explicitly included. Follow the instructions in the [link](https://github.com/Infineon/XMC-for-Arduino#installation-instructions) to add the XMC board family to Arduino. Once installed, you can select the one of the supported board from the menu *Tools \u003e Board:...* and configure its parameters.\n\nThen we simply need to install the library to use it in your project:\n\n1. **Install the library**. Download this library as a .zip file (get the latest release version [here](https://github.com/Infineon/TLx4966-Direction-Speed-Sensor/releases). Install the library in the Arduino IDE in the menu *Sketch \u003e Include Library \u003e Add .ZIP library*.\n\n2. **Include it in your sketch**. With the library installed in the Arduino IDE, you can include it from the menu \"Sketch \u003e Include Library \u003e TLx4966-Direction-Speed-Sensor\". The header ``` #include \u003cTLx4966-ino.h\u003e ``` will be added to your sketch. You can also open and test one of the examples provided in  *File \u003e Examples \u003e TLx4966-Direction-Speed-Sensor* (find an example in the [Demo Application Example](#demo-ex) section).\n\n### PlatformIO \n\nIf you are new to PlatformIO, download and install first Visual Studio Code and the PlatformIO plugin. Please follow the instructions on the [official website](https://docs.platformio.org/en/latest/ide/pioide.html). Then go through [this tutorial](https://diyprojects.io/install-ide-platformio-extension-visual-studio-code-vscode-windows-32-bit-linux/#.XOVQP44zYnI) to get started with PlatformIO in VSCode and create a new project. \n\nWith the project created, now the library and its dependencies can be configured in the ***Platform.ini* Project File**. This file, located in the project root folder, includes one (or several) building environments *[env:__]*. In the *environment* section, the platform, board, and framework are specified. PlatformIO will take care of downloading and installing all dependencies.\nIn the following example, we use the XMC 2Go Evaluation Kit (only available for Arduino):\n\n```\n[env:xmc1100_xmc2go]\nplatform = infineonxmc\nboard = xmc1100_xmc2go\nframework = arduino\n\nlib_deps =\n# Using a library name\nTLx4966-Direction-Speed-Sensor\n    \n# Using the repository URL\n    https://github.com/Infineon/TLx4966-Direction-Speed-Sensor.git#master\n```\n\n### Pin Configuration\n\nThe pin configuration can be found in *hw-platf/TLx4966-platf-ard.c*. The corresponding direction and speed signal pins are allocated for the hardware stacks \"Shield2Go + XMC 2Go\" and \"Shield2Go + MyIoT Adapter + Arduino UNO Form Factor boards\" :\n\n```\n#ifdef XMC1100_XMC2GO                                                   /**\u003c xmc2go + Shield2Go  */    \nSTATIC const int     speedGPIO = 4;                                     /**\u003c Pin connected to Q2 */\nSTATIC const int     dirGPIO   = 9;                                     /**\u003c Pin connected to Q1 */\n#elif ((XMC1100_Boot_Kit)  || (XMC4700_Relax_Kit) || (ARDUINO_AVR_UNO)) /**\u003c xmc arduino and arduino uno boards */  \nSTATIC const int    speedGPIO = 7;                                      /**\u003c Pin connected to Q2 */\nSTATIC const int    dirGPIO   = 3;                                      /**\u003c Pin connected to Q1 */\n#else\n# error \"Board not yet defined. Please define the specific Arduino boards Pins\"\n#endif\n```\n\nOther pin configurations can be added here for different Arduino boards and its variants. In order to automatically select the MCU board (or family), the *board* and *board_variant\" defines (``` XMC1100_XMC2GO ``` or ``` ARDUINO_AVR_UNO ```) in the *board.txt* file specification have been used. \n\n### Other hardware platforms and frameworks\n\nThe hardware interfaces for the Arduino hardware platforms have been implemented using the [Arduino refrence](https://www.arduino.cc/reference/en/) libraries. \n\nAdditional hardware interface implementations can be added here for other platforms, MCU core libraries, toolchains and frameworks based on C/C++. \nCurrently, no toolchain or framework integration other than Arduino is provided.\n\n\u003ca name=\"demo-ex\"\u003e\u003c/a\u003e\n\n## 5. Demo Application Example\n\nMagnetic sensing applications are constrained to the mechanical arrangement between the sensor and the source generating the magnetic fields variations. \n\nIn order to evaluate the examples, additionally to the stackable hardware and the firmware, we will make use of the [Out of Shaft for 3D 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/out-of-shaft-for-3d-2-go/) add-on. This accessory provide a pair of rotating poles positioned in the range of the sensor operating range.\n\nUse the centre mounting hole of the Shield2Go to attach the Out of Shaft add-on, and then stack the board on the XMC 2Go. Alternatively, also the MyIot Shield (sockets 2 or 3) with the supported Arduino UNO form factor MCU platforms can be used as well. \n\n\u003cimg src=\"docs/img/tle4966k-xmc2go.jpg\" height=\"200px\"\u003e \u003cimg src=\"docs/img/tle4966k-xmc1100.jpg\" height=\"200px\"\u003e\n\nThe positioning of the rotation planes need to be in the **X-Z** plane (as shown in the pictures).\n\nOnce the hardware is assembled, we just need to connect the board through USB to our computer. \n\nGo now to the Arduino IDE and install the library (following the instructions in [Library Usage - Arduino IDE](#lib-usage) section). Open one of the examples in *File \u003e Examples \u003e TLx4966-Direction-Speed-Sensor \u003e switchPoll*. \n\nAfter selecting the board (Tools \u003e Board \u003e XMC1100 2Go*), and the proper COM port ( *Tools \u003e Port*), the example sketch can be verified \u003cimg src=\"docs/img/ard-verify-button.png\" width=\"17\"\u003e and uploaded to the target \u003cimg src=\"docs/img/ard-upload-button.png\" width=\"17\"\u003e. \n\nFinally, we can check the monitor output \u003cimg src=\"docs/img/ard-serial-button.png\" width=\"17\"\u003e. Do not forget to select the proper baudrate. Just rotate the magnet to get some results! \n\n\u003cimg src=\"docs/img/ard-monitor-example.gif\" height=\"230px\"\u003e \u003cimg src=\"docs/img/outofshaft.gif\" height=\"230px\"\u003e\n\n\u003ca name=\"refs\"\u003e\u003c/a\u003e  \n\n## 6. References\n\n### Related Products\n* [TLE4966K](https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/hall-switches/tle4966k/)\n* [TLI4966G](https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/hall-switches/tli4966g/)\n* [TLE4966V-1K](https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/hall-switches/tle4966v-1k/)\n* [TLE4966L](https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/hall-switches/tle4966l/)\n* [TLE4966-3K](https://www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/hall-switches/tle4966-3k/)\n* [TLE4966K Shield2Go](https://www.infineon.com/cms/en/product/evaluation-boards/s2go_2_hall_tle4966k/) \n* [TLI4966G Shield2Go](websitelink) \n* [XMC 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc_2go_xmc1100_v1/) \n* [XMC1100 Boot Kit](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc11_boot_001/#ispnTab1) \n* [XMC4700 Relax Kit for 5V Shields](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc47_relax_5v_ad_v1/) \n* [Arduino Uno Rev3](https://store.arduino.cc/arduino-uno-rev3) \n* [Out of Shaft for 3D 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/out-of-shaft-for-3d-2-go/)\n\n### Related Repositories\n - [Infineon Github](https://github.com/Infineon)\n - [XMC for Arduino](https://github.com/Infineon/XMC-for-Arduino)\n - [Infineon XMC Platformio](https://github.com/Infineon/platformio-infineonxmc)\n\n### Useful Links\n - [Infineon for Makers](https://www.infineon.com/cms/en/tools/landing/infineon-for-makers/)\n - [Arduino](https://www.arduino.cc/)\n - [PlatformIO](https://platformio.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfineon%2Ftlx4966-direction-speed-sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfineon%2Ftlx4966-direction-speed-sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfineon%2Ftlx4966-direction-speed-sensor/lists"}