Digilent 240-071P User Manual

1300 Henley Court
Figure 1. The PmodMAXSONAR.
Pullman, WA 99163
509.334.6306
www.digilentinc.com
PmodMAXSONAR™ Reference Manual

Overview

The PmodMAXSONAR is an ultrasonic range detector that utilizes the MaxBotix® LV-MaxSonar®-EZ1™ sonar sensor to provide 1” resolution for your distance sensing needs. This Pmod provides versatility by allowing data to be read via analog, pulse-width modulation, and serial communication. Features Include:
Effective detection range of 6”-255”
42 KHz sonar operation frequency
Readings every 50 milliseconds
Continuous measurement (free run) operation
Three methods of obtaining data
o 5-Byte serial output o Analog output (VCC/512)V per inch o Pulse Width output, 147µs per inch
2.5V-5.5V operating voltage range with 2mA typical
current draw

Functional Description

The PmodMAXSONAR uses a 6-pin connector that can communicate range data to the host board as an analog value, a pulse-width, or a 5-byte serial packet. Sensor data ranges from a minimum of 6 inches to a maximum of 254 inches, with a resolution of 1 inch. Range data is acquired by the module sending thirteen 42 KHz beams of varying widths, allowing for more accurate detection. Under free-run operation, range readings can be taken every 50 milliseconds.

Interface

The PmodMAXSONAR can deliver range data via an asynchronous serial packet, an analog value, or a pulse-width. During operation, all outputs are used by the PmodMAXSONAR simultaneously. After an initial power-up time of 250 milliseconds, the PmodMAXSONAR will need to be calibrated. Calibration will occur if the RX pin is left open or high and will take 49ms. An initial range reading will then occur, also taking 49ms. All readings following this initial calibration and first reading will take 49ms. Range readings will occur when the RX pin is set high.
DOC#: 514-007
Other produc t and compa ny names mentioned may be trademarks of their res pective owne rs.
Copyright Digilent, Inc. All rights reserved.
Page 1 of 2
PmodMAXSONAR™ Reference Manual
Pin
Example
Description
1
AN
Analog Output
2
RX
Range Control Signal
3
TX
UART Transmit
4
PW
Pulse Width Output
5
GND
Power Supply Ground
6
Vcc
Power Supply (3.3V/5V)
Serial data is sent from the PIC16F676 on the PmodMAXSONAR at 9600 baud, with 8 data bits, 1 stop bit, and no parity bits. Received range data is formatted in a packet of 5 ASCII characters. The first character is an ASCII ‘R’, followed by three ASCII characters representing the range, and terminated with a carriage return (ASCII value 13). When the RX pin is high, serial data will be continuously sent on the TX pin as it becomes available.
Analog range data can be acquired from the AN pin of the PmodMAXSONAR. The scaling factor for the analog data is (Vcc/512)V per inch. This gives approximate outputs of 9.8mV/in at an operating voltage of 5V, and 6.4mV/in at an operating voltage of 3.3V.
Pulse-width output from the PmodMAXSONAR uses a scaling factor of 147µs per inch. After the 42 KHz pulses are sent, the PW pin is set high. The PW pin is pulled low after the PmodMAXSONAR detects a target. The width of the pulse will not exceed 37.5ms. If the pulse is 37.5ms long, no target has been detected.
Figure 2 shows an example of the timing of PWM pulses. The first pulse of 37.5ms indicates that no target has been detected. The second pulse of 10ms indicates that an object has been identified 68 inches away from the ultrasonic module.
Figure 2. Timing diagram for pulse-width output.
Table 1. Interface connector signal description.

Power Supply

Any external voltage applied to Vcc must be kept between 2.5V and 5.5V to avoid damaging the PmodMAXSONAR. It is recommended to operate the board at 3.3V
Standard Pmod headers on Digilent boards provide both 3.3V and 5.0V power supplies for Pmods. Make sure that the jumper next to the Pmod header is shorted correctly. Note that the voltage applied to Vcc will affect the analog output level of the PmodMAXSONAR.
Note: For more information on the PmodMAXSONAR, see the MaxBotix LV-MaxSonar-EZ1 datasheet at
www.maxbotix.com
Copyright Digilent, Inc. All rights reserved. Other produc t and compa ny names mentioned may be trademarks of their res pective owne rs.
.
Page 2 of 2
Loading...