/* This Arduino script uses the DYP-ME007 Ultrasound Range finder to
* measure distance in cm and displays the distance on a DFRobot
* I2C LCD Module 508040.
* Hardware: Connect the DYP-ME007 to +5V and Ground, and
* the dypOutputPin to the DYP_ME007 "Trig" pin and the
* the dypInputPin to the DYP-ME007 "Echo" pin.
* By default I2C chips use analog pin A4 for data SDA and A5
* for the clock SCL. Of course 5V and GND need to be connected too.
* Credits to DFRobot and Bexilino on http://arduino.cc/forum/index.php?topic=60973.0
* from which I have copied parts.
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
int dypOutputPin = 2; // TRIG
int dypInputPin = 3; // ECHO
long distance;
long cm;
void setup(){
pinMode(dypOutputPin, OUTPUT);
pinMode(dypInputPin,INPUT);
lcd.init(); // initialize the lcd
lcd.backlight();
}
void loop()
{
// The DYP-ME007 pings on the low-high flank...
digitalWrite(dypOutputPin, LOW);
delayMicroseconds(2);
digitalWrite(dypOutputPin, HIGH);
delayMicroseconds(10);
digitalWrite(dypOutputPin, LOW);
// the distance is proportional to the time interval
// between HIGH and LOW
distance = pulseIn(dypInputPin, HIGH);
cm= distance/58;
lcd.clear();
lcd.print(cm);
delay(100); // avoids LCD flicker
}
Vannsikker ultralydsensor
Pris:
kr. 250,00
Features:
1) High degree of protection;
2) Wide usage range, low-power dissipation;
3) Simple to use, handle easily;
4) High measuring accuracy and resolution;
5) Small detection blind area, long detection range;
6) With high precision temperature output and temperature compensation function;
7) Varied output mode: serial output, PWM output, digital output;
- 8) Detection range: 8M
Applications:
1) High precision distance measuring;
2) Obstacle-avoidance, automatic control;
3) Objects close to, exist, perceive;
4) Traffic control;
5) Security and protection, industrial control;
6) Artificial intelligence, teaching and research;
Electrical parameters:
|
PWM output |
Serial output |
Digital output |
|
Supply voltage |
3.3V-12V |
|||
Standby current |
Less than 200uA |
More than 400uA |
||
Average current |
2mA(base on supply voltage is 5V、cycle is 250MS) |
|||
Center frequency |
40 KHZ |
|||
Blind zone |
200 MM |
|||
Max. detection distance |
More than 8M |
|||
Emission angle |
8° |
|||
Work cycle |
More than 60MS,controlled by the trigger signal |
250 MS |
||
Trigger signal |
Falling edge,low level keeps 0.1-10MS |
GND connection |
||
Test precision |
±1CM |
|||
Resolution of ranging |
1 MM |
|||
Temperature compensation |
Non compensation |
compensation |
||
Temperature output |
None |
Have |
None |
|
Operating temperature |
-25℃—70℃ |
|||
Storage temperature |
-40℃—85℃ |
Package Includes:
- 1x Controller
- 1x Wire