Shop OBEX P1 Docs P2 Docs Learn Events
BS2 : What would happen if i overload a programmable pin? — Parallax Forums

BS2 : What would happen if i overload a programmable pin?

IceFireProIceFirePro Posts: 86
edited 2010-06-13 03:45 in BASIC Stamp
i.e. if i attach a LED that draws more than 20 mA ?

Would the board go broken, or would it just stuck, stop working, overheat? How do i know?

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2010-06-11 14:14
    First of all, an LED needs a current limiting resistor, or the LED will burn out.

    Second, the I/O pins have a couple of transistors on the chip behind the pin -- one to bring the pin "high", one to connect the pin to ground and bring it "Low". These transistors have a maximum rating they will supply before acting like a fuse and burning out. If you manage to burn one out (by attaching too low a resistance to it) it won't be able to pull that pin 'high' or 'low' (depending on which transistor you burnt out.)

    You can still use the pin as an input, though.
  • IceFireProIceFirePro Posts: 86
    edited 2010-06-11 18:56
    I understand. But attaching too low a resistance means for example, connecting it directly to Vss i guess? What if I attach too much resistance, for example a UV diode that draws 50 mA?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-06-11 19:04
    If, If, If, If, If.

    If a frog had wings would his tail ever touch the ground?

    If.
  • skylightskylight Posts: 1,915
    edited 2010-06-11 19:04
    You are getting confused here, increasing the load current would mean you would have decreased the resistance.
    Do you understand Ohm's Law?
  • ercoerco Posts: 20,256
    edited 2010-06-11 19:17
    You can release the magic smoke if you draw much over 20 mA. They can handle a bit more for short instants, but you shouldn't plan on it. A constant 50 mA load is way too much. If you are pulsing your output quickly (50% duty cycle) you could probably get away with 30 mA for a while, but again that's pushing it.

    Note that many Stamps are rated to source 20 mA, yet they can sink 25 mA. That is, connect your load from a Stamp pin to Vdd instead of Vss. Then you turn your load on with a LOW command and turn it off with a HIGH command.

    Bottom line, it would be a shame to wreck your $50 Stamp by drawing too much current. When in doubt, use the Stamp pin to switch a transistor (like a 2N2222) through a bias resistor, around 330 ohms. You can switch several hundred mA that way, even more with a power transistor or MOSFET.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • hover1hover1 Posts: 1,929
    edited 2010-06-11 20:13
    Would you apply 12 volts to a 5 volt light bulb? No. So don't expect a part that is documented to handle 20ma, to handle any thing more than that.

    I aggree with Franklin, your questions are getting annoying.

    You have some reading to do young man.
  • $WMc%$WMc% Posts: 1,884
    edited 2010-06-12 01:41
    I think he's a lot smarter than he leads one to believe, And he's trying to take the number of Post's " high score " from Mr. Mike Green.

    LOL!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA


    You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.

    ·
  • bill190bill190 Posts: 769
    edited 2010-06-12 13:46
    This is like an electric starter in a car. A car electric starter uses a lot of electricity and needs BIG wires.

    You can only run small wires to the key starter switch. There is not enough room to run big wires.

    And they use a gizmo called a starter relay or solenoid which uses a small amount of electricity to switch the larger amount of electricity (current/amps) which the starter motor needs to run.

    Same thing with a microcontroller. This has small wires in it and can only provide a little electricity. So you need to use an external gizmo like a relay, transistor, opamp, darlington chip, etc. to power things which use a lot of electricity.

    You would use an amp meter (or ammeter), or the amperage setting on a multimeter to measure amperage.

    Be aware that in addition to a "per pin limit", there is also a "per chip total limit". So you can't have too many things on with multiple pins all at the same time or you will overload the entire chip!

    And be sure to check how much current things like relays use. Also be aware that a relay is a coil and when the power is turned off, this can create a large voltage which will zap a chip or transistor. So a "flyback diode" is installed "backwards" to protect the chip/transistor. More on that here...

    http://www.physics.unlv.edu/~bill/PHYS483/relay.pdf
  • IceFireProIceFirePro Posts: 86
    edited 2010-06-13 02:13
    Thanks! I am smart (thanks again), but really not in electronics! I am a piano player, a photographer and a computer engineer/QA Engineer, but those are my very first steps in electronics! I am not after hitting any records with my posts! I do know I am getting annoying, so I'll cut it. You really helped me a LOT, and I am very, very thankful. I do know my questions sounded pretty SILLY, but they were very real and you really gave me a hard jump start. I would vote for not deleting those posts, because believe me, anyone who is generally intelligent, but is just starting over with electronics might have those or very similar stupid questions. Thank you, I really appreciate your posts!
  • IceFireProIceFirePro Posts: 86
    edited 2010-06-13 02:17
    So, really, straight on the topic:

    -What is the total-per-chip amperage for BS2 (It's not in the manual)!
    -What components do I need in order to start off with, say, turning on the 50mA diode? Can I connect the diode directly to Vdd/Vss and turn it on via a transistor and some relay switch (what kind of)? I've been greatly helped with IR receiver, and as soon as I got a reply, I bought it and I'm learning how to include it in a program - so believe me, I'm not just popping out questions like crazy for nothing. Thanks!
  • bill190bill190 Posts: 769
    edited 2010-06-13 03:03
    Actually I don't get the basic stuff myself. I'll understand complex things, but sometimes can't understand how to turn the thing on or something everybody else in the whole world knows! burger.gif

    Anyway no one was born knowing this stuff, so ask. I'll try to explain how you can find this information yourself.

    Anyway many chips and electronic things have a "data sheet". Those are the key words. On these will be the electrical specifications. So search for a particular electronic component along with the term "data sheet" in quotes and that will hopefully find all the info for that part.

    With that said, I looked through my Basic Stamp documentation folder and could not find a data sheet! eyes.gif

    Perhaps I never copied it to my folder?

    Anyway documentation for the Basic Stamp is scattered all over the place. I copied everything·I could find into a folder called Basic Stamp\Documentation.

    Poke around the program files area and folders and look for pdf files. Then look in all other Stamp related folders to find all this stuff.

    For finding documentation which you don't have, you can go to the Parallax store...

    Click on the Parallax logo above and that will take you to the main Parallax page. Then click on Store. Then click on Microcontrollers. Then click on Modules. Then click on Basic Stamp 2 Module (if that is what you have).

    Then on the lower right it says...

    [*]Source/Sink Current per unit: 40 mA / 50 mA per 8 I/O pins.

    Further down is documentation you can download. I clicked on Basic Stamp Documentation and don't see a data sheet listed...

    ...but I do see "BASIC Stamp Technical Comparison" and on this is the same information as above.
  • FranklinFranklin Posts: 4,747
    edited 2010-06-13 03:05
    These are all freely downloadable and should be read if you want to learn how to do the things that the stamps can do. www.parallax.com/Default.aspx?tabid=362

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • bill190bill190 Posts: 769
    edited 2010-06-13 03:45
    As·for where to buy components, some are available at the parallax store. You can also buy kits with come with an assortment of resistors, diodes, transistors, and so forth. The same that would be used in the diagrams in the manual which comes with the kit.

    Then Radio Shack has all sorts of components like resistors, diodes, transistors, relays, LED's, etc.

    Or you can buy these online. Search for the terms...

    electronic components cart

    The word·"cart" refers to the word in "shopping cart", so adding the word cart will hopefully give you a search with more stores where you can buy things. Many electronic things have all sorts of technical discussions on the internet, so searches for electronic things will find all sorts of non-shopping pages.

    Then as said above, there are data sheets (or specifications) for electronic things. Here is a relay at Radio Shack. It says 90 mA, So WAY too much current!...

    http://www.radioshack.com/product/index.jsp?productId=2062480

    Here is a typical relay data sheet...

    http://www.components.omron.com/components/web/pdflib.nsf/0/B9B1B32CFA49FCB185257201007DD585/$file/G6K_0609.pdf

    Or a data sheet for a chip....

    http://www.allegromicro.com/en/Products/Part_Numbers/6276/6276.pdf

    As to setting up your own circuits,·I would advise going through the documentation for the Stamp and·find a circuit in·one of the books which will do what you want, then just wire it the way they have shown.

    That would be the easiest. Otherwise there is a bit of math to all this. Might find a book or two on basic electronics. Look thtough the pages first and see if it is written in English or Einstein. If written in "Einstein", might want to find something easier to start out with! burger.gif
Sign In or Register to comment.