Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcauser/micropython-ttp223
MicroPython examples using TTP223 capacitive touch module
https://github.com/mcauser/micropython-ttp223
capacitive-touch-sensor micropython stm32f4 ttp223
Last synced: about 16 hours ago
JSON representation
MicroPython examples using TTP223 capacitive touch module
- Host: GitHub
- URL: https://github.com/mcauser/micropython-ttp223
- Owner: mcauser
- License: mit
- Created: 2018-03-20T08:20:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-07T16:29:46.000Z (over 6 years ago)
- Last Synced: 2024-04-22T13:31:28.041Z (7 months ago)
- Topics: capacitive-touch-sensor, micropython, stm32f4, ttp223
- Size: 596 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-mpython - micropython-ttp223 - Examples using TTP223 capacitive touch module. (精选驱动库 / 传感器)
- awesome-micropython - micropython-ttp223 - Examples using TTP223 capacitive touch module. (Libraries / Sensors)
README
# MicroPython TTP223
Using a TTP223 1-key capacitive touch module with MicroPython.
I 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.
The 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.
It's sensitive enough to detect my finger around 3mm away from the touch pad.
![demo](docs/demo.jpg)
#### Examples
**Basic usage**
```python
from machine import Pin
import timed3 = Pin('D3', Pin.IN, Pin.PULL_DOWN)
while True:
print(d3.value())
time.sleep_ms(100)
```**Using interrupts**
```python
from machine import Pind3 = Pin('D3', Pin.IN, Pin.PULL_DOWN)
d4 = Pin('D4', Pin.IN, Pin.PULL_DOWN)def touch(pin):
print('Touched {}'.format(pin.name()))d3.irq(touch, Pin.IRQ_FALLING)
d4.irq(touch, Pin.IRQ_FALLING)
```## Trigger mode
There are 2 pads A and B which can be bridged with a dab of solder to change the trigger mode.
Pad A | Pad B | Description
----- | ----- | --------------------------------------
Open | Open | Momentary, High TTL level output (default)
Short | Open | Momentary, Low TTL level output
Open | Short | Latching, High TTL level output
Short | Short | Latching, Low TTL level output## Parts
* [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
* [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
* [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## Connections
STM32F407VET6 | TTP223 Capacitive Touch Module
------------- | -----------------
3V3 (or 5V) | VCC
D3 (any pin) | I/O
GND | GND## Links
* [micropython.org](http://micropython.org)
* [TTP223 datasheet](https://infusionsystems.com/support/TTP223.pdf)## License
Licensed under the [MIT License](http://opensource.org/licenses/MIT).