IR Range Sensor Reference Manual
IR Range Sensor Reference Manual
Revision: October 31, 2011
1300 NE Henley Court, Suite 3
Pullman, WA 99163
(509) 334 6306 Voice | (509) 334 6300 Fax
Overview
The IR Range Sensor is a great way to add
range detection to robotic projects that use
Cerebot boards. The sensor detects reflective
objects 10 to 80 cm away.
Features include:
a Sharp 2Y0A21 infrared sensor
Futaba-style 3-pin connector
an 8 Digilent cable
Cerebot Interface
Functional Description
The Cerebot IIs ADC analog pins are
The IR Range Sensor is a three-terminal
connected through servo pins S1-S8. Plug the
device that generates an analog voltage
IR Range Sensor directly into the onboard
representing the distance to a reflected object.
servo header, or use a PmodCON3 to connect
up to four sensors via JH pins 1-6 or 7-12.
The sensor connects to the ADC found on all
Cerebot boards. The cable maps the output
The Cerebot MX-series boards require a
pins to a 3-pin connector. The yellow wire is for
PmodCON3 to access the Futaba-style
the analog output signal. The pin should be
connectors on the analog ports. The
connected to the analog-to-digital converter
PmodCON3 exposes four ADC analog
(ADC) on your microcontroller. The red wire is
channels to the connectors. The PmodCON3
the Vcc power supply to the sensor and is
can be used on any Pmod header with ADC
diode-protected against reverse polarization.
analog pins.
The black wire should be connected to the
ground of the ADC.
Use a 4.5V to 5.5V power supply for the IR
Range Sensor. The sensors Vcc input range is
0.3V to 7V, and the analog output is 0.4V to
3V, depending on the distance to the object.
Note: When using more than one IR Range
Sensor, additional bypass capacitors should be
used between Vcc and ground to filter out the
switching noise generated by the sensor on the
Vcc supply line. See the Sharp 2Y0A21
datasheet for recommended capacitor sizes.
Doc: 515-009 page 1 of 2
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. IR Range Sensor Reference Manual
The following table lists the PmodCON3 You could also use the J6 terminal block on
header pins used with different Cerebot the PmodCON3 to supply power to the servo
boards. power pins on the PmodCON3.
The PmodRS232 uses Pmod header JE pins
PmodCON3
1-6 to send sampled data. Any serial port
Board Header Pins
monitor that displays hex data will work. In the
Cerebot II JH 1-6 or 7-12
code, the UART is configured to send data at
Cerebot 32MX4 JJ 1-6 or 7-12
57600 baud, 8 bits, 1 stop bit with no flow
control.
JK 1-6
Cerebot 32MX7 JA 1-6 or 7-12
Cerebot MX3cK JE 8-12
Cerebot MX4cK JJ 1-6 or 7-12
JK 7-12
Cerebot MX7cK JA 1-6 or 7-12
Note: The Cerebot II uses servo connectors
S1-S8. The MX3cK PmodCON3 header J2
does not have an ADC pin, so only headers
J3-J5 have ADC channels tied to the IR
sensors.
Cerebot 32MX4 Sample Project
The following is the hardware configuration for
using the IR Range Sensor with a PmodCON3,
PmodRS232, and Cerebot 32MX4 board. The
code for this project can be downloaded from
the IR Range Sensor page at
www.digilentinc.com.
The IR sensor is connected to header J2 on
the PmodCON3. The PmodCON3 is then
connected to the Cerebot 32MX4 using Pmod
header JJ pins 1-6 (the top six pins of the
header). Pin 1 of the PmodCON3 needs to be
connected to pin 1 on the Cerebot 32MX4.
The Cerebot 32MX4 uses a 5V power supply.
The Pmod header has the Vcc power selector
jumper JPJ set in the VU setting; this connects
the Vcc pins on the Pmod header to the
boards external power supply. The
PmodCON3 has jumper JP1 set to the Vcc
position to draw power from the Vcc pins on
the Pmod header.
www.digilentinc.com page 2 of 2
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.