Shop OBEX P1 Docs P2 Docs Learn Events
IRF510 Mosfet on the B.O.E. — Parallax Forums

IRF510 Mosfet on the B.O.E.

willthiswork89willthiswork89 Posts: 359
edited 2006-08-02 02:54 in BASIC Stamp
I want to set up one mosfet to drive a motor both ways ie

Red = +
Black = -

Black = +
Red = -

is this possible with the Mosfet or do i need two mosfets? looking at an RC car there is only on mosfet and its driving it to do both ways... are there any tutorials such as using PWM on it and running with the mosfet? thanks
«13

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-28 14:08
    Actually you will need 4 MOSFETs to create an H-Bridge in order to do this.· As for tutorials you can search Google.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-28 17:50
    im saying that on this RC car there is only one mosfet... i dunno how they did it.... im trying to look at it but i dunno.... this mosfet is going to a thing that says 5w-0 1(horseshoe looking thing)J
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-28 17:52
    http://www.tianbo-relay.com/tianbo/bigimg/6.pdf there are two of these relays on here... im not sure what they are for either it looks like they are running the big motor but i have a hard time following these boards they go everywhere.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-28 17:59
    Relays can be used for direction as well.· If this thing has speed control then my guess is that the Relays are handling direction and the MOSFET is handling on/off power and possibly using PWM to vary speed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-28 18:11
    http://www.datasheetarchive.com/AdFreeDatasheet.php?article=3127426


    there is the mosfet, there is a Giant motor for the front and back which in in the rear and another motor which is left and right in the front... i was to take the relays out and use this stuff on my board so that i can mak this car roam on its own with no help from me do you mind if i PM you for furter investigation?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-07-29 00:06
    Here's how you can change the direction of a motor using relays (or a relay with two sets of contact closures), this way one flips the motor wires·to the source voltage ·--

    attachment.php?attachmentid=41820
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 00:48
    wow thanks for drawing that up PJ, do i need both of those or just one? i know that the relay i have has 5 connectors? i been trying to figure them out! im guessing one negative, one positive, one motor wire, one motor wire... i dunno about the other

    . . .
    . .

    thats what it looks like i guess that data sheet really doesnt help.... anyways ill try to figure it out if you dont reply again! thanks pk
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-07-29 02:02
    on your relay, two wires are te coil, and the other three function as a SPDT switch. You can use two relays (one hooked up backward on the switch for foward/backward) and the negative rail of these relays can be connected to the mosfet for PWM control of the motor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 02:33
    alright there are two on the board does this mean something else is running the steering motor? the thing has a motor for turning and a big moto for steering.... i know that the two contacts go directly positive and degative but im going to have to look up how to trigger the switch? on the mother board i took these from it shows the switch and i tried following the schematic on the back but i really couldnt....
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 03:12
    alright well looking at this website

    10A switching capability.
    ~ SPST-NO configuration.
    ~ Small footprint.
    ~ Sealed version available

    thats waht it says.... its a single pol single throw? how can that be possible....

    im getting the feeling there is somthing else running the other motor? there are two of these relays and 2 motors... you guys are saying i need 2 relays for one motor to function the way this thing is operating...

    also how can i switch these from the MC? the coils goto the pins? that way i do HIGH LOW, LOW HIGH and it switches the pins?

    *edit*

    theres no logical way it could be a Single Throw Single Pole... even looking at the mother board it shows a single pole and two lines· which it pivots from, this datasheet must be incorrect..

    Post Edited (willthiswork89) : 7/29/2006 3:39:50 AM GMT
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 04:43
    okay this is really wierd... i can hear it kick the switch when i have it connected to VSS and VDD but when i connect one to VSS and the VDD to pin 15 and try doing high 15 it wont kick the relay......
  • FranklinFranklin Posts: 4,747
    edited 2006-07-29 04:51
    LOOK at the drawing PJ provided. See the MOSFET? It's there for a reason. There isn't enough power on a stamp pin to power the relay coil.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 05:26
    ahh okay so is the mosfet going to power the relays AND the motor? i dont see a mosfet i see a motor franklin, thanks though to my knowledge the VDD supplied the same current as a pin? must be my mistake....

    Post Edited (willthiswork89) : 7/29/2006 5:45:20 AM GMT
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 06:23
    alright this is getting quite aggrivating.... basically ive tried this... i know that the relay will switch when put on vdd (+5v) and i was told to use the mosfet... i used the mosfet and put the drain on one side of the relay took a wire from that and plugged it into the second relay both on the NO, then i took the other side and took it to P15 and P14, now since vdd is the same as HIGH(i assume) i just do

    DO
    PWM 13,255,255
    PAUSE 500
    HIGH 15
    PAUSE 1000
    LOW 15
    LOOP

    but it doesnt do anything? any suggestions would be used greatly...!

    correction** they are making a humming noise it kinda scared me so i took out the battery...

    Post Edited (willthiswork89) : 7/29/2006 6:29:29 AM GMT
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 07:57
    well there goes one relay fried i need to find another somewhere now.... anyideas what would have one like that?

    Post Edited (willthiswork89) : 7/29/2006 8:08:21 AM GMT
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 08:35
    alright i figure out what i am going to do, im going to goto radioshack and get a SPST two of these then im going to get another relay a DPDT, now when i need to steer left or right then i pwm the SPST to set them what current needs to be to go left or right, then i trow the DPDT to the steering side, one ive established that we have turned throw the SPST's the oposit way until the car is going straight then switch the DPDT to the big mototr to run forwards and loop. considering how big this code may get do you guess it will fit a BS2?

    here is the DPDT

    http://www.radioshack.com/product/index.jsp?productId=2062483&cp=2032058.2032230.2032277&allCount=26&fbn=Type%2FDPDT&f=PAD%2FProduct+Type%2FDPDT&fbc=1&parentPage=family

    http://www.radioshack.com/product/index.jsp?productId=2062480&cp=2032058.2032230.2032277&allCount=26&fbn=Type%2FSPDT&f=PAD%2FProduct+Type%2FSPDT&fbc=1&parentPage=family

    will these work before i buy them?


    would one of you possibly be able to answer this... this motor is huge and i connect a 9 volt battery to it and it didnt move but i connected the 7.2 volt rechargable it came with to it and it ran.....im a little confused on that part? thats eliminating the idea ^ up there because i was planning on running it off that 9 volt but it doesnt run!

    Post Edited (willthiswork89) : 7/29/2006 8:55:08 AM GMT
  • FranklinFranklin Posts: 4,747
    edited 2006-07-29 17:40
    I'm thinking you need to put this project on hold and get a better understanding of basic electronics. If you plan to go ahead with this just get one part working at a time. Relays (and motors) will need their rated POWER (not just voltage) Work on getting the relay to activate before you work on anything else. 5v from a stamp pin is nothing like the 7.6v from the battery and if you don't understand that you need to do some study. [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 19:21
    to my understanding VDD is 5volts am i correct? i measuered it with my voltmeter.... unless VDD is putting out more MA then i dont understand that the problem is. im trying to get the relay to work not anything else, also 7.6v? where is that comming from... im not plugging the relay into the vin... im plugging it into the VDD and having the mossfet run the negative and the switch actuates.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-29 21:50
    I'm not clear on how you have things connected, but if you're driving something from Vdd and it works, and from the pin it doesn't it sounds like the device draws more current than an I/O pin can provide.· How exactly do you have things connected?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 21:55
    i have the mosfet connected like normal then the drain goes to one side of the SPST switch and then the other side goes to the VDD and it actuates.... it also will actuate if i plug it into VSS and touch to the VDD, one other thing i nitices...

    when i touch the wire in the pin it shuts the board down...

    VDD->Relay<-VSS

    that works^

    p15->Relay<-VSS

    this does not when i use

    DO
    HIGH 15
    LOOP
    it doesnt shut the board down if i leave the wire in there only when i pull it out fast?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-29 22:06
    I don't understand your MOSFET connection at all...You wouldn't normally connect it to a switch.· As for the Relay, that explains what I was saying.· You should never drive a relay from an I/O pin for two reasons.· One is it will draw too much current and the pin won't be able to source/sink it.· Second, a Relay is an inductive device.· Having it run off the I/O pin even if it could provide enough current would damage the pin eventually due to back EMF generated by the relay when it de-energizes.· See the attachment for one safe way to drive a relay from an I/O pin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    420 x 402 - 20K
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 22:15
    does it have to be 12 volts +? i dont understand that schematic at all, what does it do different then what i was doing to begin with? would i use LOW (pin) from there to actuate it?

    i looked it up on google and i seen this thing that i had taken off with looks like a salt block it says 1 ohm on it?

    5W0.1OhmJ

    thats what it says and it looks like a salt block... you can see them in the attachment below

    Post Edited (willthiswork89) : 7/29/2006 10:21:10 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-29 22:31
    The 12V could be whatever voltage powers the Relay, it is merely an example.· The resistor you refer to is a power resistor rated at 5W 1 Ohm.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 22:33
    so why is it that the VDD will actuate the relay? and is that thing needed to help make this work?
  • FranklinFranklin Posts: 4,747
    edited 2006-07-29 22:34
    The "salt block" is a resistor. 5watt, 0.1 Ohm. You need to have a voltage that will activate the relay, the relay in the schematic requires 12v. You need the diode. Again do some study unless you like buying parts because you are on your way to burning something out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 22:43
    well im trying to do some studying

    http://www.blogcadre.com/blog/jason_striegel/howto_make_a_robot_car_-_part_1_overview_2005_10_25_13_22_21

    i found that which is exactly what i need to do besides speed... i might decide to ramp it eventually but thats exactly what i want to do... i wont go with relays if they are that much trouble but my question is will i be able to use an HBRIDGE to control both motors seperatly? what are your ideas on controlling a steering motor and the driving motor, i dont have to use the stamp to physically control the motors... just control the currect from the battery it comes with.? any ideas would be great..
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-29 22:44
    It seems you may need to do some research on electronics to understand some of the concepts presented.· An I/O pin can only source/sink so much current, but Vdd can source as much as your power supply (or the regulator) can supply.· You cannot use the I/O pin directly for the reasons stated above.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 23:20
    well ive read all the books that i could with the supplies i own. i misunderstood i was thinking that the vdd was the same as the pin, if i cant use the relays what can i use to run two of them... i know that the actual motors both need to be run by the battery its self. but im going ot have to use the microcontroller to change the source voltage to the motors. what can i do to do that... its going to have to be like a relay i imagine but i dont know...
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-29 23:38
    well from the looks of it i need two hbridges but i have a wierd feeling that there is an easier less room way considering i only have a BOE and very little room for 8 mosfets !
  • T ChapT Chap Posts: 4,223
    edited 2006-07-30 00:30
    I have no idea what current the motors you are trying to run use, but here is 1 IC that will run 2 motors or steppers at 750ms each. Maybe some of the guys here familiar with your motors can say whether it will handle it. There are a few more details to sort out but if you are looking for small, then there is a trade off foe everything you do.


    L6219


    http://www.st.com/stonline/products/literature/ds/1377.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    something smells like it's on fire
Sign In or Register to comment.