搜索
bottom↓
回复: 19

超声波测距原理图、源代码、HEX文件及说明文档(搜索到的资料,较详细)

[复制链接]

出0入0汤圆

发表于 2010-3-11 11:50:11 | 显示全部楼层 |阅读模式
Ultra-Sonic Ranging Design
                                       资料来源: http://www.robot-electronics.co.uk
This project started after I looked at the Polaroid Ultrasonic Ranging module. It has a number of disadvantages for use in small robots etc.
1.        The maximum range of 10.7 metre is far more than is normally required, and as a result
2.        The current consumption, at 2.5 Amps during the sonic burst is truly horrendous.
3.        The 150mA quiescent current is also far too high.
4.        The minimum range of 26cm is useless. 1-2cm is more like it.
5.        The module is quite large to fit into small systems, and
6.        It’s EXPENSIVE.
Here in the UK from Maplin Electronics, the module costs GB38.00 and the transducer costs a further GB17.00. In fairness, the Polaroid module does the job it was intended to do, which requires the range, but that job is not to provide the eyes of a small robot.
Here is the schematic, You can download a better quality pdf (161k) version srf1.pdf

The circuit is designed to be low cost. It uses a PIC12C508 to perform the control functions and standard 40khz piezo transducers. The drive to the transmitting transducer could be simplest driven directly from the PIC. The 5v drive can give a useful range for large objects, but can be problematic detecting smaller objects. The transducer can handle 20v of drive, so I decided to get up close to this level. A MAX232 IC, usually used for RS232 communication makes and ideal driver, providing about 16v of drive.
The receiver is a classic two stage op-amp circuit. The input capacitor C8 blocks some residual DC which always seems to be present. Each gain stage is set to 24 for a total gain of 576-ish. This is close the 25 maximum gain available using the LM1458. The gain bandwidth product for the LM1458 is 1Mhz. The maximum gain at 40khz is 1000000/40000 = 25. The output of the amplifier is fed into an LM311 comparator. A small amount of positive feedback provides some hysterisis to give a clean stable output.
The problem of getting operation down to 1-2cm is that the receiver will pick up direct coupling from the transmitter, which is right next to it. To make matters worse the piezo transducer is a mechanical object that keeps resonating some time after the drive has been removed. Up to 1mS depending on when you decide it has stopped. It is much harder to tell the difference between this direct coupled ringing and a returning echo, which is why many designs, including the Polaroid module, simply blank out this period. Looking at the returning echo on an oscilloscope shows that it is much larger in magnitude at close quarters than the cross-coupled signal. I therefore adjust the detection threshold during this time so that only the echo is detectable. The 100n capacitor C10 is charged to about –6v during the burst. This discharges quite quickly through the 10k resistor R6 to restore sensitivity for more distant echo’s.
A convenient negative voltage for the op-amp and comparator is generated by the MAX232. Unfortunately, this also generates quite a bit of high frequency noise. I therefore shut it down whilst listening for the echo. The 10uF capacitor C9 holds the negative rail just long enough to do this.
In operation, the processor waits for an active low trigger pulse to come in. It then generates just eight cycles of 40khz. The echo line is then raised to signal the host processor to start timing. The raising of the echo line also shuts of the MAX232. After a while – no more than 10-12mS normally, the returning echo will be detected and the PIC will lower the echo line. The width of this pulse represents the flight time of the sonic burst. If no echo is detected then it will automatically time out after about 30mS (Its two times the WDT period of the PIC). Because the MAX232 is shut down during echo detection, you must wait at least 10mS between measurement cycles for the +/- 10v to recharge.
Performance of this design is, I think, quite good. It will reliably measure down to 3cm and will continue detecting down to 1cm or less but after 2-3cm the pulse width doesn’t get any smaller.
Maximum range is a little over 3m. As and example of the sensitivity of this design, it will detect a 1inch thick plastic broom handle at 2.4m.
Average current consumption is reasonable at less than 50mA and typically about 30mA.
Download the source code and a ready assembled hex file.
You can also purchase a tiny, ready assembled, low cost module based on the above design.
Feedback, by email or in the electronic/robotic newsgroups, is very welcome.

点击此处下载 ourdev_537772.rar(文件大小:27K) (原文件名:SRF01所有资料.rar)

出0入0汤圆

发表于 2011-12-6 23:05:59 | 显示全部楼层
mark

出0入0汤圆

发表于 2011-12-6 23:26:38 | 显示全部楼层
瓦屋,好给力

出0入0汤圆

发表于 2012-4-4 16:06:49 | 显示全部楼层
呵呵,学习了…………

出0入0汤圆

发表于 2012-5-6 17:41:56 | 显示全部楼层
谢谢分享。。。

出0入0汤圆

发表于 2012-7-23 14:53:52 | 显示全部楼层
好的............

出0入0汤圆

发表于 2012-7-24 11:38:06 | 显示全部楼层
谢谢分享。。。

出0入0汤圆

发表于 2012-7-28 17:46:56 | 显示全部楼层
可惜是汇编的

出0入0汤圆

发表于 2012-7-29 20:25:04 | 显示全部楼层
学习学习了。。。

出0入0汤圆

发表于 2012-10-23 14:57:13 | 显示全部楼层
学习学习,这个不错

出0入0汤圆

发表于 2012-10-30 23:00:41 | 显示全部楼层
很有难度。沙发

出0入0汤圆

发表于 2013-3-25 15:29:30 | 显示全部楼层
下载学习下。

出0入0汤圆

发表于 2013-4-9 14:04:21 | 显示全部楼层
谢谢楼主,顶

出0入0汤圆

发表于 2013-5-18 17:32:44 | 显示全部楼层
学习学习,留个脚印。

出0入0汤圆

发表于 2013-7-29 12:59:32 | 显示全部楼层
MARk,看看……

出0入0汤圆

发表于 2013-7-29 13:57:06 | 显示全部楼层
LZ下载不了了?

出0入0汤圆

发表于 2014-2-15 20:42:10 | 显示全部楼层
学习了。。。

出0入0汤圆

发表于 2014-2-18 20:45:37 | 显示全部楼层
mark mark mark

出0入0汤圆

发表于 2014-5-8 22:37:31 | 显示全部楼层
不错,感谢楼主!
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-5-6 18:38

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表