Demand Peripherals     Robotics and Automation Made Easy

US8: Octal Ultrasonic Distance Sensor

The US8 peripheral gives you eight channels of distance measurement using the SRF04 ultrasonic distance sensor.

 

Hardware:

The us8 peripheral uses a us8 card to connect to up to eight SRF-04 ultrasonic sensors. The sensors have one input pin and one output pin. A 10 us pulse on the input starts a ping. The echo time of the ping is given as a pulse width on the output pin. The echo response starts about 100 us after the end of the start pulse. The FPGA measures the pulse width of the echo reply and does an auto-send of that time up to the host. To avoid multiple echoes the peripheral pings only one sensor at a time with pings sent every 60 millisecond.

You can select which sensors are enabled. The scan rate per sensor is faster if you disable unused sensors.

More information about the US8 card is available here cards/us8.html.

 

Resources:

enable : enable/disable sensors.
Enable is a read-write resource that enables or disables individual sensors. Enabled sensors are specified as a two digit hexadecimal number terminated by a newline. The LSB of the enable register corresponds to the lowest numbered sensor, sensor #0. A set bit enables the sensor and a cleared bit disables it. You may wish to disable unused sensors since their presense slows the sampling process. At start-up all sensors are disabled.

distance : stream of sensor ID and distances.
The read-only distance resource gives the sensor number and distance reported by each sensor as the readings come in. The distance resource works with dpcat. This means that several programs can monitor at the same time if you're using distance measurements for both navigation and obsticle avoidance.

The output is a digit that indicates the sensor number followed by the distance in units of one-tenth of an inch. The sensor ID and readings are separated by a space and terminated by a newline. A distance of zero indicates that the sensor is not connected or is not responding. Typical output from the distance resource might appear as:

        0 1055
        1 55
        2 0
        3 1848
        0 1094

 

Examples:

Enable the first four distance sensors and start a data stream of distance measurements.

    dpset us8 enable 0f
    dpcat us8 distance

 

FPGA Defined Peripherals
User Interface
FPGA Configuration
FPGA Buttons & LEDs
Text LCD and Keypad
Quad WS2812 Interface
Quad Slide Pot
Tone Generator
IR Recv/Xmit
6 Digit LCD
RC Decoder
Keyfob RF Decoder
Rotary Encoder Interface
Motion Control
Dual DC Motor Controller
Dual Quadrature Decoder
Quad 13 Bit Servo
Bipolar Stepper Controller
Unipolar Stepper Controller
Simple Input / Output
Quad Binary Output
Quad Binary Input
Quad GPIO
Octal Input/Output
32 Channel Binary Output
32 Channel Binary Input
Sensors
Octal 12-bit ADC
Quad Ping))) Interface
Octal SRF04 Interface
Quad Event Counter
Instrumentation
Generic I2C
Generic SPI
Octal 8-Bit DAC
Quad Digital Potentiometer
Quad PWM Output
Quad PWM Input
4 Bit Pattern Generator
Real Time Clock
Dual Watchdog Timers
  

Interface Cards
User Interface
Audio Amplifier
IR Recv/xmit
Six Digit LCD Display
Keyfob RF Receiver
Rotary Encoder
Quad Switch Card
Text LCD / keypad
Quad Slide Pot
Motion Control
Dual 7-amp H-bridge
Quad Open Drain Driver
Quad 10 Amp Relay Card
Input / Output
Octal 8-Bit DAC
Quad Digital Potentiometer
Octal 12-bit ADC
9DOF IMU
Octal SRF04
Quad GPIO
Generic I2C
Generic SPI
USB 2.0 Hub
Real Time Clock
Slot Expander
Octal Input/Output
32 Channel Input
32 Channel Output
Accessories
Power Distribution Card
15 Amp Power Distribution
5 Volt Switching Regulator
ATX Power Break-Out Card
Disk Drive Power Break-Out
MP43 Aluminum Mounting Plate
WW2 Prototyping Card
WW1 Small Prototyping Card