ProximityBar

The proximity bar is a Arduino-based prototype input device that uses ultrasonic sensors to measure the distance of a viewer to a public display. We created it as an input mechanism to define the interaction zones for GridOrbit. This page tries to document and provide the files needed to build one proximity bar.

Schematic

Components

Versioning and Operation Modes

The current firmware supports querying for the version and the capabilities of the proximity bar. Once communication through the USB-serial port is established you can query the ProximityBar by sending the character ‘V’. This will give you an answer in the following format:

MM.NN:[S:][CN]

  • MM – Mayor version
  • NN – Minor version
  • S – Supports simple operation mode
  • CN – Supports complex operation mode with N number of sensors.

For example, the version included in this page returns “01.00:S:C3”, meaning that it’s version 1.0, and that it supports both simple and complex operation modes. The complex operation mode captures measurements from 3 different ultrasonic sensors, like shown in the picture above. You can set up the desired operation mode at any time by sending either characters ‘S’ or ‘C’. The ProximityBar will respond with the new operation parameter.

Usage of the C# Wrapper

The C# wrapper has two main classes: the ProximityReader and the Proximity reading.

namespace ProximityBarConsole
{
  public class ProximityReader : IProximityReader
  {
    public const char INPUT_MODECOMPLEX = 'C';
    public const char INPUT_MODESIMPLE = 'S';
    public const char INPUT_READ = 'R';
    public const char INPUT_VERSION = 'V';

    public ProximityReader(string cPort);

    public ProximityReading ActualProximity { get; }

    public string GetVersion();
    public void SetMode(char mode);
    public bool TestConnection();
  }
}
namespace ProximityBarConsole
{
  public class ProximityReading
  {
    public ProximityReading();

    public int Distance { get; set; }
    public Position Position { get; set; }

    public override string ToString();
  }

  public enum Position
  {
    Left = 0,
    Center = 1,
    Right = 2,
    Undefined = 3,
  }
}

So now you can create and query the ProximityReader like this:

IProximityReader reader = new ProximityReader((String)settings["ProximityCOM"]);
ProximityReading reading = reader.ActualProximity;

8 thoughts on “ProximityBar

  1. This is pretty awesome stuff. I want to connect exactly three LEDs and three sensors.

    I’ll follow this and let you know. The connecting to it is what I don’t know how. If I connect it like the picture you have it would work?

  2. That wire you have connecting all the Arduinos, the black one. Where do I get that from? And if I want these wires to stay as connectors how do I do that? Like pins.

  3. i follow your picture and connect and using the code you provided i am unable to get the reading of the distance. why is this so? please advice

Leave a reply to Azzam Aziz Cancel reply