TOP

Grove - Ultrasonic Ranger

From Wiki 来自痴汉的爱
Jump to: navigation, search

[中文]

Ultrasonic Ranger.jpg

Contents

Introduction

This Grove - ultrasonic sensor is a non-contact distance measurement module which works at 42KHz, suitable for projects that require middle distance measurement.
Model: SEN10737P

Specifications

  • Operating voltage: 3.3/5.0VDC
  • Operating current: 15mA
  • Ultrasonic frequency: 42kHz
  • Measuring range: 3-400cm
  • Resolution: 1cm
  • Output: PWM
  • Suli-compatible Library


Note: More details about Suli-compatible Library, please refer to Suli

Demonstration

Here we demonstrate how to use Grove - Ultrasonic Ranger to obtain distance message.
Connect Serial LCD to D4/D5 pins of Grove - Base Shield and connect Ultrasonic Ranger to D7 pin Jasa seo.

UltrasonicRanger.png
Download the UltrasonicRanger Library and SerialLCD Library from Github . For this libraries, rather than from Arduino library files, they are from other pages. You need to install them to Arduino Library. Please refer to the course"How to install library" of wiki page to learn the specific steps.
open code by the path:File->Examples->UltrasonicRanger->examples->UltraDisOnSeeedSerialLcd and upload.

/***************************************************************************/        
// Function: Measure the distance to obstacles in front and display the
//                         result on seeedstudio serialLcd. Make sure you installed the
//                         serialLCD, SofewareSerial and Ultrasonic library.        
//        Hardware: Grove - Ultrasonic Ranger, Grove - Serial LCD
//        Arduino IDE: Arduino-1.0
//        Author:         LG                
//        Date:          Jan 17,2013
//        Version: v1.0 modified by FrankieChu
//        by www.seeedstudio.com

/*****************************************************************************/


#include <SoftwareSerial.h>
#include <SerialLCD.h>
#include "Ultrasonic.h"

SerialLCD slcd(11,12);
Ultrasonic ultrasonic(7);
void setup()
{
   slcd.begin();
}
void loop()
{
        long RangeInCentimeters;
        RangeInCentimeters = ultrasonic.MeasureInCentimeters();
        delay(150);
        slcd.clear();
        slcd.setCursor(0,0);
        slcd.print("The distance:");
        slcd.setCursor(0,1) ;
        slcd.print(RangeInCentimeters,DEC);
        slcd.setCursor(5,1) ;
        slcd.print("cm");
}

Also we shot a video about it. Find it in the Resources! It can give you a more straightforward instruction.

Resources

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Navigation
Collections
Toolbox