{"id":13613102,"url":"https://github.com/mcauser/micropython-ttp223","last_synced_at":"2025-07-28T05:32:51.868Z","repository":{"id":150620708,"uuid":"125983706","full_name":"mcauser/micropython-ttp223","owner":"mcauser","description":"MicroPython examples using TTP223 capacitive touch module","archived":false,"fork":false,"pushed_at":"2018-08-07T16:29:46.000Z","size":610,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-22T13:31:28.041Z","etag":null,"topics":["capacitive-touch-sensor","micropython","stm32f4","ttp223"],"latest_commit_sha":null,"homepage":null,"language":null,"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/mcauser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-20T08:20:08.000Z","updated_at":"2024-01-18T00:26:36.000Z","dependencies_parsed_at":"2023-05-06T09:33:04.374Z","dependency_job_id":null,"html_url":"https://github.com/mcauser/micropython-ttp223","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ttp223","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ttp223/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ttp223/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ttp223/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcauser","download_url":"https://codeload.github.com/mcauser/micropython-ttp223/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227870669,"owners_count":17832430,"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":["capacitive-touch-sensor","micropython","stm32f4","ttp223"],"created_at":"2024-08-01T20:00:39.765Z","updated_at":"2024-12-03T07:20:37.868Z","avatar_url":"https://github.com/mcauser.png","language":null,"readme":"# MicroPython TTP223\n\nUsing a TTP223 1-key capacitive touch module with MicroPython.\n\nI was going to write a driver for this module, but it's pretty much just a drop in replacement for a push button. No driver needed.\n\nThe module features 3 pins, VCC, I/O and GND and has a red LED which illuminates when a touch is detected and the I/O pin goes HIGH.\n\nIt's sensitive enough to detect my finger around 3mm away from the touch pad.\n\n![demo](docs/demo.jpg)\n\n#### Examples\n\n**Basic usage**\n\n```python\nfrom machine import Pin\nimport time\n\nd3 = Pin('D3', Pin.IN, Pin.PULL_DOWN)\n\nwhile True:\n    print(d3.value())\n    time.sleep_ms(100)\n```\n\n**Using interrupts**\n\n```python\nfrom machine import Pin\n\nd3 = Pin('D3', Pin.IN, Pin.PULL_DOWN)\nd4 = Pin('D4', Pin.IN, Pin.PULL_DOWN)\n\ndef touch(pin):\n    print('Touched {}'.format(pin.name()))\n\nd3.irq(touch, Pin.IRQ_FALLING)\nd4.irq(touch, Pin.IRQ_FALLING)\n```\n\n## Trigger mode\n\nThere are 2 pads A and B which can be bridged with a dab of solder to change the trigger mode.\n\nPad A | Pad B | Description\n----- | ----- | --------------------------------------\nOpen  | Open  | Momentary, High TTL level output (default)\nShort | Open  | Momentary, Low TTL level output\nOpen  | Short | Latching, High TTL level output\nShort | Short | Latching, Low TTL level output\n\n\n## Parts\n\n* [VCC-GND STM32F407VET6 mini](https://www.aliexpress.com/item/STM32F407VET6-Mini-version-of-the-core-board-STM32-minimum-system-version/32709285751.html) $15.47 AUD\n* [TTP223 Capacitive Touch Module](https://www.aliexpress.com/item/5PCS-LOT-NEW-TTP223-Touch-button-Module-Capacitor-type-Single-Channel-Self-Locking-Touch-switch-sensor/32416625219.html) $0.22 AUD\n* [Female-Female Dupont wires](https://www.aliexpress.com/item/10pcs-10cm-2-54mm-1p-1p-Pin-Male-to-Male-Color-Breadboard-Cable-Jump-Wire-Jumper/32636873838.html) $0.64 AUD\n\n## Connections\n\nSTM32F407VET6 | TTP223 Capacitive Touch Module\n------------- | -----------------\n3V3 (or 5V)   | VCC\nD3 (any pin)  | I/O\nGND           | GND\n\n## Links\n\n* [micropython.org](http://micropython.org)\n* [TTP223 datasheet](https://infusionsystems.com/support/TTP223.pdf)\n\n## License\n\nLicensed under the [MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Libraries","精选驱动库"],"sub_categories":["Sensors","传感器"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcauser%2Fmicropython-ttp223","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcauser%2Fmicropython-ttp223","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcauser%2Fmicropython-ttp223/lists"}