mosfet to turn on 4 sharp ir sensors from mcu

Thread Starter

thevoodoochild

Joined Jan 14, 2011
21
Hi all, 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.
 

Thread Starter

thevoodoochild

Joined Jan 14, 2011
21
I never realised. new member sorry!! I greatful for the input, I'm not sure about using diodes cos my mcu kicks out 5v but low current & not sure of the power rating & voltage break down to use. Less than 5v or more?? One exiting thing though is I could in theory run all ir sensors off one adc pin if I switch sensors on one at a time.
 

Thread Starter

thevoodoochild

Joined Jan 14, 2011
21
Hi to all who read this, I'm building a sensor system using 8 sharp 2D120x. It's for a robot using a pic18f4550. I am using a mosfet "IRF1010E" to turn on 4 sensors at a time through the 4550 mcu via 1 output pin. The data sheet says they need 50ma each @4.5v - 5.5v. I'm asuming there for I need 200ma to run 4 sensors & also I'm not sure if I should wire the sensors parellel or in series. Can anybody shed any light on the matter??

Thank you
 

Jaguarjoe

Joined Apr 7, 2010
767
If they are wired in parallel, you will need 5v at 200ma. If you wire them in series you will need 20v at 50ma. 5v is probably easier to find than 20v on your robot.

Make sure your mosfet has a low Rdson so you don't steal much voltage from the sensors. You only have about a half a volt to work with. Also make sure the mosfet can be fully turned on with 5v from the mcu. Generally, a "logic level" mosfet is used. Many of them have an "L" in their part number to signify that.
 

Jaguarjoe

Joined Apr 7, 2010
767
I don't know if a saturated BJT drops more or less voltage than a mosfet. You'll have to check the data sheets to make comparisons.

A typical BJT would have a beta or Hfe of 10 when saturated. If you have a collector current of 200ma, the base current will need to be 200/10 or 20ma. Can the mcu output handle that?
 

Thread Starter

thevoodoochild

Joined Jan 14, 2011
21
The 4550 mcu outputs @ +-20ma acording to the data sheet. The BTN3904A3 transistor could work, I can try it on proteous. Also i'm taking my reading in ma across the collector & emmiter. I'm still learning some basics. Thanks again on all your advice ppl
 

Jaguarjoe

Joined Apr 7, 2010
767
There are two problems with the BTN part.
In saturation, it has an Hfe of 10. This means you need 20ma into the base to switch 200ma at the collector. With the uP output of 20ma max, it is likely the uP will suffer or even die. Also, you are switching 200ma, this is the max limit of the BTN. It will suffer or die. You need more headroom.

An IRL530 logic level mosfet will not require much current from the uP to operate. With an Rdson of 0.1 ohm, it will switch 200ma with a very small voltage drop. This will give you a "low side switch" the mosfet is connected to ground and the IR parts are connected to Vcc. The ground for the IR parts will not be in common with the uP ground. I don't think you can live with this. Another way to go is with a "high side switch" like this:

http://tinyurl.com/5u5w5a9


Now the IR parts will have a common ground with the uP. They're $1.50 at Digikey
 
Last edited:

Thread Starter

thevoodoochild

Joined Jan 14, 2011
21
Thanks again for your very good advice, the high side switch wont come up, it says badly formatted. Giving the ir's common ground would be good. I'm doing this to save power so to power 4 ir @ one time as its a bi-directional robot that has 4 sensors each end but can detect 360. I also hoped as in putting 4 ir,s into seperate adc channels but putting the other 4 into the same adc's & powering them seperate(4 @ a time). my mate who knows alot on pics says the ir that are off will pull the on ir's low. So I'm gonna use seperate adc's for each ir.
 

thatoneguy

Joined Feb 19, 2009
6,359
Have you thought about using 3 sensors, each mounted to an R/C type servo?

Direction would be known, as the uC would be providing the pulses to position the sensor. Using this method, all 3 could be running all the time like little radar units.

I know this is a good deal different than your original question, though moving the sensors is often simpler (less power used, less inputs used, lower cost, etc), than attempting to multiplex more sensors.
 

Thread Starter

thevoodoochild

Joined Jan 14, 2011
21
I will have to use 8 adc's but I might use another mcu for the ir's & use spi. Could also use a small debug screen cos its handy & to use up pins on second mcu as my robot is very small 750mm square.
 

Thread Starter

thevoodoochild

Joined Jan 14, 2011
21
Hi again, on the high side switch ic you advised me what does the "Open drain output for fault indiacation of channel" pins do or for? I have them now as I sent off to digi-key.
& Thanks again for all your advice, you truly have helped me.
 

Jaguarjoe

Joined Apr 7, 2010
767
A mosfet has 3 terminals, gate source and drain. The gate controls the current flow through the drain to the source. In order for this to happen there must be a load from a voltage supply to the drain. An open drain gives you the flexibility to connect different kinds of loads between that voltage and the drain, maybe an LED, maybe a relay, maybe just a resistor etc. You can not exceed the current rating of that pin. Do not connect it direct to V+ without a load. It's like an open collector in BJT circuits.
 

Jaguarjoe

Joined Apr 7, 2010
767
Fault indication depends upon what you want to do. It could be used to signal other circuits that would lock out the process until the cause of the fault was remedied. It could simply light a flashing red LED to indicate a fault. With an open drain, a bunch of drains could be "wire or'd" together so 1 LED can flash if anyone of the high side switches fault. Or, you can just forget about it and leave the pin open.
 
Top