Shop OBEX P1 Docs P2 Docs Learn Events
Newbie Sensor and Capacitor Question — Parallax Forums

Newbie Sensor and Capacitor Question

gordianknotgordianknot Posts: 12
edited 2005-04-05 14:24 in BASIC Stamp
After extensive research on why my Sharp GP2D02 sensor is not working - it seems that I need to put a capacitor on the supply rail to prevent the sensor from resetting the Stamp -

Now here comes my stupid question - Do I actually put both of the capacitors leads in the Vdd rail or do I place one cap lead in the VDD rail and the other lead connected to the red Vdd wire that comes from the sensor?

Thanks!

Stan
·

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-04 20:34
    You need to put the capacitor across the supply rails -- from Vdd to Vss -- as close to the GP2D02 as possible. Thus it is in 'parallel' with the power to the GP2D02.

    And make sure the GP2D02 shares a ground (Vss) with the BS2. Otherwise I don't think the signal wire will be read properly by the BS2.
  • dandreaedandreae Posts: 1,375
    edited 2005-04-04 20:40
    Make sure not to plug in the capacitor backwards if using the electralytic capacitors, it will damage your stamp.

    Dave



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-04 20:41
    What you are talking about is using a bypass capacitor, they are needed because wire is an imperfect conductor and have a capacitance, inductance and resistance. When a part places a large drain on supply lines this can cause the voltage to drop affecting other components, such as your stamp. A bypass capacitor should be placed between the Vdd and ground, nearest the load as possible (right where your red and black sensor wires are connecting to vdd and gnd (though ideally it should be on the sensor itself)).

    Most times its a wise idea to place a bypass capacitor near every chip, my last board had 4 main chips on it and I used 12 bypass capacitors for them coupling every Vdd/Gnd supply pin on each chip together with a 10uF tanty cap (4 pair/4 pair/2 pair/2 pair), an additional one across the oscillator Vdd/Gnd and a 100uF tanty cap placed across Vdd/Gnd coming into the board.

    And be sure you get your polarity correct on your caps, the proper value for bypassing means you'll need to use a polarized cap (specialty high capacity non polarized are not needed)

    Post Edited (Paul Baker) : 4/4/2005 8:41:05 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-04 20:55
    One thing I've seen (which probably you can ignore) is on the main power input a large electrolytic capacitor (47 uF or more) in parallel with a small value ceramic capacitor (0.1 uF).· And both of them connected one side to +5, the other side to Ground.

    In terms of adding capacitance, this makes no sense. However, in terms of filtering switching noise, it makes lots of sense. The large capacitor filters out low-frequency current changes. The small capacitor filters out fast current spikes -- and gives the large capacitor time to react.

    Now the BS2 and its circuits are usually not throwing around 20 Mhz transients, so a single large (100 uF) capacitor close to the plug should be sufficient for your 'brown-out' BS2 resets. Note for 'motor' driving brown-outs, a second power supply is sometimes needed. I would hope this doesn't apply to your sensor.
  • gordianknotgordianknot Posts: 12
    edited 2005-04-04 20:56
    Thanks alot for the helpwink.gif

    Would you mind posting a quick schematic showing how I should orient the bypass cap between Vdd and Vss.· As a newbie, I am in mortal fear of an exploding cap or a fried stamp.

    Thanks
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-04-04 20:56
    You should place that capacitor across the power rails (Vdd and Vss) as close to the GP2D02 sensor AND Stamp as possible.
    Yes, the above implies two capacitors. You might consider a "Diode and Capacitor filter" combination if this is truly a problem
    to further reduce one device affecting another device through power transients. I find it odd that a sensor is resetting the stamp,
    it doesn't seem as thought it is pulling much current.
    www.acroname.com/robotics/parts/R19-IR02.html

    Did you remember a diode on the green wire?
    www.acroname.com/robotics/info/examples/GP2D02-4/GP2D02-4.html

    Perhaps a schematic of your configuration might help.

    I would consider a separate voltage regulator rather than relying on the one built into the stamp if you are referencing
    the above schematic. This method has a way of filtering power transients as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-04 20:58
    Isn't there only one way to 'orient' the capacitor? The + side goes to Vdd, the - side goes to Vss.

    And if you hook it up backwards, the bang is not too great -- kind of like a small firecracker, they have vents for this sort of thing. I don't think it can really fry your stamp, unless you actually hook the power to your stamp up backwards.
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-04-04 21:06
    allanlane5,

    You said "kind of like a small firecracker" .... (Hmmmm me thinks) ...until one pops of and bounces
    off of your face (speaking from experience) this guy was no bigger around than my pinky finger and
    sounded like a gun shot. (16V 100uF). ...but your right, your probably not going to fry a stamp this way.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • dandreaedandreae Posts: 1,375
    edited 2005-04-04 21:29
    If the capacitor has a charge it will damage the stamp according to tests that we have performed here at Parallax.· Basically make sure your capacitor is discharged and properly plugged in according to polarity.· I have also blown a capacitor on the Board of Education that has sounded· like a gun shot and it hit our floresent lighting here, it made me very cautious.

    Dave







    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-04 21:32
    Funny story -- I was trying to install a filter capacitor in my Honda Civic once upon a time. I couldn't find any place to mount it, so I decided to solder it in place on the bottom of the radio with a butane-driven soldering iron. I managed to put it in backwards.

    There I was, upside down with my head under the dashboard. There was a short hiss and a loud BANG! about 6 inches from my ears. I had no idea what had just happened -- had the butane exploded? With my ears ringing, I noticed that the lead I had just carefully soldered to a nice ground no longer had a capacitor attached. And there was a lot of white fog in the area (which came from the electrolyte, I later discovered. Don't breathe this stuff if you don't have to...)

    But that was a 100 uF capacitor driven by a 12-volt car battery, I assume 5 volts with a 1-amp limitation farther away from your head wouldn't be as dramatic. A 100 uF capacitor won't get you 100 uF in that situation, but it may not explode so dramatically either. Eye protection is recommended in this situation, also.

    Oh, I also managed to drill through a brake line on this car while trying to mount the right-hand-side speaker for the new stereo cassette-radio -- but that's another story.

    Oh, and regarding installation of a capacitor -- you make sure it has no charge on it by touching its two terminals together -- this 'shorts out' any charge it might have on it.· I have no idea how a capacitor standing alone could GET a charge on it -- but it's good to be cautious.

    And one last thing -- an electrolytic capacitor's NEGATIVE lead is clearly marked with a bunch of dashes.· A Tantalum capacitors POSITIVE end is marked with a plus-sign.· NEGATIVE goes to Vss.· An electrolytic capacitor looks like a little can -- can't miss it.· A Tantalum capacitor looks like a drop of sealant.

    Post Edited (allanlane5) : 4/4/2005 9:35:10 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-04-04 21:41
    We are going to scare Stan (gordianknot) away!!

    Bottom line is pay attention to your wiring and use common sense.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • dandreaedandreae Posts: 1,375
    edited 2005-04-04 21:45
    After working here in tech support for 5 years,·you would be amazed at what people do.· We have customers who pull out components off of other circuits and install them in their current project all the time.·

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • gordianknotgordianknot Posts: 12
    edited 2005-04-05 14:24
    I'm afraid very afraid - I will be sure to wear my welders helmet and flak jacket as I prototype!

    Thanks for the help fellas - I will let you know when I get this sensor working.

    Stan
Sign In or Register to comment.