Shop OBEX P1 Docs P2 Docs Learn Events
Stamp safety — Parallax Forums

Stamp safety

lightsoutlightsout Posts: 22
edited 2005-04-09 15:50 in BASIC Stamp
All this talk of deep-fried stamps prompted me to ask what I was going to ask a while a go. That is, I have 2 stamps on one project and by the time I was done wiring them I realized I had quit a few resistors. Then I ran it and realized I needed even more, (forgot some pull-ups).·
I went out and counted 29 resistors for about 24 I/O's in use.
· Question·1 :Is it standard procedure to use so many resistors, such as one for every I/O pin for current limiting safety ? Then· add more to pull-up or pull down?
Sooo if I a resistor of the correct value on every I/O would make my stamp almost burn-proof ?
·IF (yes) THEN why_don't_they _build_stamps_that_way:wink.gif
And as long as I am asking questions......smilewinkgrin.gif
· Question 2: Pretend I have a 15ma load device and it needs 12 volts, can I run one load wire to 12v positive than let one BS pin ground it ?
· Question·3 :Do most electronic circuits·of different voltages only regulating the positive side therefor sharing the common ground?·(This relates back to Ques. 2), if it does, this would allow you to ground (sink?) any higher voltage to some·point/voltage?·
· Question 4:Pretend I have a input that grounds (sinks?) , can I then set a I/O pin high for that switch or will that deep-fry the stamp ? If not, then is my only (simple) choice to pull the pin high with a (10k or more) resistor then pull it low with the switch?

Please feel free to add relevant questions to this post.
Thank you to those with answers !!
Meanwhile, I thinking about opening a deep-fried stamp booth at the next local fair !!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-09 15:50
    lightsout said...
    Question·1 :Is it standard procedure to use so many resistors, such as one for every I/O pin for current limiting safety ? Then· add more to pull-up or pull down?
    Sooo if I a resistor of the correct value on every I/O would make my stamp almost burn-proof ?
    ·· Standard procedure?· Well I don't know if there is any standard procedure regarding protection resistors, other than prevention for newbies.· If your Stamp is outputting to a TTL-compatible device, you shouldn't have any issues or require a resistor.· The resistors are for those cases when you might have an input into the Stamp, and you might have accidentally set the pin to an output.· So this is more prevention for those getting started than anything else.

    ·· Now, on transistors you should always have a resistor between the output pin and the base.· Many schematics use 220 ohms.· And this is a completely acceptable size when controlling 5 Volt devices.· However I always use 1K resistors on the base since I am frequently switching higher voltages.· There is always the possibility that something could happen to the transistor, in which case 12V might possibly be seen on my Stamp's output pin.· Therefore I have the 1K, since 220 ohms would be insufficient in that case.
    lightsout said...
    Question 2: Pretend I have a 15ma load device and it needs 12 volts, can I run one load wire to 12v positive than let one BS pin ground it ?
    ·· If you're asking if the Stamp can drive 12 volts directly, absolutely not!· Not even with a resistor.· Use a transistor as in my example above.· A 2N2222 NPN transistor can switch up to 30V @ up to 800mA (Although I wouldn't exceed 500mA).· With a 1K resistor you can switch a nominal 12V load without a relay.

    ·· Recently I have gotten some calls dealing with people using a 5V Relay to switch a 12V relay to switch a 24V relay, etc.··These projects are often "crashing" the Stamp, etc.· In reality you can usually use one piece of Silicon to replace those relays and control the 24V Relay directly.· Checking the specs might reveal that even a lowly 2N2222 transistor could drive it.· Just an example, there are many ways, including using a FET or High-Current driver chip, such as a ULN2xxx chip.
    lightsout said...
    Question·3 :Do most electronic circuits·of different voltages only regulating the positive side therefor sharing the common ground?·(This relates back to Ques. 2), if it does, this would allow you to ground (sink?) any higher voltage to some·point/voltage?
    ·· When you're controlling circuits running at different voltages, you usually require a common ground, unless the circuit is optically isolated from the Stamp.· When you share a common ground, and controlling the device with another piece of silicon, such as a transistor or driver chip or if using a relay, the shared ground has no affect on the Stamp's Sink/Source capability.· Not sure I fully understand what you're asking though.
    lightsout said...
    Question 4:Pretend I have a input that grounds (sinks?) , can I then set a I/O pin high for that switch or will that deep-fry the stamp ? If not, then is my only (simple) choice to pull the pin high with a (10k or more) resistor then pull it low with the switch?
    ·· I would recommend reading the "What's a Microcontroller?" text available as a free download from our website.· Pull-Up/Pull-Down resistors are used to prevent a pin from floating when the line isn't being driven HIGH or LOW, such as in an Open-Collector circuit (Not being driven) or similar.· This really doesn't have anything to do with whether the Stamp can handle Sinking and output or not.· It either can or it can't.· Adding a Pull-Up resistor won't change that.

    ·· You can also search Google for information on "Sink Source output" to get more information on the theory behind this.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.