Shop OBEX P1 Docs P2 Docs Learn Events
howto use a basic stamp to run a electromagnetic — Parallax Forums

howto use a basic stamp to run a electromagnetic

nemesiswesnemesiswes Posts: 17
edited 2009-01-23 18:10 in BASIC Stamp
Hi, i'm new to this but i was wondering if it was posible to run a electromagnet off of the stamp by using a transistor connected to battery and the basic stamp to control the on off of the transistor to control the pulse's from the electromagnet .

kinda like the one i just made
(I·made an attachment, it·should work)




not sure if it's wired right and forgot to add the resistors to but that's the overall diagram of how it would work
and i was wondering, can a basic stamp on the homework board turn the electromagnet off and on at atleast 1000 times a second or what is the fastest it can? and if not what can.

last, is there anything i should have done that i didnt. thx for·all comments
640 x 512 - 18K

Comments

  • Dennis FerronDennis Ferron Posts: 480
    edited 2008-01-21 19:48
    Yes it can work, but you'll need a slightly different circuit and you'll need to take some things into account. You'll need a fly-back diode to absorb the spike that occurs when the coil is turned off. Also, it looks like you're using an emitter-follower configuration with the transistor. (I can't really tell because you didn't mark the emitter, base and collector.) That will work but you'll only be able to get a max of 5 volts out of it, because in an emitter-follower configuration, the emitter follows the base voltage, and the BASIC stamp can only raise the base to 5 volts. If instead you connect the emitter to ground and connect one end of the coil to the collector and the other end to +9 volts, then you'll be able to saturate the transistor, which is better for the transistor and generates more power in the coil. Power draw is a consideration; if you run the coil off the same battery you run the stamp off of, you could brown-out the stamp or even damage it. Instead, do use a second battery to power the coil - as your picture implies you're doing. The ground (-) of the second battery should be connected to the ground of the BASIC stamp and the emitter of the transistor. The + side of the second battery should connect only to the coil and the cathode of the flyback diode - nothing else. (The anode of the diode and the bottom lead of the coil go to the collector of the transistor. The coil and the flyback diode are in parallel.)

    Finally, make sure your transistor can handle the current demanded by the coil. You would be good to use a power darlington transistor like the TIP120. Or you could use a power MOSFET, like the IRF510. The IRF510 would be your best way to do it; instead of a base, collector, and emitter, you have a gate, drain, and source. You still connect it the same for this circuit, with these substitutions:

    base --> gate
    collector --> drain
    emitter --> source

    I'm not on my own computer so I don't have access to any schematic-drawing software but I'll try to make a schematic for you when I get home. Incidently, what are you building this for? When I was a kid I made a similar circuit with the Basic Stamp and three MOSFETs and three coils. It was a coil gun that could launch a nail a few feet across a room.
  • phil kennyphil kenny Posts: 233
    edited 2008-01-22 01:04
    Whether you can turn it on and off 1,000 times per second depends
    on the exact circuit parameters.

    The time required for the current to completely build up is roughly
    3*L/R

    where L is the inductance in henries, and R is the total circuit
    resistance in ohms (coil resistance plus any external current limiting
    resistor).

    Assuming equal rise and fall times for the current in the coil,
    3* (L/R) has to be 500 microseconds or less in order to be able to
    turn it on and off 1,000 times per second.

    It will depend on whether you are switching amps or milliamps.

    Do you know any specifics on the inductance and current?

    phil
  • nemesiswesnemesiswes Posts: 17
    edited 2008-01-22 03:13
    to·dennis, ·well it's for a motor i was going to make and· i wasnt sure on how to do it just yet, i still need to read up on all of it. i know most of it just not all yet.


    to phil,· well what if i just lower the power, so like say the coil goes from 5 amps to say 100 mili amps or something like that so that instead of going completly off it just lower's the power, i am sure the formula you gave still works but would i have to change a little or not because when the current increases it would time for the magnetic field to rise to fulland then when the power goes down the field goes down and that would take time . so could i still use that one you gave.· srry but i don't know to much about some of this stuff lol, and the whole engine is supposed to be a dc motor
  • phil kennyphil kenny Posts: 233
    edited 2008-01-22 05:38
    DC motors can be made with low inductance armatures, but they
    have to be specially designed for that mode.

    A DC motor with a sufficiently low armature inductance can be
    switched at the rate you wanted.

    The equation I listed gives the time needed for the current to
    change by approximately 95 percent. In two time constants
    it will change by 86 percent.

    Are you trying to design a motor that can be driven in a PWM
    (pulse width modulated) mode?

    What is the reason for having to switch the motor power 1,000
    times per second?

    phil
  • nemesiswesnemesiswes Posts: 17
    edited 2008-01-22 15:11
    hey well the motor i am making doesnt work like the way you might think most work in the way that even·know they may be dc,·(I am sure you know most of this but i was going to say it anyways)··they still are not completly in how the poles go from south to north wich induces a·voltage that's alternating and this can now cause a back-emf which cause's the torque to decrease with speed and so when·it's stalled the torque is at max.··· so that's the one·big differnce between mine and normal one's.···lol, i think i have already said to much about it ,lol.· but yeah it would be huge if i could get it to work. mainly because i am almost 18 and i don't want to work, lol.
  • phil kennyphil kenny Posts: 233
    edited 2008-01-22 15:26
    Your goal sounds ambitious. Good luck with your design and let us know
    how it turns out.
  • nemesiswesnemesiswes Posts: 17
    edited 2008-01-22 18:26
    alright well thx to both of you and dennis for·how to wire the it, and thx phil for all the info as well. later·
  • student2007student2007 Posts: 12
    edited 2009-01-22 18:49
    Hi,

    Excuse my lack of knowledge in circuitry since I am more of a programmer. But my project is similar in needs to nemesiswes. I am looking towards using my BS2x with 3 separate electromagnets (iron and coils). My goal is simply to have the strength of electromagnet flux or if not, just turning it on and off.

    If someone could provide a schematic of the circuitry of with one electromagnet then that would be absolutely helpful!

    Thank you. [noparse]:D[/noparse]
  • jcburnjcburn Posts: 1
    edited 2009-01-23 18:10
    Surely you guys aren't working on electronic speed controls for brushless motors are you ??
Sign In or Register to comment.