This is the revision A version of the IRDistance2 module.

IRDistance2 Module (Revision A)

Table of Contents

1. Introduction

{more here}

2. Programming

Command
Name
Bit Action Description
8 7 6 5 4 3 2 1 0
Distance_Read 0 0 0 0 0 0 0 s s Send Return the distance for senosr ss as dddd dddd
0 d d d d d d d d Receive
Common
Commands
0 1 1 1 1 1 1 x x Send Standard common command. See specifications for details.
0 a a a a a a a a Receive
Select 1 a a a a a a a a Send Select the module with an address of aaaa aaaa. A time-out indicates that the module is not selected.
0 0 0 0 0 0 0 0 0 Receive

3. Hardware

The hardware consists of a circuit schematic and a printed circuit board.

The parts list kept in a separate file -- irdistance2.ptl.

3.1 Circuit Schematic

The schematic for the IRDistance2 module is shown below:

IRDistance2 Schematic

The circuit above does not work. I am leaving the description in, but do not believe it. David Wyland sent me an alternative circuit that I will be switching over to:

Better circuit

The module is connected to the RoboBricks2 bus via the 2×5 male connector N1 which feeds the can CAN bus physical layer signals into the MCP2551 (U2) which fed into the PIC16F688 microcontroller (U1). The power draw of a GP2D12 varies between 220mA and 9mA. For this reason it is not powered off of the logic power bus. Insetead, power is provided by the battery power bus. The battery power bus is fead into the low drop out voltage regulator VR1 with regulation tantalum capacitors C3 and C4.

There are two identical circuits for processing the analog signals coming in on pin 3 of N2 and N3. The top half of the circuit processes the analog signal on N2 and the bottom half processes the analog signal on N3. Only the top half of the circuit is discussed here.

This circuit relies on the fact that the optoisolators in PS2501-4 quad optoisolator (U3) are on the same piece of silicon and are, therefore, matched transistors and light emitting diodes. What this means is that if the current through two light emitting diodes in U3 are the same, they will produce the same amount of optical energy, and finally produce the same amount of collector current on the matching phototransistors in U3. No common ground is required to pull this off.

This circuit is designed to replicate the voltage on pin 3 on N2 on the collector resistor R5 and its matching collector resistor R8. The analog signal comes in on pin 3 of N2 and is fed into the operation amplifier in U4. The feedback circuit adjusts the current the light emitting diode on pins 1 and 2 of U3 such that the current through the phototransistor on pins 15 and 16 of U3 drops a voltage across R8 that exactly matches the analog signal on pin 3 of N2. By using 1% precison (or better) resistors, the current through R2 matches R1. This means that the light emmitted from the light emitting diode on pins 3 and 4 matches the light from its counterpart on pins 1 and 2. This means that the optical energy that lands on the phototransistors from pins 13 and 14 matches pins 15 and 16. Since resistor R8 matches resistor R5 the voltage drop across R5 and R8 is the same. Thus, the voltage on pin 9 of U1 matches the voltage on pin 3 on N2 without requiring a common ground.

3.2 Printed Circuit Board

The printed circuit board files are listed below:

irdistance2_back.png
The solder side layer.
irdistance2_front.png
The component side layer.
irdistance2_artwork.png
The artwork layer.
irdistance2.gbl
The RS-274X "Gerber" back (solder side) layer.
irdistance2.gtl
The RS-274X "Gerber" top (component side) layer.
irdistance2.gal
The RS-274X "Gerber" artwork layer.
irdistance2.gml
The RS-274X "Gerber" mask layer.
irdistance2.drl
The "Excellon" NC drill file.
irdistance2.tol
The "Excellon" tool rack file.

4. Software

The following files are available:

irdistance2.ucl
The µCL source code for the IRDistance2 module.
irdistance2.asm
The IRDistance2 module assembly code file.
irdistance2.lst
The IRDistance2 module listing file.
irdistance2.hex
The µCL IRDistance2 Intel® Hex file.

5. Issues

Any fabrication issues will be listed here:


Copyright © 2006-2007 by Wayne C. Gramlich. All rights reserved.