mosfet to turn on 4 sharp ir sensors from mcu

Discussion in 'General Electronics Chat' started by thevoodoochild, Jan 14, 2011.

  1. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    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. [​IMG]
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    This is related to this thread: http://forum.allaboutcircuits.com/showthread.php?t=29881

    What you might do is add a rather large cap or two to your supply to keep it more stable.

    You might also feed your MCU and sensors via a resistor and Schottky diode to keep the power there more stable.
     
    thevoodoochild likes this.
  3. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    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.
     
  4. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    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
     
  5. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    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.
     
  6. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    Thank you for you reply, That makes sense now to wise them parrellel, I could be better off using a transistor maybe.
     
  7. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    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?
     
  8. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    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
     
  9. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    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: Jan 20, 2011
  10. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    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.
     
  11. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
    thevoodoochild likes this.
  12. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    Here is the part #, its a dual 1amp high side switch STMPS2272MTR

    How about an LM339 quad comparator instead of wasting all those ADC's?
     
  13. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    How can I use a quad comparitor? I don't follow?
     
  14. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    These sensors use little current 50ma max. Also I don't need a bridge to drive sensors. But I agree it would be cheaper, but I have 8 ir's
     
  15. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    I'm sorry, I thought they were simple analog sensors, not distance measuring devices. Comparators are of no value here.
     
    thevoodoochild likes this.
  16. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    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.
     
  17. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    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.
     
  18. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    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.
     
    thevoodoochild likes this.
  19. thevoodoochild

    Thread Starter New Member

    Jan 14, 2011
    21
    0
    So............. Where does the fault indiacation of channel bit come into it?
     
  20. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    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.
     
    thevoodoochild likes this.
Loading...