Switching a Sharp IR Rangefinder

Status
Not open for further replies.

Thread Starter

garch

Joined Aug 23, 2008
24
Hi,

I have several sharp 2D120X ir rangefinder modules. I want to multiplex an array of three of these so that I can rangefind using a Parallax Propeller microcontroller and an MCP3208 ADC. Each rangefinder uses the same ir frequency, so only one can be on at any given time when sampling. Each 2D120X has a Gnd, Vo and Vcc pin ie no ENABLE pin.

Since these devices are "always on", I thought I might be able to use several NPN transistors to power each ir rangefinder on in turn, in a round-robin fashion and read the Vo of each using the MCP3208 ADC.

Can I just connect the Vcc pin of the 2D120X to Vcc rail (3.3v), the GND pin to the NPN collector, the NPN emitter to GND rail and the NPN Base to a Propeller output pin? Perhaps a BC879?

Thanks
 

Duane P Wetick

Joined Apr 23, 2009
432
I think the Vcesat of the Darlington is too high to make this circuit work. You might try a MosFet (BUZ11) or similar where then Rdson is 50milli-ohms or less.

Cheers DPW
 

SgtWookie

Joined Jul 17, 2007
22,220
Is it the GP2D120 sensor?
http://www.datasheetcatalog.com/datasheets_pdf/G/P/2/D/GP2D120.shtml

It looks like the supply voltage range is 4.5v to 5.5v. 3.3v would not work.

I suggest that it would not be good to disconnect the ground terminal of the sensor; this would cause the sensor to float to the Vcc/Vdd potential (4.5-5.5v), and may damage the output due to it being pulled below the sensor's ground pin by the ESD diodes on the propeller's I/O pins

After applying voltage to the sensor, you would need to wait at least 43.3mS for the output voltage to stabilize.

You would need a pair of transistors w/base resistors to supply Vcc to the sensors.

See the attached schematic.

R1 limits the base current; this protects both Q1 and your uC's I/O pin.
Q1 sinks current via R2 from Q2's base to turn it on.

R2 limits Q2's base current to around 4.3mA; this should be enough to saturate Q2 for the typical 33mA load presented by the IR sensor.

R3 turns Q2 off quickly when Q1 ceases sinking current.

Rsensor represents the load of your sensor; 50mA is the maximum load specified in the datasheet.
 

Attachments

thatoneguy

Joined Feb 19, 2009
6,359
The range of those sensors is only 30-40cm (~15 inches). If they were pointed in different directions, there shouldn't be enough "bounce" to significantly influence the other sensors. They measure several pulses before deciding on the range to reduce interference problems.
 

Thread Starter

garch

Joined Aug 23, 2008
24
Hi,

I'm planning on using both the short range sensor and the long range sensor together, pointing in the same direction. Hence the need.

Thanks
 

Thread Starter

garch

Joined Aug 23, 2008
24
Sgt Wookie many thanks

I've operated the sensor at 3.3v and it seems to be fine. But I have wired it up to a 5v rail as suggested.

I will try the circuit you enclosed.

Very much appreciated.

Garch
 
Hi I think your circuit is very good. It looks like it pulses on & off?? I need to switch sharp 2d120x sensors on & off but want to use software as in portb0 = 1 & portb0= 0 to switch them on individually as I running 4 at the moment & want to double up to 8 sensors for 360 sensing on my robot (baised on a spider). I'm also not sure if it would save much power cos these sensors use little current & i'm thinking of using seperate battery's for mcu & motors. I'm using lipo 3.7v with switching regulator 5v out. Would it be worth switching them?? Also at mo i'm running the whole thing on 1 battery with no problems but i do suffer some volt & current drops when motors change direction so thats my reason thinking about seperate power supplies.
I hope some one can shed light on this subject

thanks to all who take the time to read this.
 
Status
Not open for further replies.
Top