当前位置:网站首页>Arduino uno realizes simple touch switch through direct detection of capacitance
Arduino uno realizes simple touch switch through direct detection of capacitance
2022-06-28 00:17:00 【perseverance52】
Arduino The simple touch switch is realized through the direct detection of capacitance

Arduino In addition to receiving digital signals from digital ports , The only analog physical quantity that can be detected is voltage . The detection value of any analog sensor is almost converted into voltage value through relevant circuit , Then input its analog port for analog-to-digital conversion . Capacitance values require relatively more complex and expensive circuits to be converted into voltage values , Can be Arduino testing , And the detection of many physical processes , Can be easily and reliably realized by detecting the capacitance value .
Implementation method
Set a digital port to low potential , And open arduino The internal pull-up resistance of , Start to calculate the time required for this port to reach the high potential . And this time is related to the ground capacitance of this port , The greater the capacitance , The longer the time . On the hardware, you only need to connect a wire to one port . Touch the exposed end of this wire with your finger , Will cause capacitance change ,arduino This change can be detected by the above method . If you want to increase sensitivity , You can attach a piece of tin foil to the wire . To prevent you from having a strong static electric shock to puncture the chip , You can cover the tin foil with a thin layer of paper .
Sample code
No need for third-party libraries
// readCapacitivePin
// Input :Arduino pin number边栏推荐
- Using two stacks to implement queues [two first in first out is first in first out]
- 赛尔笔记|视频文本预训练简述
- 积分体系和营销活动结合在一起有哪些玩法
- SQL reported an unusual error, which confused the new interns
- Chapter 2 integrated mp
- Differences and functions between intranet IP and public IP
- 零基础自学SQL课程 | CASE函数
- [黑苹果系列] M910x完美黑苹果系统安装教程 – 2 制作系统U盘-USB Creation
- [untitled]
- Although the TCGA database has 33 cancers
猜你喜欢

炼金术(1): 识别项目开发中的ProtoType、Demo、MVP

零基础自学SQL课程 | SQL基本函数大全

现代编程语言:Rust (铁锈,一文掌握钢铁是怎样生锈的)

2022 PMP project management examination agile knowledge points (3)

Character interception triplets of data warehouse: substrb, substr, substring
Does the subscription of Siyuan notes stop deleting cloud data directly?
![[untitled]](/img/e4/7c65c6823559b8501a1777cc4eb7ba.jpg)
[untitled]

安全省油环保 骆驼AGM启停电池魅力十足

Sentinel

Zero foundation self-study SQL course | if function
随机推荐
[PCL self study: segmentation4] point cloud segmentation based on Min cut
炼金术(1): 识别项目开发中的ProtoType、Demo、MVP
RNA-seq入门实战(一):上游数据下载、格式转化和质控清洗
Is it safe to open a stock account through the account opening QR code of CICC securities manager? Or is it safe to open an account in a securities company?
Grab those duplicate genes
吴恩达《机器学习》课程总结(13)_聚类
An analysis of C language functions
炼金术(2): 为什么要用issue管理软件
SCU|通过深度强化学习进行微型游泳机器人的步态切换和目标导航
Super outline exercises
Mise en œuvre du pool de Threads: les sémaphores peuvent également être considérés comme de petites files d'attente
2022 PMP project management examination agile knowledge points (3)
炼金术(4): 程序员的心智模型
Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
Validaterequest= "false" is a "suggestion collection" for what
零基础自学SQL课程 | SQL中的日期函数大全
How to use the apipost script - global variables
C language - date formatting [easy to understand]
VirtualBox extended dynamic disk size pit
After a period of silence, I came out again~