Microbit Turnipbit 孩子也能做的声光控开关

本文介绍了一项使用Turnipbit开发板及其扩展板进行的声光控制实验。通过连接光敏传感器和声音传感器,实现了对环境光线和声音的响应。文章详细描述了所需器件、传感器的工作原理及接线方法,并提供了可视化编程地址。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近一直在研究Turnipbit这块板子,之前也做了几个小实验,研究了下针脚,发现光敏传感器和声音传感器针脚能对的上,就做了下这个声光控小实验,顺便测试下这块板子的性能。不得不说熟悉Microbit的人都能熟练操作,可视化拼插编程哪怕是孩子也能熟练操作。                                                                                                                                                                                          
需要器件
1.Turnipbit以及Turnipbit扩展板个一块
2.pc机一台
3.数据线一条
4.光敏传感器和声音传感器个一个
5.杜邦线若干

 

1.光敏传感器模块原理

 

光敏传感器是利用光敏元件将光信号转换为电信号的传感器,它的敏感波长在可见光波长附近,包括红外线波长和紫外线波长。光传感器不只局限于对光的探测,它还可以作为探测元件组成其他传感器,对许多非电量进行检测,只要将这些非电量转换为光信号的变化即可。

                              
2.声音传感器模块原理

 

声音传感器的作用相当于一个话筒
(麦克风)。它用来接收声波,显示声音的振动图象,但不能对噪声的强度进行测量。
该传感器内置一个对声音敏感的电容式驻极体话筒。声波使话筒内的驻极体薄膜振动,导致电容的变化,而产生与之对应变化的微小电压。这一电压随后被转化成0-5V的电压,经过A/D转换被数据采集器接受,并传送给计算机。

 
4.4.接线方法:
Turnipbit扩展板与发光二极管接口对应如下表:
 
  
Turnip扩展板
  
光敏模块
3V3
VCC
GND
GND
P5
DO
Turnip扩展板
声音模块
 
  
3V3
VCC
 
  
GND
GND
 
  
P11
OUT
  
 
4.5. 源代码:
代码编程还是分两种方式来实现
打开Turnipbit可视化编程地址http://www.turnipbit.com/
 
代码编程:
from microbit import *


while True:
  if pin5.read_digital():
    if not pin11.read_digital():
      display.show(Image("09990:99999:99999:09990:00900"))
      sleep(5000)
  else:
    display.show(Image("09990:90009:90009:09990:00900"))
 

   可视化编程图

 
 

 

 
 
 

转载于:https://www.cnblogs.com/xxosu/p/8537422.html

Thanks to the highly-dense lighting infrastructure in public areas, visible light emerges as a promising means to indoor localization and navigation. State-of-the-art techniques generally require customized hardware (sensing boards), and mainly work with one single light source (e.g., customized LEDs). This greatly limits their application scope. In this paper, we propose NaviLight, a generic indoor localization and navigation framework based on existing lighting infrastructure with any unmodified light sources (e.g., LED, fluorescent, and incandescent lights). NaviLight simply adopts commercial off-the-shelf mobile phones as receivers, and light intensity values as location signatures. Unlike existing WiFi systems, a single light intensity value is not discriminative enough over space though the light intensity field does vary, which makes our design more challenging. We thus propose a LightPrint as a location signature using a vector of multiple light intensity values obtained during user’s walks. Such LightPrints are created by leveraging any user movement (of varying distance and direction) in order to minimize user efforts. A set of techniques are proposed to achieve quick LightPrint matching, which includes a coarse-grained classification and a fine-grained matching over dynamic time warping. We have implemented NaviLight to provide real-time service on Android phones in three typical indoor environments, covering a total area size over 1000m2. Our experiments show that NaviLight can achieve sub-meter localization accuracy to meet practical engineering requirements.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值