i2c slave pwm fan controller

Hey there all, my first post here.

I have a small project to do. I'd like to use a AtMega32u4 based board I have (the beetle) to control a 4 wire pc fan via pwm @25kHz. On top of that, I'd like to be able to control the set speeds via i2c.

The long and short of it is, I have a x86 developer board. It has a fan header that is controlled not by the bios but a separate system. That system does not read cpu temps, it instead has a sensor near the cpu. This causes serious delays in the cooling at throttling at times due to it.

One neat feature this board does have though is i2c headers. So part of this project would be to write a python script to read the cpu temps. Then via the i2c tell the arduino what speed to run the fan or fans if I add a 2nd.

Browsing around, I saw posts from people who had stated getting 25kHz pwm is doable on AtMega32u4 by adjusting the timer?

Is controlling the arduino easy enough through i2c to pull off my project? Im sure there are many ways to tackle my issue, but this seemed fun and it's stuff I have here.

Also as a bonus, is it possible to read the tach line of the fans in through the arduino?

All insight is very appreciated.

I don't know about the beetle and never controlled a fan myself, but you can search the web for 4 wire fan Arduino and wonder how many hits you'll get. Then come back with more detailed questions.

And I2C on the Arduino is pretty easy. How easy it is on the x86 and Python I have no idea.

A think to keep in mind, I would also add some sort of watchdog. If for some reason the Python script fails your fan's might be stuck at a low speed otherwise. So I would design it to expect it to receive something via I2C every x time. If that for some reason does not happen => fan full on.