找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 9781|回复: 6
收起左侧

US-015超声波测距资料(含Arduino与单片机源码,电路图等)

[复制链接]
ID:331212 发表于 2018-5-16 13:20 | 显示全部楼层 |阅读模式
US-015使用说明书及例程-V2.0+SA-260

US-015是US-020模块的升级版本,和US-020兼容,以前US-020的测试程序US-015也适用。
US-015超声波测距模块例程与US-020的测试例程相同。

文件夹“US_015_GPIO_HighPrecision_ino”是用Arduino进行控制的高精度测距版本。
0.png

0.jpg 0.jpg

文件夹中的pde文件为Arduino的工程文件,可通过记事本打开和编辑。

US-015_GPIO_Arduino源程序如下:
  1. unsigned int EchoPin = 2;           // connect Pin 2(Arduino digital io) to Echo at US-015
  2. unsigned int TrigPin = 3;           // connect Pin 3(Arduino digital io) to Trig at US-015
  3. unsigned long Time_Echo_us = 0;
  4. unsigned long Len_mm  = 0;
  5. void setup()
  6. {  //Initialize
  7.     Serial.begin(9600);                        //Serial: output result to Serial monitor
  8.     pinMode(EchoPin, INPUT);                    //Set EchoPin as input, to receive measure result from US-015
  9.     pinMode(TrigPin, OUTPUT);                   //Set TrigPin as output, used to send high pusle to trig measurement (>10us)
  10. }

  11. void loop()
  12. {
  13.     digitalWrite(TrigPin, HIGH);              //begin to send a high pulse, then US-015 begin to measure the distance
  14.     delayMicroseconds(20);                    //set this high pulse width as 20us (>10us)
  15.     digitalWrite(TrigPin, LOW);               //end this high pulse
  16.    
  17.     Time_Echo_us = pulseIn(EchoPin, HIGH);               //calculate the pulse width at EchoPin,
  18.     if((Time_Echo_us < 60000) && (Time_Echo_us > 1))     //a valid pulse width should be between (1, 60000).
  19.     {
  20.       Len_mm = (Time_Echo_us*34/100)/2;      //calculate the distance by pulse width, Len_mm = (Time_Echo_us * 0.34mm/us) / 2 (mm)
  21.       Serial.print("Present Distance is: ");  //output result to Serial monitor
  22.       Serial.print(Len_mm, DEC);            //output result to Serial monitor
  23.       Serial.println("mm");                 //output result to Serial monitor
  24.     }
  25.     delay(1000);                            //take a measurement every second (1000ms)
  26. }

复制代码

所有资料51hei提供下载:
US-015使用说明书及例程-V2.0 SA-260.rar (2.21 MB, 下载次数: 97)
回复

使用道具 举报

ID:545730 发表于 2019-5-23 17:20 | 显示全部楼层
请问一下超声波传感器HC-SR04和超声波传感器US-015程序上的区别大吗
回复

使用道具 举报

ID:513258 发表于 2019-9-21 16:11 | 显示全部楼层
张琪11 发表于 2019-5-23 17:20
请问一下超声波传感器HC-SR04和超声波传感器US-015程序上的区别大吗

接口与功能基本一致,使用芯片不同,测量精度等有小差别
回复

使用道具 举报

ID:682262 发表于 2020-1-6 16:23 | 显示全部楼层
eagler8 发表于 2019-9-21 16:11
接口与功能基本一致,使用芯片不同,测量精度等有小差别

US-015程序芯片是什么型号,
回复

使用道具 举报

ID:513258 发表于 2020-1-20 11:41 | 显示全部楼层
fengbangwei 发表于 2020-1-6 16:23
US-015程序芯片是什么型号,

当时做实验时也没有查到芯片型号,好像这款分立元件比较多
回复

使用道具 举报

ID:513258 发表于 2020-1-20 11:41 | 显示全部楼层
360截图20200120112023397.jpg
回复

使用道具 举报

ID:231727 发表于 2020-11-24 16:15 | 显示全部楼层
我以为有us015原理图,这个是卖家的资料吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

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