找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

搜索
查看: 11356|回復(fù): 6
打印 上一主題 下一主題
收起左側(cè)

US-015超聲波測(cè)距資料(含Arduino與單片機(jī)源碼,電路圖等)

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
US-015使用說(shuō)明書及例程-V2.0+SA-260

US-015是US-020模塊的升級(jí)版本,和US-020兼容,以前US-020的測(cè)試程序US-015也適用。
US-015超聲波測(cè)距模塊例程與US-020的測(cè)試?yán)滔嗤?br />
文件夾“US_015_GPIO_HighPrecision_ino”是用Arduino進(jìn)行控制的高精度測(cè)距版本。




文件夾中的pde文件為Arduino的工程文件,可通過(guò)記事本打開(kāi)和編輯。

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. }

復(fù)制代碼

所有資料51hei提供下載:
US-015使用說(shuō)明書及例程-V2.0 SA-260.rar (2.21 MB, 下載次數(shù): 99)



分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏1 分享淘帖 頂1 踩
回復(fù)

使用道具 舉報(bào)

沙發(fā)
ID:545730 發(fā)表于 2019-5-23 17:20 | 只看該作者
請(qǐng)問(wèn)一下超聲波傳感器HC-SR04和超聲波傳感器US-015程序上的區(qū)別大嗎
回復(fù)

使用道具 舉報(bào)

板凳
ID:513258 發(fā)表于 2019-9-21 16:11 | 只看該作者
張琪11 發(fā)表于 2019-5-23 17:20
請(qǐng)問(wèn)一下超聲波傳感器HC-SR04和超聲波傳感器US-015程序上的區(qū)別大嗎

接口與功能基本一致,使用芯片不同,測(cè)量精度等有小差別
回復(fù)

使用道具 舉報(bào)

地板
ID:682262 發(fā)表于 2020-1-6 16:23 | 只看該作者
eagler8 發(fā)表于 2019-9-21 16:11
接口與功能基本一致,使用芯片不同,測(cè)量精度等有小差別

US-015程序芯片是什么型號(hào),
回復(fù)

使用道具 舉報(bào)

5#
ID:513258 發(fā)表于 2020-1-20 11:41 | 只看該作者
fengbangwei 發(fā)表于 2020-1-6 16:23
US-015程序芯片是什么型號(hào),

當(dāng)時(shí)做實(shí)驗(yàn)時(shí)也沒(méi)有查到芯片型號(hào),好像這款分立元件比較多
回復(fù)

使用道具 舉報(bào)

6#
ID:513258 發(fā)表于 2020-1-20 11:41 | 只看該作者

回復(fù)

使用道具 舉報(bào)

7#
ID:231727 發(fā)表于 2020-11-24 16:15 | 只看該作者
我以為有us015原理圖,這個(gè)是賣家的資料吧
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表