Shop OBEX P1 Docs P2 Docs Learn Events
Simple question — Parallax Forums

Simple question

RtnlSltnRtnlSltn Posts: 10
edited 2006-10-07 02:20 in Robotics
Hi, I'm new here. I stumbled across this site after searching for a solution to my problem. My name is Justin and I make custom computers. I won't bore you with everything, but here is what I have to do.

It has to run off of a computer power supply. The speed does not really matter, but preferably it opens as fast as a servo spins.

Basically it needs to open a door 90* when i turn the switch to "on", as well as turn a fan on. When i hit the switch to "off" it needs to turn -90* to its original position, and turn the fan off. In either situation it needs to turn off after its motion, basically it needs a timer. A timer would have the servo on for X amount of seconds, then when its closed or open, it turns off. I really do not care which way this has to be done, however the smaller the better. I'm open to anything. I have purchased a large assortment of switches from RadioShack including feeler, toggle, and pot. I was thinking of having the servo hit the feeler switch as it hit my desired angle to turn it off, but then i wouldnt be able to have the servo reverse unless i had a reverse polarity switch of some sort?

There has to be a better way!

I've tried lots of things and I'm decent with electronics, but this stuff goes above me. Any help would be awesome! I'd be glad to help anyone with computer problems in return.


Thanks,

Justin

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 00:45
    Opening a door 90 degrees, then closing it some time later is exactly what servos do well. They can be repositioned to a particular position time and time again without cumulative error (once you calibrate the controlling pulse width with the desired position, it will go back to the same position with only a little slop). Any Stamp can do that. You don't need a limit switch. Similarly, sensing whether a switch is on or off is simple. How you would control a fan depends on the fan and its power requirements. A Stamp can drive a low current relay (up to 20ma) or a switching bipolar or field effect transistor (FET) to turn a fan on and off. It doesn't sound like you actually need a timer. You might look into the Prop-1 that was developed and sold by Parallax and is now sold by a 3rd party. It includes a Stamp1, regulator, and high current driver that should be able to handle any normal cooling fan that runs off a computer supply. The Stamp1 is more than adequate for this simple task.

    Have a look at the downloadable book What's a Microcontroller? <http://www.parallax.com/detail.asp?product_id=28123&gt; for information on using Stamps for this kind of task.

    Look at this link for information on the Prop-1 <http://www.parallax.com/html_pages/products/boards/efx.asp&gt;
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-05 00:54
    The fan is a bit above a normal fan, its 104CFM, and about 150mm (it's from an arcade game). Basically I can handle the fan part by just using a Y split wire. I'd love to get a direct guide on what I need to do, but I don't think that can happen. This material is way over my head. I get very confused easily with electronic schematics.


    Thank you for your reply, I will check those sites out right now!
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-05 01:27
    Are there any options that don't involve purchasing a kit? I looked locally for it and its $80! Is there an option that doesnt involve programming a chip? or a way i could program it myself without the kit?
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 01:37
    It will be important to know the amount of current the fan draws and what voltage it's made to operate on. The Prop-1 uses one of two parts as a power driver, the ULN2003 or the ULN2803. One has 8 driver transistors (Darlington transistors they're called) and the other has only 7. These can handle in excess of 30V and each transistor can handle about 500ma (1/2 Amp) and can be connected together to control multiples of that. These also have what's called a "free wheeling diode" for each transistor which protects against reverse voltage spikes from inductive loads which include motors and relays. I think the "What's a Microcontroller?" mentions this.
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-05 01:41
    The fan is 3000RPM at .57 Amps at 6.8 Watts, 12 Volts

    thanks for your help and quick responses, i appreciate very very much!
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 01:42
    The Prop-1 controller sells for $35 from EFX. You will need a BS1 serial adapter from Parallax for $5. All the software and manuals you can download for free from Parallax's website.

    You will need to parallel two of the outputs of the Prop-1 to handle the current for the fan ... no big deal.

    You will need a servo motor for the door, mounting hardware, and maybe some piano wire to go from the servo motor to the door itself.

    You've already got the switches. You'll need a resistor to "pullup" or "pulldown" the voltage at the Stamp pin when the switch is open. Anything from 1K to 10K will do very nicely.

    The Prop-1 will run from the 12V supply of the PC that you'll use for the fan. It can run from the 5V supply, but you'd have to bypass the Prop-1's regulator ... not a problem, but you don't need to do that.

    You may need a power cable for the Prop-1 and the fan. You can get those from Radio Shack. It's a standard cable and plug used for low voltage power.

    Post Edited (Mike Green) : 10/5/2006 1:50:12 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 01:50
    Oh yeah. You'll need a serial cable or a USB to serial adapter for programming the Prop-1 depending on your PC.
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-05 02:10
    Ok thanks a lot, i don't have a problem getting a few parts, even the kit could prove usefull in the future. I was wondering though, if the microcontroller chip was what actually stored the memory. Because that would mean for every computer i make i would have to buy a new chip.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 02:48
    All of the Stamps combine a microcontroller chip and an EEPROM along with a voltage regulator and some parts that make programming easier. The microcontroller is pre-programmed with an interpreter for Parallax Basic (PBasic). The EEPROM is what actually holds your program and can be used to store some data as well. Normally, the microcontroller is never re-programmed and it's actually hard to do since some of the needed microcontroller signals are not brought out to Stamp pins. When you reprogram a Stamp, the PC program is communicating with the Stamp interpreter which writes a compiled version of your program to the EEPROM.

    The Prop-1 includes the microcontroller for the BS1 and its EEPROM, a voltage regulator, the high current driver, a few other parts required for the microcontroller and to allow the EEPROM to be programmed, and some connectors, a power LED and switch.

    As far as you're concerned, for every computer you make, you will need a Prop-1 controller for the door and fan. You could buy the parts separately and assemble them on your own printed circuit board and leave out stuff like the power switch and LED and some of the connectors. You probably wouldn't save much. There are cheaper microcontrollers, but they're harder to use.

    You're also only using part of the capability of the BS1. There are 8 I/O pins and you're using 4 at the moment. The BS1 doesn't hold a large program, but to do what you need will still only take part of the available capacity. You could add a digital thermometer and only turn on the fan when the temperature is above some threshold for example.

    For example, the DS1620 is a very accurate digital thermometer that can be attached to the Prop-1, takes 3 pins and requires a resistor and a capacitor to use and costs about $7.

    Post Edited (Mike Green) : 10/5/2006 2:56:07 AM GMT
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-05 03:32
    Is there one that allows the eprom to be removable? that way i could program an eprom, take it out, and put it in a computer and repeat. I plan on adding a thermometer that works via the motherboard. The higher the temperature gets where the probe is, the faster the fan spins.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 04:06
    With the scheme I've outlined, there's no control of fan speed. It's just on and off.

    The Prop-1 (and other Stamp boards) has a programming connector. You can leave it connected to your PC while you're working on the program. The Stamp Editor will reset the Stamp/Prop-1 and download a new program to it on command. You can also view the output of debug statements in your program while it's running. When you've got it where you want, just disconnect the Stamp from the programming cable. If you want to change something, just reconnect it. You don't have to remove anything.
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-05 17:13
    The fan is controlled independently by the motherboard via a plug split from the fan itself. So as long as the fan is on, the motherboard has full control over the fan speed. It would be cool though to have the fan varying speeds, and the door open more as the speeds increase. However that seems like a fair amount of coding.


    I also wanted to say thank you for all the help, it has been very beneficial.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 18:25
    If you have the digital thermometer attached to the Prop-1, you can still open the door a variable amount depending on the temperature even though you have no control over the fan speed. It's not a lot of coding. To control the fan speed from the Stamp requires some kind of external motor controller which would add extra expense.

    I originally recommended the Prop-1 because it represented a complete prepackaged unit that could do what you asked out of the box at a reasonable cost. Do keep in mind that Parallax has 3 lines of microcontrollers, the Stamp (with really 2 major branches - BS1 & BS2), the SX series, and the Propeller. The Stamp has been around the longest and is the easiest to use. The SX series is a "classic" high speed microcontroller, not for beginners, but very cheap and very high power for typical microcontroller functions. The Propeller is the newest, rapidly dropping in cost and the most powerful overall. It's easy to program, but doesn't yet have the "lead you by the hand" type of documentation.

    The SX series currently has a cheap protoboard ($10 each), but would require some soldering of connectors and, for control of a fan, would still need either the ULN2003 or a discrete transistor and a resistor or two to be mounted and wired to appropriate connectors for the switches and fan. A servo motor could be controlled directly, but would still need a connector to be used.

    In learning how to use the Prop-1/Stamp1, the experience is directly transferrable to other Stamps and the SX series. The Stamps are not likely to come down in cost significantly because of the way they're constructed. The SX series and the Propeller are single chips and benefit markedly from economies of scale.
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-05 19:24
    I think I'm going to invest in the "What is a microcontroller" kit that is available at RadioShack in a few weeks. Seems very usefull for a lot of things.(http://www.radioshack.com/product/index.jsp?productId=2117994&cp=&origkw=microcontroller&kw=microcontroller&parentPage=search). It would answer many of my future questions, which would be great.

    What kind of resistance to i need for a servo from 12v? I know there is a 5v lead on all power supplies, but in order to have the fan on the same switch it would be easier to use the 12v. I checked large amount of sites that calculate risistance, but i do not know the mA of a servo, and it won't calculate without it. The batteries i have for the R/C controllers are 4.8volts and range from 500-700mA.

    Thanks again,

    Justin
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 20:13
    Servos are very unhappy with supply voltages much above 6V. They will tolerate 7.2V, but this increases arcing in the "brushes" and shortens their live a little. Servos draw a variable amount of current depending on whether they're moving and what the mechanical resistance is to movement, so it's not possible to reliably use a resistor to drop the voltage on a 12V supply.

    Actually, the Prop-1 is wired to provide a regulated +5V to servos (I looked at the documentation). Just use the standard plug that comes with the servo and plug it into the Prop-1. This wouldn't work for more than one servo (too much current drain), but should be just fine with one. There is also a built in pullup/pulldown resistor for two of the I/O pins for use with a switch. It's jumper selectable ... look at the Prop-1 documentation for details.

    If the Radio Shack item is their "What's a Microcontroller BASIC Stamp Activity Kit" (Catalog #276-625), it includes a Stamp BS2 which is more powerful than the BS1 on the Prop-1, but the BS2 Activity Board's 5V regulator can't support the load of a servo and there are no connectors for servos. It's great for learning about microcontrollers and how to program them and you could use an external R/C battery pack or 6V AA battery pack to supply the servo.
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-06 22:35
    theoretically couldnt i just use the 5v lead off of the battery then to supply the servo power until i get the kit?
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-06 22:56
    When you say "5v lead off of the battery" do you intend to use a 4.8V R/C battery pack to power the servo? If so, that should work just fine. Be sure to hook the battery up with positive to the red wire from the servo and negative to the black wire from the servo and connect the negative lead to the Stamp's ground as well. With a 500-700maH (milliamp-hour) battery, it should last 1/2 hour or so under full load (stalled), maybe 4-6 hours when the servo's not moving.
  • RtnlSltnRtnlSltn Posts: 10
    edited 2006-10-07 02:20
    no, i would connect the servo right to it. Is the only way to vary the servo's power input through a board like that? I would like to connect the servo right to the 5v lead off of a switch.
Sign In or Register to comment.