Do you want to feel the wind blowing when you drive your open wheeler in Assetto Corsa? Now you can!
In short: ACFan sends speed of car in AC to Arduino Uno R3, which controls PWM fan(s). No PWM whine. Hardly any CPU load.
Scythe GlideStream 120 PWM SC (silent)
Delta AFB1212SH fans (more wind, noisier)
Sanyo San Ace 120 9SG1212P1G03 (only one fan, loud!)
I needed to clamp the fan to the desk or it would fly away .
Don't mind the driving, I'm not used to an Xbox controller.
Thermalright TY 143 140 mm fans (no video)
(pen for size)
I would like to present my little project: a wind simulator for Assetto Corsa. Most wind simulators use an Arduino combined with a separate motor controller, which can be expensive if you use larger fans. My project also uses an Arduino, but with standard PWM PC case fans. A PWM fan has a motor controller built into the fan. The Arduino just sends a PWM signal to the fan and this will control the speed of the fan. This way there are less parts needed and the project is kept simple.
Credits
It’s not an original idea of me, I just combined two ideas: using an Arduino to control a PWM fan and using an existing interface between Assetto Corsa and the Arduino. There is no PWM whine coming from the fan because a 25 KHz PWM signal is used.
I would like to thank afremont for his PWM logic, see https://forum.arduino.cc/index.php?topic=155089.45
I would like to thank mongo56 for his ‘ACFan’ executable and source code, see https://www.reddit.com/r/oculus/comments/2b8d3m/assetto_corsa_fan_control/
ACFan
The program ACFan is the interface between Assetto Corsa and an Arduino. ACFan reads the shared memory of AC: the speed of the car and the steering input. When the car is idle, it sends value 30 to the Arduino. As soon as the cars starts rolling, it sends between 61 and 100 to the Arduino, depending on the speed of the car. ACFan also varies the values a bit when you are steering to simulate wind direction changes.
Arduino
I have modified the sketch (program) mongo56 made for the Arduino, it now uses PWM to control the speed of the fan. It has a startup sequence built in which speeds up the fan in a few seconds so you know the Arduino is doing its job. After that it continuously translates the values sent by ACFan to a usable PWM value, between 0 and 79.
Remark: when there is no PWM signal sent to the fan, it will run at top speed.
Fans to use
Most fans cannot stop completely, even with a PWM signal at zero. The Scythe GlideStream 120 PWM SC fans I chose have a speed of 300 to 1500 RPM. This means there will always be some wind blowing when the car stops (= 300 RPM). At best you can use fans with a broad RPM range: a low minimum and high maximum RPM value. This way the fan will produce a higher wind speed difference at high and low car speed.
The Delta and Sanyo have a minimum RPM of 0. The Thermalright fans have a 600 RPM minimum, but you can hardly feel anything at this speed (so no problem).
The Sanyo fan will only start after reaching a higher minimum PWM threshold, but still has a fairly low minimum RPM.
You need as much air flow as you can get, this is the CFM (Cubic Feet per Minute) value of the fan: a higher CFM value means more air flow. The Scythe fan produces 85 CFM, the Delta AFB1212SH fan produces 113 CFM and the Thermalright TY 143 fan produces 130 CFM. There are PWM fans which can produce 260 CFM like the Sanyo San Ace 120 9SG1212P1G03, but they produce a lot of noise! Check the dB value of the fan to see how much noise it produces: 29.5 dB for the Scythe fan, 45 dB for the Thermalright TY 143 fan, 46.5 dB for the Delta fan and a whopping 64 dB for the Sanyo fan (that’s LOUD, see video above). A small fan with a high RPM value will also make a lot of noise. A larger fan is recommended: lower noise and a wider air flow (but see the addendum below).
My current recommendation is to use the Thermalright TY 143 140 mm fans: more wind (130 CFM), not too loud (45 dB).
Power
A high CFM fan needs more power. The Scythe fan I chose draws 0.22 Amps at 12V. If you use two of them you need a 12V power adapter which can deliver at least 0.5 Amps (0.22 x 2).
The Delta AFB1212SH fan draws 0.83 Amps maximum, if you use two of them you need a 2 Amps power adapter (0.83 x 2).
The Thermalright TY 143 fans draw 0.6 Amps each, so 1.2 Amps if you use two of them.
The 260 CFM Sanyo fan I mentioned draws 4 Amps, so if you use that one you need a much bigger power adapter: 4 Amps or 8 Amps if you use two fans (but then the neighbors will complain about the noise ).
To avoid damaging the Arduino the power to the fans in my project is connected directly to the power adapter, it is not running through the Arduino. The Arduino is only controlling the speed.
More fans
You can use as much fans as you want: by connecting the PWM signal from the Arduino to each fan the speed will be controlled of all fans. Do check if you need a bigger power adapter.
I’m using two fans as shown in this picture:
The fans are tie wrapped together with a piece of tube in the middle, so you can angle the fans a bit inward.
What do you need?
I have added the price I paid for it.
Programming
Click on the icon with the arrow pointing right, this will compile the sketch and send it to the Arduino. If there are no errors shown in red you can now close the IDE.
Connecting the fans
Connect the power adapter and the fans like this:
Pin 3 of the Arduino is connected to the PWM pin of the fan (the orange wire on the fan).
The GND of the power adapter is connected to the GND of the Arduino and the black wire of the fan.
The + of the power adapter is connected to the red wire of the fan. A switch in this wire is handy to power off the fans after racing.
My son (thanks man!) did all the soldering and made a Y-cable which splits the power and PWM signal to both fans, but you can buy a ready made.
Testing the hardware
Plug in the power adapter and switch it on. The fans should start running.
Press the reset button on the Arduino, this will initiate the startup sequence: the fans will run faster and faster and drop to the lowest speed in about 4 seconds time.
Connecting to Assetto Corsa
Download the program ACFan.exe which you can find in the binary folder here: https://drive.google.com/drive/folders/0B-23DIE-A8sUYXowYTlXXzBpR00
Save ACFan.exe in a folder, for example in C:\AC.
Create a shortcut to C:\AC\ACFan.exe on your desktop.
Right click the shortcut, go to Properties and add the COM port to the target, for example “C:\AC\ACFan.exe” com5 and click on OK.
Start Assetto Corsa and start a practice run. Tip: keep Assetto Corsa running in a small window so you can see the game and the output ACFan at the same time. While driving you should see numbers between 61 and 100; 30 when your car doesn’t move.
The fans should blow accordingly.
Note: when you run the game as administrator, you may need to run ACFan as administrator as well.
Addendum: airflow straightener
It is a good idea to mount an airflow straightener to the fans. As the name implies the airflow will be straightened ('combed', 'directed') when it leaves the fan. This results in a 20 - 25% higher airflow and the wind doesn't 'flutter' around. You really can feel the difference with and without it. Highly recommended.
I was looking for a ready made airflow straightener, but couldn't find one, so I built one myself. What you need: thick straws, super glue, scissors and some tape.
I bought 200 1.1 cm STANNY straws at Jysk.
I cut all yellow straws into 3 cm pieces. For a 140 mm fan you need 133 pieces, so that's 266 for two fans. Glue the pieces together with super glue so you get a nice 'pancake'. Let them dry for at least 48 hours or you will get a headache from the glue when the fans are blowing in your face!
Tape the 'pancakes' to the fan with sealing tape for cardboard boxes.
The result looks like this (yes, I'm driving in VR only):
The flexible gooseneck and clip is a Bresser BR-12 (40 cm).
More photos in the comments below as I cannot post more in this article.
I hope you will be blown away . Let me know what you think. Feel free to ask.
Insert Coin
In short: ACFan sends speed of car in AC to Arduino Uno R3, which controls PWM fan(s). No PWM whine. Hardly any CPU load.
Scythe GlideStream 120 PWM SC (silent)
Delta AFB1212SH fans (more wind, noisier)
Sanyo San Ace 120 9SG1212P1G03 (only one fan, loud!)
Don't mind the driving, I'm not used to an Xbox controller.
Thermalright TY 143 140 mm fans (no video)
(pen for size)
I would like to present my little project: a wind simulator for Assetto Corsa. Most wind simulators use an Arduino combined with a separate motor controller, which can be expensive if you use larger fans. My project also uses an Arduino, but with standard PWM PC case fans. A PWM fan has a motor controller built into the fan. The Arduino just sends a PWM signal to the fan and this will control the speed of the fan. This way there are less parts needed and the project is kept simple.
Credits
It’s not an original idea of me, I just combined two ideas: using an Arduino to control a PWM fan and using an existing interface between Assetto Corsa and the Arduino. There is no PWM whine coming from the fan because a 25 KHz PWM signal is used.
I would like to thank afremont for his PWM logic, see https://forum.arduino.cc/index.php?topic=155089.45
I would like to thank mongo56 for his ‘ACFan’ executable and source code, see https://www.reddit.com/r/oculus/comments/2b8d3m/assetto_corsa_fan_control/
ACFan
The program ACFan is the interface between Assetto Corsa and an Arduino. ACFan reads the shared memory of AC: the speed of the car and the steering input. When the car is idle, it sends value 30 to the Arduino. As soon as the cars starts rolling, it sends between 61 and 100 to the Arduino, depending on the speed of the car. ACFan also varies the values a bit when you are steering to simulate wind direction changes.
Arduino
I have modified the sketch (program) mongo56 made for the Arduino, it now uses PWM to control the speed of the fan. It has a startup sequence built in which speeds up the fan in a few seconds so you know the Arduino is doing its job. After that it continuously translates the values sent by ACFan to a usable PWM value, between 0 and 79.
Remark: when there is no PWM signal sent to the fan, it will run at top speed.
Fans to use
Most fans cannot stop completely, even with a PWM signal at zero. The Scythe GlideStream 120 PWM SC fans I chose have a speed of 300 to 1500 RPM. This means there will always be some wind blowing when the car stops (= 300 RPM). At best you can use fans with a broad RPM range: a low minimum and high maximum RPM value. This way the fan will produce a higher wind speed difference at high and low car speed.
The Delta and Sanyo have a minimum RPM of 0. The Thermalright fans have a 600 RPM minimum, but you can hardly feel anything at this speed (so no problem).
The Sanyo fan will only start after reaching a higher minimum PWM threshold, but still has a fairly low minimum RPM.
You need as much air flow as you can get, this is the CFM (Cubic Feet per Minute) value of the fan: a higher CFM value means more air flow. The Scythe fan produces 85 CFM, the Delta AFB1212SH fan produces 113 CFM and the Thermalright TY 143 fan produces 130 CFM. There are PWM fans which can produce 260 CFM like the Sanyo San Ace 120 9SG1212P1G03, but they produce a lot of noise! Check the dB value of the fan to see how much noise it produces: 29.5 dB for the Scythe fan, 45 dB for the Thermalright TY 143 fan, 46.5 dB for the Delta fan and a whopping 64 dB for the Sanyo fan (that’s LOUD, see video above). A small fan with a high RPM value will also make a lot of noise. A larger fan is recommended: lower noise and a wider air flow (but see the addendum below).
My current recommendation is to use the Thermalright TY 143 140 mm fans: more wind (130 CFM), not too loud (45 dB).
Power
A high CFM fan needs more power. The Scythe fan I chose draws 0.22 Amps at 12V. If you use two of them you need a 12V power adapter which can deliver at least 0.5 Amps (0.22 x 2).
The Delta AFB1212SH fan draws 0.83 Amps maximum, if you use two of them you need a 2 Amps power adapter (0.83 x 2).
The Thermalright TY 143 fans draw 0.6 Amps each, so 1.2 Amps if you use two of them.
The 260 CFM Sanyo fan I mentioned draws 4 Amps, so if you use that one you need a much bigger power adapter: 4 Amps or 8 Amps if you use two fans (but then the neighbors will complain about the noise ).
To avoid damaging the Arduino the power to the fans in my project is connected directly to the power adapter, it is not running through the Arduino. The Arduino is only controlling the speed.
More fans
You can use as much fans as you want: by connecting the PWM signal from the Arduino to each fan the speed will be controlled of all fans. Do check if you need a bigger power adapter.
I’m using two fans as shown in this picture:
The fans are tie wrapped together with a piece of tube in the middle, so you can angle the fans a bit inward.
What do you need?
I have added the price I paid for it.
- Arduino Uno R3 (clone), 13 euro
- Arduino Uno frame (mini case) is recommended, 5 euro
- USB cable type B, 0.50 euro
- 12V power adapter of at least 0.5A (2A recommended), 5 euro
- Multicolored Dupont wires (a kit of male / male, male / female, female / female is handy), about 6 euro
- Two Scythe GlideStream 120 PWM SC (SY1225HB12MS-RKP) fans (or just one), 8.79 euro each
or
two Delta AFB1212SH fans (eBay), about 10 euro each
or
two Thermalright TY 143 fans, 13.43 euro each.
I do not recommend the Sanyo fans: too loud.
- 3 pin tumbler switch, 0.75 euro. Alternative: use a power socket with a switch in which you plug the adapter
- 4-pin PWM fan splitter cable (Y-cable) if you use more than one fan: build it yourself or buy this one
- Pin header, 0.25 euro
Programming
- Download the Arduino IDE (programming environment) at https://www.arduino.cc/en/Main/Software and install it.
- Connect the Arduino to your PC using the USB cable.
- Check Windows’ device manager to see which COM port the Arduino is using.
- click on Tools – Board and select Arduino Uno
- click on Tools – Port and select the COM port you found in the device manager
- click on Tools – Programmer and select USBasp
Code:
// Arduino UNO sketch
// Insert Coin
// Version 1.0: April 1, 2017
// Version 1.1: May 26, 2018
//
// Thanks to afremont for his PWM logic,
// see https://forum.arduino.cc/index.php?topic=155089.45
//
// Thanks to mongo56 for his idea ACFan and source code,
// see https://www.reddit.com/r/oculus/comments/2b8d3m/assetto_corsa_fan_control/
//
// Version 1.1: higher minimum speed of the fans while driving slowly
// Maximum speed of the fans now set at 250 km/h
//
String incomingValue;
int myval;
unsigned int x;
const int PWMPin = 3;
void setup() {
myval = 0;
Serial.begin(9600);
// generate 25kHz PWM pulse rate on Pin 3
pinMode(PWMPin, OUTPUT); // OCR2B sets duty cycle
// Set up Fast PWM on Pin 3
TCCR2A = 0x23; // COM2B1, WGM21, WGM20
// Set prescaler
TCCR2B = 0x0A; // WGM21, Prescaler = /8
// Set TOP and initialize duty cycle to zero(0)
OCR2A = 79; // TOP DO NOT CHANGE, SETS PWM PULSE RATE
// start-up sequence: let the user know we are working OK
// start fan at lowest speed
OCR2B = 0; // duty cycle for Pin 3 (0-79) generates 1 500nS pulse even when 0 :(
// wait for the fan to power down
delay(1000);
// ramp up fan speed by increasing duty cycle every 50mS, takes 4 seconds
for(x = 0; x < 80; x++) {
OCR2B = x; // set duty cycle
delay(50);
}
// wait a bit
delay(3000);
// set fan to lowest speed
OCR2B = 40; // duty cycle for Pin 3 (0-79) generates 1 500nS pulse even when 0 :(
}
void loop() {
// waiting for data coming from ACFan.exe
// which retrieves the speed from Assetto Corsa,
// converts it to a string and sends it to the Arduino
if(Serial.available() > 0)
{
char ch = Serial.read();
// check for new line and add the char if it isn't
if (ch != 10){
incomingValue += ch;
}
else
{
// Serial.println(incomingString);
int val = incomingValue.toInt();
// Text copied from ACFan.cpp:
// ESC value between 30 and 180 (30 = initial startup)
// adjust this to fit your ESC/motor and liking
// 61 was the value my motor started running
// 350 was my max speed in Assetto Corsa (in kmh)
// 50 was an arbitary multiplier to normalise the output values between ~61-100
// also added a bit of variance with steerAngle so that when you turn in you get a little less "wind"
if (val > -1 && val < 181)
{
// Version 1.1, another approach: about 30% low speed boost
if (val < 63)
{
myval = 0; // fans to 0% when the car isn't moving
}
else {
myval = (val - 35) * 1.25;
// To get a variance between 0 and 79 instead of 61 and 100.
// 1.25 = max speed around 250 km/h, decrease this value for faster cars.
// Higher minimum speed of the fans.
}
// check if out of bounds
if (myval < 0) {
myval = 0;
}
if (myval > 79) {
myval = 79;
}
// set the fan speed (duty cycle)
OCR2B = myval;
}
// clear the input string that came from ACFan
incomingValue = "";
}
}
}
Click on the icon with the arrow pointing right, this will compile the sketch and send it to the Arduino. If there are no errors shown in red you can now close the IDE.
Connecting the fans
Connect the power adapter and the fans like this:
Pin 3 of the Arduino is connected to the PWM pin of the fan (the orange wire on the fan).
The GND of the power adapter is connected to the GND of the Arduino and the black wire of the fan.
The + of the power adapter is connected to the red wire of the fan. A switch in this wire is handy to power off the fans after racing.
My son (thanks man!) did all the soldering and made a Y-cable which splits the power and PWM signal to both fans, but you can buy a ready made.
Testing the hardware
Plug in the power adapter and switch it on. The fans should start running.
Press the reset button on the Arduino, this will initiate the startup sequence: the fans will run faster and faster and drop to the lowest speed in about 4 seconds time.
Connecting to Assetto Corsa
Download the program ACFan.exe which you can find in the binary folder here: https://drive.google.com/drive/folders/0B-23DIE-A8sUYXowYTlXXzBpR00
Save ACFan.exe in a folder, for example in C:\AC.
Create a shortcut to C:\AC\ACFan.exe on your desktop.
Right click the shortcut, go to Properties and add the COM port to the target, for example “C:\AC\ACFan.exe” com5 and click on OK.
Start Assetto Corsa and start a practice run. Tip: keep Assetto Corsa running in a small window so you can see the game and the output ACFan at the same time. While driving you should see numbers between 61 and 100; 30 when your car doesn’t move.
The fans should blow accordingly.
Note: when you run the game as administrator, you may need to run ACFan as administrator as well.
Addendum: airflow straightener
It is a good idea to mount an airflow straightener to the fans. As the name implies the airflow will be straightened ('combed', 'directed') when it leaves the fan. This results in a 20 - 25% higher airflow and the wind doesn't 'flutter' around. You really can feel the difference with and without it. Highly recommended.
I was looking for a ready made airflow straightener, but couldn't find one, so I built one myself. What you need: thick straws, super glue, scissors and some tape.
I bought 200 1.1 cm STANNY straws at Jysk.
I cut all yellow straws into 3 cm pieces. For a 140 mm fan you need 133 pieces, so that's 266 for two fans. Glue the pieces together with super glue so you get a nice 'pancake'. Let them dry for at least 48 hours or you will get a headache from the glue when the fans are blowing in your face!
Tape the 'pancakes' to the fan with sealing tape for cardboard boxes.
The result looks like this (yes, I'm driving in VR only):
The flexible gooseneck and clip is a Bresser BR-12 (40 cm).
More photos in the comments below as I cannot post more in this article.
I hope you will be blown away . Let me know what you think. Feel free to ask.
Insert Coin
Last edited: