Please help me understand how to control motor!

Hello!

I've got another thread started but I'm getting no where fast.

I'm new to electronics but have basic understandings...

I can successfully create a PWM motor controller using an NE555 chip and a 12V supply.

I want to control this via Arduino using a PWM pin but no matter what I've tried I can't get it working.

I've tried using N MOSFET (IRFZ34N) which required 10V for the gate - so tried to get this working using an NPN transistor with no luck.

I've now got a BUZ71 N MOSFET which I understand should work with the 5V from the Arduino (to trigger power to 12V motor)?

I started by trying to create the circuit using the 12V supply, BUZ71 and a MBR1645 diode. I figured the motor would do nothing, but it spins full speed. My understanding is that it'd remain off until there is voltage to the gate?

Thanks for the suggestion - I tried recreating the circuit with the IC and it was doing bizarre things, so changed the fet and it started working (although motor ran slow - could this be a problem with the NE555?).

I recreated the circuit to try with the Arduino and got nothing from the motor.

The below should hopefully help undeerstand how I've tried to set the circuit up on the breadboard (motor connected parallel to the diode).

Uploaded with ImageShack.us

  1. No - there is no connection from the negative side of the power supply to the Arduino.

  2. There is no connection from -12v to Arduino GND.

  3. I'm unable to test this right at the moment but will do so later.

I'll also see what happens once the 12v power supply has a connection to GND - assuming that's what I need to do :slight_smile:

Well, it works once the -12v is connected to GND.

Thank you.

Am I right thinking that all power sources should be connected to GND? This doesn't ruin the Arduino?

The max motor speed is quite a bit slower than when connected directly to the 12v supply. I've changed the 1k resistor to 47 which has increased the max speed. Should I drop it lower still?

Also, the transistor I'm using is getting really hot - should I change it?

Thanks for all the help by the way...

Well, it works once the -12v is connected to GND.

That isn't -12V, it is 0V.
At least, I hope it is.

As I say - I'm new to this - by -12v I'm referring to the negative side of a DC power supply.

Also, the transistor I'm using is getting really hot - should I change it?

It could be the 1000 ohm resistor is slowing down the mosfet switching time due the resulting R/C time constant, causing the mosfet to be in transition between on and off too long thus creating more heat dissipation in the mosfet. You could try lowering the resistor to say 100-200 ohms.

A better solution would be to just eliminate the NPN stage and use a logic level mosfet with it's gate wired directly to the Arduino output pin.

Here is an example of a nice logic level n-channel mosfet:

Lefty

Unfortunately I'm not able to find a local supplier for these but I do have a couple STP36NF06L on the way (over a week till they get here).

From what I've read, logic level MOSFETS are just ones which can switch with 5V?

The BUZ71 has a gate threshold of 2.1v - 4v. Is this what you mean?

http://jaycar.co.nz/products_uploaded/BUZ71.pdf

The BUZ71 has a gate threshold of 2.1v - 4v. Is this what you mean?

It means that device is guaranteed to JUST start to conduct with somewhere between 2.1 to 4vdc applied to the gate, perhaps with just a few milliamps of drain current! Or the start of THRESHOLD current flow. If your specific device has a 2.1 volt threshold then it MIGHT work with an arduino +5vdc output pin, if 4vdc then probably not.

For mosfets one has to look at the graphs in the datasheet to see the Ron (or drain current flow) Vs gate voltage to tell what the device will do with +5vdc on their gate. Normal mosfets require a full +10vdc on their gate to reach full saturated rated current flow, or lowest Ron specification if you like.

Logic level mosfets are called that because they are designed to work with TTL voltage levels on there gate terminal in common source terminal applications to full rated specifications.

Lefty

I got a bit caught up with the fact it's controlling the motor sorry.

When I connect the gate directly to the ground it's a lot faster.

I'm guessing it's an issue with the resistor or transistor?

I do have a 5v Arduino - how would I connect this directly to the fet?

Arduino PWM to gate, 12v to drain and ground the source?

I do have a 5v Arduino - how would I connect this directly to the fet?

Arduino PWM to gate, 12v to drain and ground the source?

Almost, +12v to device to be switched, other end of device to drain. Then also ground from +12vdc voltage source to arduino ground pin. A safety addition is to wire a 1 -10k ohm resistor from gate to source, this will keep mosfet off if +12vdc power is still on but Arduino is powered off.

Lefty

This is what I've come up with - is it right?

Uploaded with ImageShack.us

The resistor is in the wrong place - have put it source to gate on the breadboard.

All that happens is the motor runs - no matter what I do with the Arduino :frowning:

The resistor is in the wrong place

Yes, wrong place. Resistor goes from gate to ground or better yet gate then right to source terminal which is already grounded. Don't forget -12vdc (ground) to arduino ground. Also your +12dc is drawn wrong, it goes to motor then drain lead.

Lefty

I've been struggling to get this going ALL DAY... so frustrating. I'm starting to understand what is going on though.

I rebuilt the exact same circuit at least a dozen times and the same thing happened each time - the motor kicks in straight away as soon as the 12v supply kicks in.

Out of utter frustration I I decided to reduce the circuit to just the FET, Motor and resistor... still didn't work.

In the end I tried my one spare FET and instantly, it was working.

Thanks for all your help, it has been a learning experience.

For anyone stuck or wanting to know how I've wired this up, see below diagram.

Anyone able to let me know of any potential issues with this setup/improvements?

Uploaded with ImageShack.us

Your V1 symbol is drawn backwards. The + side of the battery goes to the top of the motor/diode junction. Don't label the negitive side of the battery as having a -12v value, just lable it ground or - .

Lefty

Thanks - it was late.... changed the diagram and looking at it now, it makes a lot more sense.

Uploaded with ImageShack.us

Almost perfect. Now show that there is a connection from the 12volt ground to the Arduino ground and call it done. :wink:

Lefty

Pfft! That's a given!