当前位置:网站首页>Arduino UNO通过电容的直接检测实现简易触摸开关
Arduino UNO通过电容的直接检测实现简易触摸开关
2022-06-27 21:41:00 【perseverance52】
Arduino 通过电容的直接检测实现简易触摸开关

Arduino除了接受数字端口的数字信号,唯一能检测的模拟物理量就是电压。任何模拟传感器的检测值几乎都是通过相关电路转化成电压值,再输入它的模拟端口进行模数转换的。电容值就需要相对更复杂和昂贵的电路转化为电压值,才能被Arduino检测,而对很多物理过程的检测,都可以很方便可靠地通过检测电容值来实现。
实现方法
把一个数字端口设成低电位,并打开arduino的内部上拉电阻,开始计算这个端口到达高电位所需要的时间。而这个时间与此端口的对地电容值有关,电容越大,时间越长。在硬件上只需要在一个端口上连一根导线即可。用手指触摸这段导线的裸露端,就会导致电容变化,arduino可以通过上述方法检测这个变化。如果要增加灵敏度,可以在导线上连一片锡箔。为防止你手上有强静电击穿芯片,可以在锡箔上盖一层薄纸。
示例代码
不需要第三方库
// readCapacitivePin
//输入:Arduino pin number边栏推荐
- Detailed explanation of MATLAB axis coordinate axis related settings
- Chapter 2 integrated mp
- [AI application] detailed parameters of NVIDIA Tesla v100s-pcie-32gb
- Count prime [enumeration - > space for time]
- [idea] idea formatting code skills
- Golang uses Mongo driver operation - query (Advanced)
- 翻译(5): 技术债务墻:一种让技术债务可见并可协商的方法
- 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?
- TIME_WAIT过多的解决办法
- 内网IP和公网IP的区别及作用
猜你喜欢

零基础自学SQL课程 | IF函数

Zero foundation self-study SQL course | case function

How to quote Chinese documents when writing a foreign language?

【无标题】

【PCL自学:Segmentation4】基于Min-Cut点云分割

Promise是什么
![Using two stacks to implement queues [two first in first out is first in first out]](/img/de/07297816f1a44d41389bb45d012c80.png)
Using two stacks to implement queues [two first in first out is first in first out]

Cornernet由浅入深理解

Character interception triplets of data warehouse: substrb, substr, substring

Chenyun pytorch learning notes_ Build RESNET with 50 lines of code
随机推荐
【PCL自学:Segmentation4】基于Min-Cut点云分割
Solve the cross domain problem of the new version of chrome: Cookie loss and samesite attribute problem "recommended collection"
2022 PMP project management examination agile knowledge points (3)
使用cef3开发的浏览器不支持flash问题的解决
[try to hack] kill evaluation
Zero foundation self-study SQL course | case function
表单form 和 表单元素(input、select、textarea等)
One step forward is excellent, one step backward is ignorant
零基础自学SQL课程 | IF函数
Transmitting and receiving antenna pattern
Thread pool implementation: semaphores can also be understood as small waiting queues
mysql数据库旅游管理系统_JSP+MySQL基于ssm的旅游管理系统[通俗易懂]
[AI application] detailed parameters of Jetson Xavier nx
解决新版chrome跨域问题:cookie丢失以及samesite属性问题「建议收藏」
[idea] idea formatting code skills
Const keyword and its function (usage), detailed explanation of C language const
ValidateRequest=”false” 是做什么的「建议收藏」
Build an open source and beautiful database monitoring system -lepus
Recyclerview implements grouping effects in a variety of ways
【AI应用】NVIDIA Tesla V100S-PCIE-32GB的详情参数