简体   繁体   English

如何检测超声波测距传感器是否超出范围?

[英]How to detect ultrasonic range sensor is out of range or not?

I am using jsn-srf04t ranging sensor (25cm to 5m range) I want to know when it is going out of range(when under 25cm) The problem is when it goes under 25 cm, the sensor output sometimes goes to (90cm to 95cm or 100cm to 120cm) and this cause undetectability of that it is really out of range or not! 我正在使用jsn-srf04t测距传感器(25厘米至5m范围),我想知道何时超出范围(当25厘米以下时)问题是当它超出25厘米时,传感器输出有时会达到(90厘米至95厘米)或100厘米到120厘米),这会导致无法检测到它是否超出范围!

Is there any solution? 有什么解决办法吗?

This question is not directly related, but I thought I post a suggestion/answer anyway. 这个问题没有直接关系,但我想我还是会发布建议/答案。

SRF04's can detect the distances as small as 3 cms. SRF04可以检测到3 cms的距离。 Please measure the width of the output echo pulse using an oscilloscope. 请使用示波器测量输出回波脉冲的宽度。 It can be from 100uS to 18mS and if there is no object within its range, the echo pulse is 36ms. 它可以从100uS到18mS,如果在其范围内没有任何物体,则回波脉冲为36ms。 If the measured pulse width from the oscilloscope is agreeing with what you say, then presumably the SRF04 is faulty, or there is a problem with its mounting etc. If the width of the pulse is measured in uS, then dividing by 58 will give you the distance in cm, or dividing by 148 will give the distance in inches. 如果从示波器测得的脉冲宽度与您所说的一致,则可能是SRF04有故障,或者安装有问题。如果以美国为单位测量脉冲宽度,则除以58可以得到以厘米为单位的距离,或者除以148,将得出以英寸为单位的距离。 The SRF sensors can be triggered as fast as every 50mS, or 20 times each second. SRF传感器的触发速度可高达每50mS或每秒20次。 You should wait 50ms before the next trigger to ensure the ultrasonic "beep" has faded away and will not cause a false echo on the next ranging. 您应该在下一次触发之前等待50毫秒,以确保超声波“哔哔”声消失,并且不会在下一次测距中引起错误的回声。

Otherwise, check your timer configuration. 否则,请检查您的计时器配置。 Ensure that it can measure a pulse in the order of hundreds of microseconds with at least a resolution of tens of microseconds. 确保它能够以至少几十微秒的分辨率测量数百微秒的脉冲。

If you are using this , then perhaps you are at the lowest possible level. 如果您正在使用this ,那么可能您处于最低级别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:CoIDE中的偏移量超出范围 - Error: Offset out of range, in CoIDE STM32F411RE:程序冻结,超声波传感器不工作 - STM32F411RE: The program freeze and the ultrasonic sensor doesn't work 如何在C中为嵌入式系统定义堆栈地址范围 - How to define the stack address range in C for embedded systems 如何使用STM32CUBEF4 HAL库通过i2c读取传感器数据? - How do I use the STM32CUBEF4 HAL library to read out the sensor data with i2c? 如何使用 STM32g4xx_HAL_Driver HAL 库通过 i2c 读取传感器数据? - How do I use the STM32g4xx_HAL_Driver HAL library to read out the sensor data with i2c? 如何使用SPI总线对压力传感器进行编程 - How to program a pressure sensor using the SPI Bus 如何增加 HID 轴的范围? (几度后方向盘达到极限) - How could I increase the range of an HID axis? (steering wheel hits limit after a few degrees) 如何调整博世传感器 API 以与 STM32 一起使用? - How to adapt Bosch Sensor API's to use with STM32? 将 1d 阵列分配到 2d 矩阵中,用于 FMCW 雷达中的距离和速度信息 - Assignment of 1d array into 2d matrix for range and speed information in FMCW radar 如何在程序初始化期间(有效)和 LoRaWAN 占空比期间(无效)重复读取 ST 传感器的 WhoAmI 寄存器? - How to read the WhoAmI register of an ST-sensor during both initialization of the program (works) and repeatedly during LoRaWAN duty cycle (doesn't)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM