Go Down

Topic: Variable voltage (0-12V) using PWM from Arduino (Read 18223 times) previous topic - next topic

Grumpy_Mike

No a resistor on pin 5 will not solve the problem.

simsoft

I found some other connection of opto-isolator. Will it be better?

Grumpy_Mike


polymorph

No, not completely better. Somewhat better. It is charging through 20k and discharging through 10k.

Why do you have an optoisolator? Why not just PWM through an RC network?

I cannot find the thread here now. Drive it with the Arduino output and smooth it in an RC network. Feed that to an Op Amp with a gain sufficient to change 5V into 12V. The Op Amp needs to be rail to rail, or you need to use a 15V supply voltage. An LM358 will only go to 1.5V below its supply voltage.

Or use an external DAC.

Or use a digital pot as part of the feedback/voltage set network on a linear regulator.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

polymorph

This SPI interface DAC chip is available in surface mount or PDIP for $6 each, minimum 2 from Linear Technologies. It can run on up to 15V and so can output 0-12V directly.

http://www.linear.com/product/LTC1257
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

simsoft

Quote
Why do you have an optocoupler? Why not just PWM through an RC network?
Using optoisolator wanted to separate the microcontroller from the higher voltage.

Quote
The Op Amp rail needs to be a rail, or you need to use a 15V supply voltage. An LM358 will only go to 1.5V supply voltage below its.
What could replace the LM358 chip to improve my system?

Quote
Or use a digital pot as part of the feedback / voltage network set on a linear regulator.
I tried to use the AD7376 and AD5290, but both can withstand up to 15V and low currents. I plugged it into the inverter instead of potentiometer, worked for a while, and then he burned.

Quote
This DAC chip SPI interface is available in surface mount or PDIP for $ 6 each, minimum of 2 from Linear Technologies. It can run on up to 15V and so can output 0-12V Directly.
I'm afraid that this chip LT1257 does not allow me to power the 4 fans that need about 1.6A at 12V.

Will such a system as the scheme allows you to adjust the output voltage?

polymorph

You are feeding the feedback input with a low impedance signal from the Op Amp.  So it is going to overwhelm the actual error signal and so the regulator will not operate properly.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

Wawa

#22
Apr 14, 2015, 02:09 am Last Edit: Apr 14, 2015, 05:16 am by Wawa
G_. Do you want to re-invent the wheel.

Fans are perfectly happy with PWM.

One logic mosfet and two gate resistors (220ohm/100k) is all you need.
And maybe a 1N4004 kickback diode.

If your fans have RPM outputs, feed that back into your Arduino.

Two PWM frequencies are used to make speed control less noisy.
~30herz and ~25khz. One being just below, and the other one just above our hearing.
Use 30herz for normal fans. 25Khz is used for 4-pin CPU fans with inbuild speed control.

You can use TWO mosfets if your fans are too noisy at low speed.
One that switches the fan negatives directly to ground, and one that switches the fans to ground via a suitable drain resistor (~22ohm/10watt).
Drive the mosfets from separate Arduino outputs, and choose which fet to use in your sketch.

You could also use two fets per fan and have an RPM feedback loop for each fan.
Leo..


 


simsoft

And you have a diagram of such a solution with two mosfets? How is this accomplished? What MOSFETs use, to withstand up to 2A load?

Wawa

#24
Apr 14, 2015, 05:16 am Last Edit: Apr 14, 2015, 06:47 am by Wawa
First image is a common logic fet schematic with a 30Amp N-FET. Like this one.
Second image is two of those fets with a 22ohm/10watt cement resistor in the drain of the second one.
The value is estimated for four fans.
Use the fet/resistor for "first gear", and the main fet for "second gear".

If you want to use RPM feedback, you might have to use P-FETs and high-side switching.
I can draw a diagram if you're interested.
Leo..

simsoft

Yes. Please. I would like to test different variants.

Wawa


simsoft

No. 2-pins only.
Does this solution is not required at the output LC filter with Arduino PWM?

Wawa

#28
Apr 14, 2015, 08:46 am Last Edit: Apr 14, 2015, 09:22 am by Wawa
For 2-pin fans, use one of the schematics in the previous post.
The 2-fet version is quieter at low RPM, if you get the code right.

Attached is a basic high-side version for 3-pin fans.
AFAIK, with this schematic you can use the yellow tach wire to read RPM with an input pin with pullup enabled.
Maybe someone can verify that, otherwise I will try tomorrow.
Leo..

edit: The two 10k resistors in this schematic can be lowered to 1k for faster switching.

simsoft


After connecting the load in the form of fans probably will drop the voltage. I would like to measure the output voltage to be able to raise them programmatically. That is how I set in microcontroller 10V, I would like to be 10V at the output whether a load is connected or not. Such feedback. Can I implement a voltage divider at the output?

How to protect against short circuit arrangement on mosfets?

Go Up