Download Ultrasonic Sensor Ev3 Macbook Pro

edit
  1. Download Ultrasonic Sensor Ev3
  2. Download Ultrasonic Sensor Ev3 Macbook Problems
  3. Download Ultrasonic Sensor Ev3 Macbook Programming
  4. Ev3 Ultrasonic Sensor Program
Touch sensor ev3

This Grove - Ultrasonic ranger is a non-contact distance measurement module which works at 40KHz. When we provide a pulse trigger signal with more than 10uS through signal pin, the Grove_Ultrasonic_Ranger will issue 8 cycles of 40kHz cycle level and detect the echo. The pulse width of the echo signal is proportional to the measured distance. Here is the formula: Distance = echo signal high time * Sound speed (340M/S)/2. Grove_Ultrasonic_Ranger's trig and echo signal share 1 SIG pin.

Warning

Do not hot plug Grove-Ultrasonic-Ranger, otherwise it will damage the sensor. The measured area must be no less than 0.5 square meters and smooth.

To use Lego's Ultrasonic Sensor with the EV3 Home set, an extra component must be added to the EV3 Home set's editor. This tutorial shows you how to do that.

Version¶

  1. Download and install the new pre-release programming software for LEGO MINDSTORMS EV3 to your Apple Computer with macOS 10.14 Mojave or above. This pre-release has limited functionality, but you can install and connect to your programmable brick and download programs to your five Hero robots.
  2. How Ultrasonic Sensors Work. Ultrasonic sensors work by sending out a sound wave at a frequency above the range of human hearing. The transducer of the sensor acts as a microphone to receive and send the ultrasonic sound. Our ultrasonic sensors, like many others, use a single transducer to send a pulse and to receive the echo. The sensor determines the distance to a target by measuring time.
Product VersionChangesReleased Date
Grove-Ultrasonic ranger V1.0InitialMar 2012
Grove-Ultrasonic ranger V2.0Improve the power stability with low-voltage main board with below changes: 1. Added an capacitance C14 2. Redesigned the layout to make it more tidy 3. Compatible with 3.3V voltage systemJuly 2017

Specification¶

ParameterValue/Range
Operating voltage3.2~5.2V
Operating current8mA
Ultrasonic frequency40kHz
Measuring range2-350cm
Resolution1cm
OutputPWM
Size50mm X 25mm X 16mm
Weight13g
Measurement angle15 degree
Working temperature-10~60 degree C
Trigger signal10uS TTL
Echo signalTTL

Tip

More details about Grove modules please refer to Grove System

Platforms Supported¶

ArduinoRaspberryArduPy

Caution

The platforms mentioned above as supported is/are an indication of the module's software or theoretical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Getting Started¶

Note

If this is the first time you work with Arduino, we firmly recommend you to see Getting Started with Arduino before the start.

Play With Arduino¶

Hardware¶

  • Step 1. Prepare the below stuffs:
Seeeduino V4.2Base ShieldGrove - Ultrasonic Ranger
Get One NowGet One NowGet One Now
  • Step 2. Connect Ultrasonic Ranger to port D7 of Grove-Base Shield.

  • Step 3. Plug Grove - Base Shield into Seeeduino.

  • Step 4. Connect Seeeduino to PC via a USB cable.

Note

If we don't have Grove Base Shield, We also can directly connect Grove_Ultrasonic_Ranger to Seeeduino as below.

SeeeduinoGrove-Ultrasonic Ranger
5VRed
GNDBlack
Not ConenctedWhite
D7Yellow

Software¶

  • Step 1. Download the UltrasonicRanger Library from Github.

  • Step 2. Refer How to install library to install library for Arduino.

  • Step 3. Copy the code into Arduino IDE and upload. If you do not know how to upload the code, please check how to upload code.

  • Step 4. We will see the distance display on terminal as below.

Play with Codecraft¶

Hardware¶

Step 1. Connect a Grove - Ultrasonic Ranger to port D7 of a Base Shield.

Step 2. Plug the Base Shield to your Seeeduino/Arduino.

Step 3. Link Seeeduino/Arduino to your PC via an USB cable.

Software¶

Step 1. Open Codecraft, add Arduino support, and drag a main procedure to working area.

Note

If this is your first time using Codecraft, see also Guide for Codecraft using Arduino.

Step 2. Drag blocks as picture below or open the cdc file which can be downloaded at the end of this page.

Upload the program to your Arduino/Seeeduino.

Success

When the code finishes uploaded, you will see distance displayed in Serial Monitor.

Play With Raspberry Pi (With Grove Base Hat for Raspberry Pi)¶

Hardware¶

  • Step 1. Things used in this project:
Raspberry piGrove Base Hat for RasPiGrove - Ultrasonic Ranger
Get ONE NowGet ONE NowGet ONE Now
  • Step 2. Plug the Grove Base Hat into Raspberry.

  • Step 3. Connect the Grove - Ultrasonic Ranger to port D5 of the Base Hat.

  • Step 4. Connect the Raspberry Pi to PC through USB cable.

Note

For step 3 you are able to connect the ultrasonic ranger to any GPIO Port but make sure you change the command with the corresponding port number.

Software¶

  • Step 1. Follow Setting Software to configure the development environment.

  • Step 2. Download the source file by cloning the grove.py library.

  • Step 3. Excute below commands to run the code.

Following is the grove_ultrasonic_ranger.py code.

Success

If everything goes well, you will be able to see the following result

You can quit this program by simply press Ctrl+C.

Play With Raspberry Pi (with GrovePi_Plus)¶

Hardware¶

  • Step 1. Prepare the below stuffs:
Raspberry piGrovePi_PlusGrove - Ultrasonic Ranger
Get One NowGet One NowGet One Now
  • Step 2. Plug the GrovePi_Plus into Raspberry.

  • Step 3. Connect Grove-Ultrasonic ranger to D4 port of GrovePi_Plus.

  • Step 4. Connect the Raspberry to PC through USB cable.

Software¶

  • Step 1. Follow Setting Software to configure the development environment.

  • Step 2. Git clone the Github repository.

  • Step 3. Excute below commands to use the ultrasonic_ranger to meansure the distance.

Here is the grove_ultrasonic.py code.

  • Step 4. We will see the distance display on terminal as below.

Play With Wio Terminal (ArduPy)¶

Hardware¶

  • Step 1. Prepare the below stuffs:
Wio TerminalGrove - Ultrasonic Ranger
Get One NowGet One Now
  • Step 2. Connect Grove - Ultrasonic Ranger to D0 port of Wio Terminal.

  • Step 3. Connect the Wio Terminal to PC through USB Type-C cable.

Software¶

  • Step 1. Follow ArduPy Getting Started to configure the ArduPy development environment on Wio Terminal.

  • Step 2. Make sure that the ArduPy firmware contains the ultrasonic ranger ArduPy library using the following commands. For more information, please follow here.

  • Step 3. Copy the following code and save it as ArduPy-ultrasonic.py:
  • Step 4. Save the ArduPy-ultrasonic.py in a location that you know. Run the following command and replace<YourPythonFilePath> with your ArduPy-ultrasonic.py location.
  • Step 5. We will see the distance display on terminal as below, and displaying on the Wio Terminal LCD screen.

FAQs¶

Q1: How does the Grove-Ultrasonic sensor work?

  • A1: When we provide a pulse trigger signal with more than 10uS through singal pin, the Grove_Ultrasonic_Ranger will issue 8 cycles of 40kHz cycle level and detect the echo. The pulse width of the echo signal is proportional to the measured distance. Here is the formula: Distance = echo signal high time * Sound speed (340M/S)/2.

Q2: Why Grove-Ultrasonic sensor only has 1 signal pin, comparing with other ultrasonic sensor Trig and Echo pins?

  • A2:Grove_Ultrasonic_Ranger’s trig and echo signal share 1 SIG pin through MCU.

Q3: Can we connect mulitule ultrasonic to one arduino?

  • A4: Yes, Here is the example, one sensor is connected to D2 and other to D3.

Resources¶

  • [PDF]Download Wiki PDF
  • [PDF]Grove_Ultrasonic Ranger Schematic
  • [PDF]Ceramic Ultrasonic Sensor NU40C16T/R-1
  • [Library]Grove_Ultrasonic Ranger library
  • [Codecraft]CDC File
  • [Project]The Color Helix
  • [Project]Indoor Lightning Cloud
  • [Project]Automatic Water Level Controller
  • [Example]Example_Measure_distance_and_led_display
  • [Example]Example_Measure_and_display_the_distance

Project¶

Hacking the Stairs at Seeed's New Office: Turn the stairs at the office into an interactive installation, and even a cool way to convey the message 'STAFF ONLY' to visitors.

Tech Support¶

Please submit any technical issue into our forum.

Library

Simulink® Support Package for LEGO® MINDSTORMS® EV3Hardware

Description

Measure the distance between the EV3 Ultrasonic Sensor and thenearest object in front of the sensor.

Download Ultrasonic Sensor Ev3

The sensor can detect objects from approximately 5 to 255 centimetersaway.

When the nearest object is beyond the maximum range of the UltrasonicSensor, the sensor outputs the maximum value, 255.

The measured distances are approximate. For greater precision,calibrate the sensor output values against physical measurements.

The distance from which the sensor first detects an approachingobject depends on:

  • The ultrasonic reflectance of the object, which isa function of the object’s size and composition. The sensordetects large hard objects from a greater distance than small softones. For example, the sensor might detect a pane of glass at 255cm and a hand puppet at 150 cm.

  • The angle of incidence of the object relative to thesensor. The sensor detects objects directly in front of it at greaterdistances than objects off to the sides.

The block output emits values as uint8.

During simulations without hardware, this block emits zeros.See Block Produces Zeros or Does Nothing in Simulation.

Parameters

EV3 brick input port

Select the EV3 sensor port to which the sensor is connected.Avoid assigning multiple devices to the same port. The options are 1, 2, 3,or 4.

Sample time

Specify how often the block reads sensor values. This valuedefaults to 0.1. Shorter sample times, such as 0.01,may produce unreliable measurements.

Download Ultrasonic Sensor Ev3 Macbook Problems

Smaller values require the processor to complete the same numberof instructions in less time, which can cause task overruns.

Download Ultrasonic Sensor Ev3 Macbook Programming

See Also

Download

Ev3 Ultrasonic Sensor Program

External Websites