Sharp GP2D12 to Lego RCX Example
Last Modified: 2007-03-08
find:

basket

Acroname Robotics PDF webpage version Sharp GP2D12 to Lego RCX Example PDF

Related
Products

Product image for LEGO Invention System 2.0
LEGO Invention System 2.0
Product image for Sharp GP2D12 Detector Package
Sharp GP2D12 Detector Package

Contents

Sharp GP2D12 Interface to Lego RCX: Oscilloscope Data

A 5V power supply is connected to GP2D12 through 1 ohm resistance to measure current.  Power is applied to sensor at t=0.  At t1=9ms, it begins to emit 32 pulses of light, each requiring about 220 mA.  Output is valid at t2=44.4ms. 

Oscilloscope Data
Top trace is output of GP2D12. Bottom trace is current absorbed (100mA per graduation).

Oscilloscope - GP2D12 Current

These pulses have a 1/8 duty cycle, interval between them is 1ms.  Average current is 35.5 mA = 220mA/8 (current pulses) + 7/8*9mA (constant current).  Actually average current is lower since pulses don't occur during the first 9ms

Oscilloscope Data
Zoom on GP2D12 current pulses.

Oscilloscope - RCX sensor input with a 10K resistor

At t < 0, sensor is programmed as a passive sensor.  Tension is constant and equal to 2.5V (5V RCX output divided by 2 because of 10K internal output. 

At t>0, sensor is an active sensor, providing 8.5V on its output.  Every 3ms, RCX polls the output of the sensor, switching it to passive mode for 94µs.  Note that during that time GP2D12 will be powered (see below). 

Oscilloscope Data
RCX sensor input, connected to a 10K resistor.
Oscilloscope Data
RCX sensor input, connected to a 10K resistor (zoomed out).

Sensor mode is programmed (theoretically) 50 ms in passive mode, 250 ms in active mode (See main page program).  As you can see, result is not very precise, since passive phase last 63 ms and active one 260 ms... 

Oscilloscope - GP2D12 module output of TC55 Regulator

You can see "grass" on regulator output while GP2D12 pulses its IR led (C2 doesn't filter enough).  Apart from that, regulation is good.  Bottom trace shows voltage rising slowly as C1 charges in active mode, then, in passive mode, output of sensor that becomes valid after 43ms. 

Oscilloscope Data
Top trace is output of TC55. Bottom trace is voltage at terminals.

Oscilloscope - GP2D12 module Voltage Dissipation

Top trace indicates the GP2D12 power supply voltage and the bottom trace indicates the voltage across sensor terminals. 

The interesting point here is the comb observed across GP2D12 supply while charging C1.  In fact, (see above) RCX switches its output to passive mode 94µs each 3ms.  During this time, Q1 conducts and GP2D12 is powered.  However average current is quite low, since GP2D12 has not enough time to begin emitting pulses: I = 9mA * 94/3000 = 0.28mA. 

Oscilloscope Data
Top trace is GP2D12 power supply. Bottom trace is voltage at terminals.

Oscilloscope - TC55 Output and Terminal Voltage (Long Passive Time)

The top trace indicates the output of TC55 regulator and the bottom trace indicates the voltage across the sensor terminals. 

Here I increased passive time to a too long time (128ms), C1 discharges too much so charge time is too short to restore full voltage.  As we start with full charge, we can see progressive degradation.  Some interesting informations can be derived:

Passive time must be as short as possible (but not shorter than GP2D12 conversion time).  Output of regulator follows nicely its input when this one is insufficient.  Output of GP2D12 is valid even with power supply as low as 4V (datasheet specifies it down to 4.5V)

Oscilloscope Data
GP2D12 module connected to RCX sensor input

Oscilloscope - TC55 Output and Terminal Voltage

The top trace indicates the output of TC55 regulator and the bottom trace indicates the voltage across the sensor terminals.  Notice the regulator output drops below 5V only after 90msec. 

Oscilloscope Data
GP2D12 module connected to RCX sensor input

Revision History:

  • 2004-12-22: Example Created
 
 
voice: 720-564-0373, email: sales@acroname.com, address: 4822 Sterling Dr., Boulder CO, 80301-2350, privacy
© Copyright 1994-2010 Acroname, Inc., Boulder, Colorado. All rights reserved.