I am having a contest in a week and i am making the final version of my line following robot (my prototype worked out well) ...
BUT...
I am getting back to the joys of debugging obvious problems and then running crazy.
I need to command the robot with two Fet IRF511, but for some reason that i dont know, Dosnt worksss ... it was working in the prototype tough............
There's nothing wrong with the basic schematic (aside from the missing flyback diode), but 5 volts is WAY too low a voltage to be feeding that mosfet. According to the data sheet at 5 volts you're going to get a maximum current of 1amp. To get it's rated ~5amp current you'll need a gate voltage minimum of 7 volts, to get really low RDS on value you'll probably need even more than that. If your motor pulses high currents when it starts (like all motors do) you'll need 10+ volts of gate drive.
You'll need to add a simple transistor voltage level switcher to the gate so the 5V can drive the transistor to provide the 9V rail to the gate since that's the highest voltage you have to work with it'll have to do.
I can post a transistor level shift I made but my schematic drawing is pretty horrible cause I use a simulator and have no sense of organization in it =) Or other users might be able to post simple a simple schematic to bootstrap the voltage for you. If you don't get any responce for a circuit to do that I'll post one later on today.
Sure. But even those will benefit from higher gate drive, and they typically have higher gate capacitance so they can't be switched as fast. If you're dealing with a mosfet you have to deal with these issues as well, it's simply the way the devices work there is no way to work around it you can at BEST mitigate one problem at the expensive of increasing another. That's why proper drive circuits especially on power mosfets are so important. In your application depending on the motor and actual current draws the gate drive voltage alone would cause the circuit to either work extremely well or burst into flames.
You won't get more than 5 volts out of that circuit, it'll act as a voltage follower. You need both a PNP and NPN transistor to do rail to rail voltage adjustment.
Are you using an oriental 2SA684 PNP transistor? Then you connected its collector and emitter backwards.
Connect the PNP transistor with its emitter at +9V and its collector at the gate pin of the Mosfet.
It needs a series base resistor then it will apply about +8.9V to the gate of the Mosfet when its base resistor is 0V and it will apply +8.8V (the Mosfet will still be turned on) when its base resistor is +5V. Its base resistor must be +9V for it to turn off.
The emitter of a PNP transistor must be connected to the most positive voltage. Yours is connected backwards. Look at your schematic where the collector is wrongly connected to +9v and the emitter wrongly connects to the load.