[Help] 25 kHz PWM Circuit controlled by Arduino

Soo, This is my first project that isn't just connecting a module to an Arduino... And I feel like I need some help understanding things and better ways of doing things.

The main objective is to create a PC fan controller for my watercooled PC, Needs to work for 60 seconds before the PC turns on and 3 minutes after it shuts down.

Well this circuit was my starting point: (Grabbed from here)

556 Timer IC
Capacitors: C1 = 680pF; C2 = 0.01 μF; C3 = 0.1 μF; C4 = 10 μF, polarized.
Resistors: R1 = 1k; R2 = 10K
Potentiometers: P1 = 100k
Diodes: D1 & D2 = 1N4148

But rather than using a normal potentiometer I would use a digi pot (Like this one) so that I can control the duty cycle via Arduino.

Does anyone see anything wrong with this? Would the output actually be 25kHz? Is there a better way of doing all this?

Thanks for any and all help!

Well that circuit isn't going to work as the discharge terminal isn't connected, and when it is
it could burn itself and the pot out as there is no protection when the pot is at the end point
as nothing exists to limit the current but a schottky diode.

Also only a single 555 is needed to do this.

If you are going to add an Arduino, it can already do PWM very capably, no need for external
hardware, just program one of the timers.

[ Actually, I looked again and I misunderstood the circuit - it is using both timers in a complicated
way which uses output in place of discharge. Perhaps this allows a greater range of duty cycle,
anyway, just use an Arduino timer, much simpler.

You're right about the circuit being more complex to get the wider range of duty cycle.

The trouble with just using the Arduino is that I'd have to mess with some registers to get it close to the 25kHz and there are only a few timers to use, I'd need more than an Arduino has.

Another idea i had was to use an attiny85 or whatever it is to control the pwm and it can talk to the main Arduino.

The trouble with just using the Arduino is that I'd have to mess with some registers to get it close to the 25kHz and there are only a few timers to use, I'd need more than an Arduino has.

Changing registers to get the 25kHz you want is straightforward and should not be a barrier to what you want to do.

How many outputs do you need? The Mega has 6 timers and many more pwm outputs at custom frequencies like 25kHz than the AT328 products.

SnipeYa:
...to get it close to the 25kHz...

Why that.
A PC fan can also be controlled with Arduino's default ~500Hz or ~1000Hz PWM.
Problem is that some fans are not silent at that PWM frequency.
~25kHz (intel CPU-fan standard) is just choosen because it's outside our hearing.
22kHz or 27kHz would work just the same.

Are these 4-pin (build in driver) or 3-pin fans (external mosfet needed) that you want to control.
Leo..

cattledog:
Changing registers to get the 25kHz you want is straightforward and should not be a barrier to what you want to do.

How many outputs do you need? The Mega has 6 timers and many more pwm outputs at custom frequencies like 25kHz than the AT328 products.

I believe I need 10 timers, Plus any that the program itself needs. Changing the register isn't a barrier, It just means that that timer cant be used for program stuff aswell.

Wawa:
Why that.
A PC fan can also be controlled with Arduino's default ~500Hz or ~1000Hz PWM.
Problem is that some fans are not silent at that PWM frequency.
~25kHz (intel CPU-fan standard) is just choosen because it's outside our hearing.
22kHz or 27kHz would work just the same.

Are these 4-pin (build in driver) or 3-pin fans (external mosfet needed) that you want to control.
Leo..

4pin fans and pumps. I was aiming for 25kHz because it is the standard, But like you said 22-27kHz would also be acceptable. I've already had one fan running purely from my Arduino Uno but changing the register removed some program functionality that I also needed for the tachometer calculations.

I believe I need 10 timers

Timers or pwm outputs?

The Mega has 4 16 bit timers(Timers 1,3,4,5) with 3 outputs each. The design of the 16 bit timers allows you to use ICRn as a top value to set the custom frequency without giving up any hardware outputs.

Another possibility to increase the number of effective pwm outputs from a timer is to not use the timer hardware output pins, but to use the timer compare and overflow interrupt ISR's to write direct port commands to turn any pin HIGH or LOW. Driving fans does not care about the interrupt latency.

cattledog:
Timers or pwm outputs?

The Mega has 4 16 bit timers(Timers 1,3,4,5) with 3 outputs each. The design of the 16 bit timers allows you to use ICRn as a top value to set the custom frequency without giving up any hardware outputs.

Another possibility to increase the number of effective pwm outputs from a timer is to not use the timer hardware output pins, but to use the timer compare and overflow interrupt ISR's to write direct port commands to turn any pin HIGH or LOW. Driving fans does not care about the interrupt latency.

10 PWM, But also leaving some timers unchanged to be used with the program. But the idea is to be able to expand as needed. Thats why I was looking at using an external circuit that I could control via spi or I2C then I could have as many outputs as the communication protocol supports.

The more I think about it the more an attiny85 seems like the way to go, I could have it do the PWM and the tachometer calculations for an output as a slave to the main micro controller?

Why is it that you guys are so opposed to using the 556 to generate the PWM externally from the Arduino?