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
- Hardware
- Arduino Diecimila - http://www.arduino.cc/en/Main/ArduinoBoardDiecimila
- 3x PING))) Ultrasonic Sensors - http://www.parallax.com/tabid/768/ProductID/92/Default.aspx
- 3x LEDs
- Software
- Arduino Software and C# Wrapper - https://github.com/jhincapie/ProximityBar
- Arduino Driver - http://www.ftdichip.com/Drivers/VCP.htm
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;
