Arduino Not working on Breadboard

Hello Everyone

I recently put the arduino onto the breadboard and i connected it according to the tutorial here.

http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard

The only thing missing in my setup is the voltage regulator and the switch.

Everything else is connected properly and i am supplying power to the Arduinno from the power supply.

The problem i am facing is that i am sending a PWM signal to a mosfet from pin 10 and once i connect the motor to the mosfet... the PWM signal distorts.. Is it my setup? Cos the PWM signal completely collapses when the motor is connected.

Please help =/

In your code, did you remember to set the pinMode() to output?

Yes. The pinmode is set to output.. I see the PWM signal when i attach the scope across the pin.

This PWM signal is going to the Gate of a PNP Mosfet... at the Drain of the mosfet theres a diode and a motor... when i connect the motor there the PWM at the gate of the mosfet collapses... the motor runs but the signal on the scope is gone.

Sounds like you have the mosfet is wired.
For a “PNP”, the mosfet wants to act like the current source - so drain to +v and source to motor+ and motor- to ground. For “NPN”, the mosfet wants to act like a sink.
(really P channel and N channel, PNP & NPN refer to bipolar junction transistors)

Look at Q2 vs Q4 - which do you have hooked up? These both are turned on when current is flowing from +12 to motor + to motor- to ground.

is going to the Gate of a PNP Mosfet.

No such thing. You can have a PNP transistor or a P-channel mosfet. I assume you have a mosfet. You can't run a 12v motor with just a P-channel mosfet, you need an other transistor to make the signal up to 12V before you apply it to the gate. Also make sure your ground is common between the 12V supply and the arduino. Finally make sure you have a reverse biased diode across the motor and plenty of decoupling.

Sorry for the confusion.

I am using a P type Mosfet. I am using the high side drive configuration... this configuration can be seen here http://ww1.microchip.com/downloads/en/devicedoc/41233A.pdf on page 6.

The type of motor being run is rated at 3V. The power supply to the arduino is 3.6V from a lithium ion battery which is also at V+ of the Source... the drain is connected to a motor with a flyback diode which both go to ground.

The wierd things that are happening are this

When i send the PWM signall to the Gate of the mosfet.. on a LOW it should turn on and on a High it should be off. When i plug in the motor in the high side configuration the PWM signal dies.. its all low causing to turn the mosfet on at all times.

Then when i disconnect the drain ... the motor keeps on running. so i dont understand.. ive checked the data sheet of the mosfet a million times ( http://www.datasheetcatalog.org/datasheet/vishay/70130.pdf )

Your help is greatly appreciated.

The power supply to the arduino is 3.6V

This is means you only have a maximum of 3.6V drive signal, this is not enough to drive a mosfet. Look at the data sheet for the fet you are using, don't think threshold voltage is enough to turn it on look at the Ron value and see what the gate voltage is at that point.

Interestingly enough.. i think i found the solution. I added a decoupling capacitor to the VCC and Ground and now it works.. 3.6V and everything.

What was happening was that i noticed that on the scope the Arduino would be resetting..The motor was pulling too much from the arduino causing it to reset.

That might not be the correct explanation but thats all i could figure out.

Thank you all for your responses. :)

That might not be the correct explanation

It isn't.

There is no way a decoupling capacitor can increase the capacity of the supply or stop a load from pulling too much. This is what decoupling does:- http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

That might not be the correct explanation but thats all i could figure out.

What value of capacitor did you add?

This sounds like a situation of solving a symptom and not the cause. When you draw too much current out of a source its voltage will drop. Your situation shows the battery pack isn't providing enough current.

The capacitor is probably helping when the motor initially draws more current than your supply can provide. Since you have a scope, you might put it on your supply line and watch what is happening there.

I would expect (or guess) as the battery dies this will continue to be an issue.

The capacitor i used was 2.2uF. Before the capacitor I was using the lithium ion battery... and it wasnt working....then i used a power supply and it didnt work either... when i attached the cap i was using a power supply in both cases..and it started working....and it was not working for the power supply before either.

Ill be checking with the lithium ion battery today.

What do you guys think is happening??

Cos before the scope would just show a low at the PWM signal as soon as the motor was connected... and then there would be small spikes on the scopes.. which i assume was the microcontroller turning on and then dying.

I understand that the decoupling capacitor can not increase the supply... so how is it "helping" ?