Distance US Bricklet

Note

The Distance US Bricklet is discontinued and is no longer sold. The Distance US Bricklet 2.0 is the recommended replacement.

Features

  • Measures distances from 2cm to 400cm with ultrasound

  • 12bit resolution

Description

The Distance US Bricklet is equipped with an ultrasonic distance sensor and extends Bricks by the possibility to measure distances from 2cm to 400cm. The measured distance is reported as unitless value, not in mm. This is because the relation between the distance value and the actual distance depends on the exact value of the 5V supply voltage. Deviations in the supply voltage result in deviations in the measured distance values. With configurable events it is possible to react on changing distances without polling. Typical applications can be found in robotics, usage as light barrier alternative and so on.

Technical Specifications

Property

Value

Sensor

HC-SR04

Current Consumption

8mA

Distance

2cm - 400cm, 12bit resolution

Measuring Angle

15°

Update Rate

40Hz

Dimensions (W x D x H)

45 x 20 x 30mm (1.78 x 0.78 x 1.18")

Weight

13g

Resources

Test your Distance US Bricklet

To test a Distance US Bricklet you need to have Brick Daemon and Brick Viewer installed. Brick Daemon acts as a proxy between the USB interface of the Bricks and the API bindings. Brick Viewer connects to Brick Daemon. It helps to figure out basic information about the connected Bricks and Bricklets and allows to test them.

Connect the Distance US Bricklet to a Brick with a Bricklet Cable.

If you connect the Brick to the PC over USB, you should see a new tab named "Distance US Bricklet" in the Brick Viewer after a moment. Select this tab. If everything went as expected you can now see the measured distance.

Distance US Bricklet in Brick Viewer

After this test you can go on with writing your own application. See the Programming Interface section for the API of the Distance US Bricklet and examples in different programming languages.

Case

A laser-cut case for the Distance US Bricklet is available.

Case for Distance US Bricklet

The assembly is easiest if you follow the following steps:

  • Screw spacers to the Bricklet (each long spacer consists of 2x 9mm and 1x 12mm pieces),

  • build up side plates and put them around Bricklet and sensor (the front plate is asymmetric, the wider margin goes to the right side, when viewed from the outside),

  • screw bottom plate to bottom spacers,

  • screw top plate to top spacers.

Below you can see an exploded assembly drawing of the Distance US Bricklet case:

Exploded assembly drawing for Distance US Bricklet

Hint: There is a protective film on both sides of the plates, you have to remove it before assembly.

Programming Interface

See Programming Interface for a detailed description.

Language

API

Examples

Installation

C/C++

API

Examples

Installation

C#

API

Examples

Installation

Delphi/Lazarus

API

Examples

Installation

Go

API

Examples

Installation

Java

API

Examples

Installation

JavaScript

API

Examples

Installation

LabVIEW

API

Examples

Installation

Mathematica

API

Examples

Installation

MATLAB/Octave

API

Examples

Installation

MQTT

API

Examples

Installation

openHAB

API

Examples

Installation

Perl

API

Examples

Installation

PHP

API

Examples

Installation

Python

API

Examples

Installation

Ruby

API

Examples

Installation

Rust

API

Examples

Installation

Shell

API

Examples

Installation

Visual Basic .NET

API

Examples

Installation

TCP/IP

API

Modbus

API