This example demonstrates how to use the Azande Library together with a Ultrasonic Range Detector.


The Ultrasonic Range Detector



Features

The following Feature Types are used:

  • Command Bool Feature: With the cmdSetUnit the user can select unit cm/mm to use.
  • Event Int32 Feature: The events eventDistanceCm and eventDistanceMm present the measured distance.
  • Command Int32 Feature: With the commands cmdSetAlarmCm and cmdSetAlarmMm the user can set limit for alarm.
  • Event Bool Feature: The event eventAlarm is sent every time a new measurement is done. True when distance <= limit.



The circuit


Ultrasonic Range Detector

Arduino Board

Pin

Pin

Type

Vcc

5V

Supply

Trig

Digital Pin 4

Output

Echo

Digital Pin 2

Input

Gnd

GND

Supply



3.3V Supplied Arduino

If you use an Arduino with Vcc = 3.3V, the input ca not exceed 3.3V.

A simple solution is to use a Voltage Divider.




Azande Studio View




Downloads

The example is included in the Arduino Library.


Click here to access download of the Arduino Library