0
\$\begingroup\$

Im trying to use a Freescale FRDM-KL25Z,

enter image description here

I have been looking at the datasheet to see if I can find the maximum oputput current of the pins with no luck, im assuming its 500mA since its powered via USB

I already have my code up and running, basically im using a potentiometer connected to my ADC to change the frequency from my PWM, it comes out at the port i assign however how can I drive a DC motor without blowing the FRDM-KL25Z or anything else, the first thing it came to mind was look in the internet i found several diagrams showing a zener diode to protect the motor, but i lack the knowlege of why is that zener there, and then i found the use of NPN transistors, however that would mean im using the PWM to open and close the transistor several times while i use an external power supply instead of the power provided by the board, so I ask here, is it possible to make the motor spin WITHOUT an external power supply?

This is the most complete circuit that I have found, but still im wondering if there is a better way to do it, also D3 is a normal rectifier diode instead of a Zener in this case

enter image description here

Heres another pick where they use a resistor to limit the current going to the transistor (i asume its in order to drop the output current as low as possible) while using an external power supply to feed the motor

enter image description here

\$\endgroup\$
  • 3
    \$\begingroup\$ Extremely unlikely that any output pins can drive 500ma. More likely less than 20ma! \$\endgroup\$ – DoxyLover Jan 8 '15 at 8:37
  • \$\begingroup\$ Assuming that scanner is powered only from USB and it can spin stepper motor - yes its possible! \$\endgroup\$ – user62774 Jan 8 '15 at 9:31
2
\$\begingroup\$

The maximum current that the pins can handle is going to be the same as the microcontroller that is driving it. If you are unable to find the number in this sheet, then you would want to check the number for the microcontroller. According to the datasheet, it is a MKL46Z4 MCU, and I was unable to find a maximum current. But you are correct that it would have to be under 500mA if it is powered through USB.

I don't know the specs on the motor that you are using, but I am going to make the assumption that it needs more than 500mA. If so, then you cannot control this motor without an external power supply.

PWM will not change the amount of current that is going to be drawn from the power supply, it just changes the amount of time it spends drawing that current. For example, with a 5V power supply and a motor with 1ohm resistance, the amount of current that is drawn will be 5A. Let's say you wanted to use PWM to 'output' 3V instead. That means you will want a duty cycle of 60%(3V / 5V * 100). This means that 60% of the time the motor will be drawing 5A with 5V applied to it. The other 40% there will be no current flow and no voltage. This will average out to 3V.

Motors will typically draw more current that a microcontroller can support. That is when a motor driver comes in handy. In essence, it is a transistor in which an external power supply powers the motor and the microcontroller controls it with the transistor. This allows you to supply more current to the motor while controlling it with the microcontroller. The only difference between the first and second diagrams is that the first one contains a 555 timer that does the PWM while the second one is hooked up to a microcontroller that does the PWM. They both consist of a transistor, external power supply, and schottky diode.

The purpose of the schottky diode is to prevent damage to your electronics. When you first supply power to a motor, it produces a back-EMF to resist the change. This back-EMF will cause current to flow, and to prevent the current from flowing through your delicate electronics, such as a microcontroller, the schottky diode is placed there so that it will just flow through the diode and to ground.

\$\endgroup\$
  • \$\begingroup\$ not a zener, schottky \$\endgroup\$ – Pete Kirkham Jan 8 '15 at 17:26
1
\$\begingroup\$

if you are refering to the "Zener diode" in the 2nd image you linked

enter image description here

That is a schottky diode symbol not a Zener.

A diode is required across the electrical machines stator terminals to provide a freewheel path for the current you establish in the stator's windings (inductors). The current commutates between your switch and this diode.

Could you use a Zener? sure, a Zener appears as a diode when forward biased, but why use a Zener when a standard diode could be used? A schottky is being used more than likely due to the lower voltage & speed

Do you mean vary frequency or vary duty? That 555 circuit appears to vary frequency.

\$\endgroup\$
0
\$\begingroup\$

When driving motors, it is best to just always assume that your I/O pins can't drive anything besides transistors.

While it's possible that your motor could operate well under 500mA, which you then wouldn't need an external power supply, you would have to draw power from the 5v rail (P5V_KL46Z or P5V_USB), and then use power transistors to switch that source. You'll have to measure how much current the board uses, to see how much of the 500mA you have remaining to potentially drive the motor.

If your motor requires more than what is available, you'll have to connect an exterior power supply to provide the additional juice.

Lastly, there is no sense in involving a 555 timer circuit. The microcontroller has built in PWM hardware specifically for the purpose. All you need is a a power transistor, and the associated transistor driving and protection circuitry, of which there are a gazillion examples on this site alone.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.