Current flow control.

Hello!

I've searched for this kind of topic but found no topic that helped me in this matter.

Is it possible to use the arduino as a "ohm" transistor? Such as, I have a power supply (regular one in a computer) 100W 12V, (100/12 = 8.3Ampere flow). Because I need to control 3 stepper motors. And I've seen many people using some kind of "driver". But I thought to myself: "A driver is just a microcontroller, an arduino is a microcontroller, I'll check the forum what the problem is!".

So, is it possible for the arduino to use some kind of pwm function to dim the flow from the power supply?

-Thanks in advance,
Iskall

MOSFET transistor, probably all you need. Look at SFE for logic type , or better for shield with 4 - 6 MOSFET's on a single board.

That is exactly what I need! I've never heard of it, and looking at datasheets confuse the hell out of me.

So if you don't mind, I rather ask a question so I don't have to read for 2 hours looking for that little information.

It looks like this:

GND
Drain
Source

Mosfets GND goes to Arduinos PWM
Mosfets Drain goes to Work GND and then continues from Work vcc to Power Supply vcc
Mosfets Source goes to Arduinos GND and to Power Supply GND

To control the output of the Mosfet I simply use the pwm, when pwm is 100% Mosfet gives 100% of power supply, when pwm is 50% Mosfet gives 50%.

Am I correct? (Above are all assumptions, I sadly don't have time right now to read all 20 pages to find out this basic information)

Have you visited this link # 3 from the documents in a link you posted above:
http://bildr.org/2012/03/rfp30n06le-arduino/ ??
But can I ask you, before you try something, why do you think you need to "dim" a current?
Stepper change rotation speed not based on voltage but frequency. So, better you re-phrase what is your objective, may be you need other solution.

Normally with a regulating driver you need some form of current feedback. This is not the sort of thing you normally do with a micro controller but with a switching regulator.
Any solution with a FET will not allow you to step he motor at full speed because the PWM switching will not be syncronised with the motor control switching. You will get beats between the two signals.

I used the word "dim" as in being in 100% control of the output from the mosfet. But you're right, I don't actually need to "dim", I only need on / off, nothing inbetween. But by giving me the knowledge of how to "dim", I would get a better understanding and for usage in the future I would know how to "dim". So I do apologize for the misleading word.

So something I'm still a little bit uncertain about is the setup, the stepper motor I'm going to use will have 4 wires, I assume that black wire is GND, the other 3 I'm not so sure about the other 3 wires (green, red, blue). "Nema 17"

Interesting, I can't edit.

After further looking I realize that red & blue are one coil, green and black another coil. Meaning current can flow through red to blue or blue to red, same thing for green and black. This means 4x mosfet's per stepper. Or am I thinking wrong and perhaps everything can be done with only one mosfet?

And I've seen many people using some kind of "driver". But I thought to myself: "A driver is just a microcontroller,

Your statement isn't correct, driver in this case is 2/4 channel switching high current circuitry, may include some additional functionality to simplify controlling interface, over-current protection etc.
Google is blotted with links on a search pattern "nema 17 stepper motor arduino". Subject line is misleading, someone with hands-on experience would miss a chance to help

You are right you can't do it with just one FET. The circuit you need is called a H-bridge.

After some thinking, I believe that it is possible to use only one mosfet. Then because there are 2 coils per stepper which can go 2 directions, each stepper got 4 choices(2^2).

1: red -> blue
2: blue -> red

3: black -> green
4: green -> black

And to allow the arduino to control the power. I simply use 4 circuits with 8 LED's total.

I put together LED's in pair, facing eachother. Glue them together or something, get them to stick to eachother. Then I cover them up with some dark plastic so they can't get any of the ambient light.

Then I'll put the high power on one of the LED's so the current flows the "wrong" way. And in that same circuit I'll also have one of the 4 choices as load. <-- I repeat this step 4 times.
No power will go through because the LED's are not excited and the flow is the "wrong" way. But by turning on the LED's right next to them through the arduino I excite the LED's with the high power on them. And when they are excited they allow voltage to flow through in the "wrong" direction aswell.

This is my idea, sounds great in my opinion, it's cheap, easy to make, understandable.

Things that I'm not so sure about: The high power will burn the crap out of the LED wire. (The load will be roughly 3V & 2A = 6W)

The above is only for one stepper, for 2 more I would need 16 more LED's.

And an H bridge, I'll have to look into that.

This is my idea, sounds great in my opinion

Sorry I can't follow what you are saying. It sounds like it will not work however. You can't control a bipolar stepping motor with only one FET.
Can you post a schematic of your idea.

I would if I knew how to make them. Or what software to use.


There, I managed to download fritzing. And it took me a while to solve the "problems" but I believe that the schematic shown above works. I'm sadly not 100% because I'm not 100% sure how the electrons flow.

The color on the LED's are the color of their light.

I would greatly appreciate it if anyone could have a look at the schematic and tell me if it would work or not.

And I'm deeply sorry that it is so messy.

And I'm very certain that LED's allow the energy to flow backwards if they are "excited"
source: led - Excited diode allow flow opposite direction, possible? - Electrical Engineering Stack Exchange

The arduino's job is to excite the 2 LED's next to it, allowing those 2 LED's to flow "normally".

Sorry but that simply is not how electronics works. It is not that a bit is wrong it is the whole concept that is wrong.

So am I doomed to use an H bridge?

Yes unless you can invent something else that works.

A bipolar motor requires current flowing BOTH directions through each set of coils, that requires something called an H-Bridge. Each H-Bridge requires AT LEAST 4 transistors. In general, to have it work properly each H-Bridge requires 8 transisteors. 4 of those would be MOSFETS to handle the power and 4 of them are small signal transistors which are used to make sure the MOSFETS switch cleanly. An H-Bridge also requires diodes across the MOSFETs to control voltage spikes when switching the MOSFETs off.

What you need is an H-Bridge. The L298N is readily available for $3 or $4.

Here is a sample of how you would connect it to your Arduino. Make sure you use an external power supply for the motor!

Good Luck!

L298_Arduino.JPG