Shop OBEX P1 Docs P2 Docs Learn Events
Super Newbie Questions — Parallax Forums

Super Newbie Questions

c131frdavec131frdave Posts: 38
edited 2007-11-05 00:28 in BASIC Stamp
Hello.

I have never taken an electronics class, never had any type of education in electronics at all.· But I love my new Basic Stamp.· I've been programming computers for over 20 years, and have built desktops from components for 15, but that's pretty much it.

So, here come the newbie questions:

1. I know the control circuit from the basic stamp 2 is 5vdc.· In the education book, when connecting one of the i/o pins to a sensor, it almost always says to use a 220 ohm resister.· I have a relay I want to use to turn on an electric motor.· How can I calculate what resister to use to keep from getting a short circuit (or getting super hot)?

2. I want to make my project more permanent.· How do you make a printed circuit board to your own design?· Is there a drawing program or something out there that can be applied to a "raw" circuitboard?

3. Is there some magic calculator for resistance in a circuit?· If I use an LED in a 5vdc circuit, I need a resistor, but how do I know how big a resistor if I don't have my textbook around, or maybe I have a different light source that is a different voltage or whatever?

4. I looked at the BS2 carrier board, but it doesn't have any voltage regulator or anything.· Do you just go buy a voltage regulator an connect it to Vin (pin24)?· The voltage is 5vdc, right?

I have many more, but that's good to start.· Thank you in advance.

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-11-04 20:22
    In answer to question one I often refer to this attached doc. that I downloaded from a Parallax article.

    Jeff T.
  • c131frdavec131frdave Posts: 38
    edited 2007-11-04 21:12
    Thanks, that helps a lot. [noparse]:D[/noparse]

    But what is Hfe?
  • ZootZoot Posts: 2,227
    edited 2007-11-04 21:46
    said...
    it almost always says to use a 220 ohm resister.

    This is not to change current/voltage TO the sensor, but rather, to protect the Stamp pin in case you make the pin an OUTPUT at the same time that a sensor is trying INPUT electricity to the pin (which would destroy the pin on the Stamp). If humans were perfect and never made wiring errors and never made errors in their programming code, you could get away without this kind of protection on pins that may be connected to INPUTS (i.e. sensors).
    said...
    How do you make a printed circuit board to your own design? Is there a drawing program or something out there that can be applied to a "raw" circuitboard?

    Most PCBs are designed by first drawing the schematic, then using that "saved" schematic to build up the design for printed circuit board. PCBexpress.com is popular because they have free software that lets you create your board, then upload it and have it shipped to you. Eagle is a free program from Cadsoft.de that lets you create standard board designs, but it has steeper learning curve. I'm sure others will chime in with their favorite (and favored) PCB vendors, design programs, etc.
    said...
    Is there some magic calculator for resistance in a circuit? If I use an LED in a 5vdc circuit, I need a resistor, but how do I know how big a resistor if I don't have my textbook around, or maybe I have a different light source that is a different voltage or whatever?

    R = V / I
    resistance = voltage / current

    V = I * R
    voltage = current / resistance

    I = V / R
    current = voltage / resistance

    So if your LED needs 20ma (.020 amps) just divide that into the voltage coming out of, say, a Stamp pin (5v). The bigger trick here with Stamps, is that many LEDs will let you drive them with much more current than a Stamp pin can provide (say the Stamp pin maxes out at around 20ma). That's why in the books you'll often see LEDs hooked up to Stamp pins with 470ohm resistors -- this keeps the current down to under 11ma, which is decently bright for your average LED, and won't strain the Stamp too much.
    said...
    I looked at the BS2 carrier board, but it doesn't have any voltage regulator or anything. Do you just go buy a voltage regulator an connect it to Vin (pin24)? The voltage is 5vdc, right?

    The Stamps have their *own* 5v regulators on them already. Part of their appeal is that they are pretty ready to go. So you can apply 12v or less to a Vin Stamp pin, and the on-board regulator supplies the Stamp processor itself with 5v. Additonally, the regulated 5v is available to you to use for other circuits on the Vdd pin of the Stamp. The catch? The on-board regulator only provides ~50ma -- not much for external circuits, and not much if you want to drive heavier loads from your Stamp pins (remember the on-board regulator provides the 5v juice for the Stamp itself and it's pins).

    If you need more juice, you can use an external 5v regulator for all your other circuits, and still feed ~12v or less to Vin of the Stamp and Vin of an external regulator.

    If you need more current available to the Stamp itself, then leave Vin DISCONNECTED on the Stamp, and instead, apply externally regulated 5v to Vdd of the Stamp. In other words, using 5v->Vdd and leaving Vin disconnected completely bypasses the on-board regulator.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-11-04 21:47
    A transistor is a current amplifier, Hfe is the gain. If the transistor has a gain of 100 then 1 milliamp at the base will allow 100 milliamp at the collector. So the Stamp only uses 1 milliamp to control a 100 milliamp device.

    Jeff T.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-04 22:44
    Parallax has the schematics for most of their boards posted on their website. Look at the store webpage for the product and you'll find a link. Use those as models for what you want to do. If you want to use a BS2 carrier board and you need an external regulator, copy Parallax's regulator circuitry.
  • c131frdavec131frdave Posts: 38
    edited 2007-11-05 00:28
    Thanks for all the replies. What I am trying to do is control an actuator with a 2 axis accellerometer. If the chip experiences G, the actuator pushes it back. I guess that's a lot like the robot except that the actuator is pushing an external surface rather than the piece the board is attached to. It's hard to explain.

    So what I have is a actuator with an internal pot that I'm using to report position. The actuator is a straight dc motor with limit switches on the full in/out postions. If the Gmeter feels .4 G, the actuator is to extend 20%. If it experiences .5 G, 40%; .6G, 60%; .8G 80% and 1 G 100%. The G can fluxate, so I want to use a timing circuit with a capacitor and the actuator's pot for position reporting,·and two relays to fire the dc motor one way or the other·which will extend/retract the armature.

    So, I have a G sensing chip, two relays, and a timing circuit from the pot in the actuator. Do I have enough "juice" to run all that from the chip, or do I need to do that externally?

    Thanks again for all your help.
Sign In or Register to comment.