当前位置:网站首页>Intelligent bin (9) - vibration sensor (raspberries pie pico implementation)
Intelligent bin (9) - vibration sensor (raspberries pie pico implementation)
2022-07-31 16:27:00 【light chases rain】
一、模块展示


二、模块说明
此传感器有3个引脚,其中VCC需要接3.3-5V的电压,中间引脚接地,DO引脚是信号输出引脚,我们通过其进行倾斜感应.如上图所示,此传感器自带电源和开关两个LED灯,接通电源后,电源LED灯发光,当传感器触发倾斜时,开关LED灯发光.对于DO引脚,当开关LED发光时,其输出低电平,表示开关打开,当开关LED灯不亮时,其输出高电平,表示开关断开.用其我们可以很方便的实现倾斜断电保护功能.如上图中,此传感器还提供了一个灵敏度的电位调节单元,其工作原理电路图如下所示:
2.1 使用说明
1、产品不震动时,震动开关呈闭合导通状态,输出端输出低电平,绿色指示灯亮;
2、产品震动时,震动开关瞬间断开,输出端输出高电平,绿色指示灯不亮;
三、代码展示
Thanks to the shock sensor onboardLEDflashes too fast,so that it cannot be recognized by the naked eye,So this part callspico上自带的LEDDelay display,make the effect more obvious,But the delay time is too long,It will cause the sensitivity of the shock sensor to decrease,So this test uses 50ms延时
from machine import Pin
import utime
key = Pin(0, Pin.IN)
led_onboard = Pin(25, Pin.OUT)
while True:
while key.value() == 0:
print("no vibration")
led_onboard.value(0)
utime.sleep(0.05)
while key.value() == 1:
print("Vibration is sensed")
led_onboard.value(1)
utime.sleep(0.05)
四、效果展示
4.1 实物展示
emmm……Sensitivity is really bad,But the delay is lowered again,pico上LEDcan't see,Check it out soon,When using it anyway,There will be no delay,The delay is only added here to make the experimental phenomenon more obvious

4.2 代码效果展示

边栏推荐
- "Autumn Recruitment Series" MySQL Interview Core 25 Questions (with answers)
- 【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
- 入职一个月反思
- 深度学习机器学习理论及应用实战-必备知识点整理分享
- 【7.28】代码源 - 【Fence Painting】【合适数对(数据加强版)】
- Implementing distributed locks based on Redis (SETNX), case: Solving oversold orders under high concurrency
- Replication Latency Case (3) - Monotonic Read
- How to switch remote server in gerrit
- [pytorch] 1.7 pytorch and numpy, tensor and array conversion
- ansible study notes 02
猜你喜欢

Graham‘s Scan法求解凸包问题

How C programs run 01 - the composition of ordinary executable files

tooltips使用教程(鼠标悬停时显示提示)

【7.29】Code Source - 【Arrangement】【Stone Game II】【Cow and Snacks】【Minimum Number of Spawns】【Sequence】
![[pytorch] pytorch automatic derivation, Tensor and Autograd](/img/99/c9632a7d3f70a13e1e26b9aa67b8b9.png)
[pytorch] pytorch automatic derivation, Tensor and Autograd

i.MX6ULL驱动开发 | 33 - NXP原厂网络设备驱动浅读(LAN8720 PHY)

华为顶级工程师历时9年总结的“趣谈网络协议”PDF文档,太强了

C语言”三子棋“升级版(模式选择+AI下棋)

基于C语言的编译器设计与实现

6-22漏洞利用-postgresql数据库密码破解
随机推荐
GP 6 overall architecture study notes
牛客 HJ18 识别有效的IP地址和掩码并进行分类统计
基于ABP实现DDD
牛客网刷题(三)
牛客 HJ3 明明的随机数
2022年必读的12本机器学习书籍推荐
i.MX6ULL驱动开发 | 33 - NXP原厂网络设备驱动浅读(LAN8720 PHY)
牛客网刷题(二)
全新宝马3系上市,安全、舒适一个不落
[pytorch] 1.7 pytorch and numpy, tensor and array conversion
Foreign media right, apple on May be true in inventory
TypeError: unhashable type: ‘list‘
SHELL内外置命令
Codeforces Round #796 (Div. 2) (A-D)
type of timer
Mariabackup实现Mariadb 10.3的增量数据备份
Tencent Cloud Deployment----DevOps
小程序:matlab解微分方程「建议收藏」
How Redis handles concurrent access
Why is the field of hacking almost filled with boys?