当前位置:网站首页>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 代码效果展示

边栏推荐
- After the form is submitted, the page does not jump [easy to understand]
- 第二届中国PWA开发者日
- LeetCode_733_Image rendering
- Replication Latency Case (1) - Eventual Consistency
- 阿里三面:MQ 消息丢失、重复、积压问题,如何解决?
- type of timer
- update data table update
- MySQL multi-table union query
- ASP.NET Core generates continuous Guid
- Baidu cloud web speed playback (is there any website available)
猜你喜欢

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

i.MX6ULL driver development | 33 - NXP original network device driver reading (LAN8720 PHY)

After Grafana is installed, the web opens and reports an error

基于ABP实现DDD
![[pytorch] pytorch automatic derivation, Tensor and Autograd](/img/99/c9632a7d3f70a13e1e26b9aa67b8b9.png)
[pytorch] pytorch automatic derivation, Tensor and Autograd
![[pytorch] 1.7 pytorch and numpy, tensor and array conversion](/img/ca/b943ff8f59f08e9e23b1ba416c79a0.png)
[pytorch] 1.7 pytorch and numpy, tensor and array conversion

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

MySQL的相关问题

苹果官网样式调整 结账时产品图片“巨大化”
![[TypeScript] In-depth study of TypeScript type operations](/img/d9/ee240ccba72e8d3114ee5c52ed0c8f.png)
[TypeScript] In-depth study of TypeScript type operations
随机推荐
Handling write conflicts under multi-master replication (4) - multi-master replication topology
基于ABP实现DDD
深度学习机器学习理论及应用实战-必备知识点整理分享
6. 使用 Postman 工具高效管理和测试 SAP ABAP OData 服务
t-sne 数据可视化网络中的部分参数+
MySQL multi-table union query
【pytorch】pytorch 自动求导、 Tensor 与 Autograd
Small program: Matlab solves differential equations "recommended collection"
研发过程中的文档管理与工具
全新宝马3系上市,安全、舒适一个不落
第二届中国PWA开发者日
【TypeScript】深入学习TypeScript类型操作
The new BMW 3 Series is on the market, with safety and comfort
Design and Implementation of Compiler Based on C Language
6-22 Vulnerability exploit - postgresql database password cracking
小程序:matlab解微分方程「建议收藏」
牛客 HJ18 识别有效的IP地址和掩码并进行分类统计
type of timer
2022年整理LeetCode最新刷题攻略分享(附中文详细题解)
MySQL基础篇【单行函数】