preload preload preload preload

DIY Wind Simulation

This is another experiment with the Arduino. It’s not finished yet, but I think it’s worth it to show it working.

A fellow iRacer asked me if I could do something like a “wind simulator”, that changed the speed of a fan depending on the speed of the car. The project is quite simple and the only electronic component needed excluding the Arduino and the fan itself is a U$0,10 NPN transistor. The transistor is needed because the Arduino can only source 5v from its PWM ports and the fan operates at 12v, so I used it to amplify the 5v PWM signal using a 12v power supply.

You can see it working below. I’ve added a high-tech piece of paper into the fan just to make some noise, as it would be hard to notice the fan speed changing watching the video.

Yeah, I’m aware that the Riley DP is a closed cockpit and the “wind on my hair” feeling doesn’t make too much sense in it, but I only noticed after I recorded the video.

The source code couldn’t be more simple. It just sends a PWM signal through port 11 on you Arduino board. Usually those computer fans are not designed to be controlled with pulse width modulation, but it works. The lifespan of the fan will probably be reduced, but nothing that you should worry about. You can also buy an PWM motor/fan if you like.

Anyway, simply paste this code into the Arduino IDE and upload it to the board.

const int outpin = 11;

void setup() {
  Serial.begin(9600);
  pinMode(outpin, OUTPUT);
}

void loop() {
  if (Serial.available()) {
    int inByte = Serial.read();
    analogWrite(outpin, inByte);
  }
}

The wiring is just as simple. Below you see a “fancy” wiring with the protoboard and also a regular schematic design.

Arduino and breadboard

Arduino and breadboard

 

Schematic

Schematic

The parts list is very short:

  • 1x Arduino board (Uno or Duemilanove for example)
  • 1x NPN Transistor (eg. 2N2222)
  • 1x 12V DC computer fan (or PWM fan)

It’s worth noting that you will need to use an external power source connected to your Arduino in order to make the 12V fan work properly. You can use those simple DC adapters that you can find with almost any home gadget. Pay attention to the pinout polarity. If you choose to use a 5V DC fan instead of a 12V one, you don’t need an external power source and you also don’t need the transistor. Simply connect the pin 11 to the positive pole of the fan and ground the other pole.

Below is the download link for the client software (includes source code and executable). Code was written in Visual C# 2010, so you’ll need .NET Framework for it to work properly.

The contents of this project is distributed as “donationware”. If you find them useful, please consider doing a small donation.

DOWNLOAD: http://fergonez.net/files/iRacingWind.rar

  • 22 responses to "DIY Wind Simulation"

  • Bart Hendrikx
    11:33 on August 13th, 2014

    What do i do with the client software?

  • Marcio Arizon
    4:50 on May 23rd, 2014

    Muito bacana, parabéns.

  • halon
    12:48 on April 9th, 2014

    Works with Arduino Mikro ??

  • lindstrem
    0:12 on August 18th, 2013

    Hi again,

    alright since i have no idea what to do and where to get it i will just simply
    throw some cash at you and hope for response… how about a 100 euros?!
    Can you get me all thats needed to have that wind simulator for my iracing setup?
    Please respond to my email and i will paypal you the money. Thanx

    BTW: i dont understand why nl one sells this officially… its a great addon.

  • alex lindstrem
    13:29 on June 4th, 2013

    hi,

    just currious, i have a USB fan tht is connected directoy with usb and can be turned on and off with a switch on the fan. Would be possible to use that? Probably not, huh?

    thanks
    Alex

  • Abdul
    1:24 on May 11th, 2013

    This is amazing. I’ve installed Arduino and followed the sketch to connect a fan. Downloaded iRacingWind.

    I’ve copied code to arduino and installed .NET. And this is where I am stumbling. What should I do with iRacingWind?

    n00b asking for help :)

    • Abdul
      4:03 on May 11th, 2013

      Got it figured out the DIY way lol. But now the fan RPM stays constant when the car increases speed.

      Trying to understand Richard’s way of solving it

      “isn’t the motor meant to be between 12V and the NPN transistor not between the transistor and ground.”

      Anyway of getting a schematic guys?

      Thanks

      • rusty
        2:01 on April 15th, 2014

        were did you install iracingwind after all, I have been racking my brain for several hours and can not figure it out!!!!!!!

  • neil bow
    3:05 on April 13th, 2013

    Hello. I would like to use the wind generator circuit. I actually need it to control one or more rc servo’s using a program called fanaled’s for the vehicle’s velocity. fanaled is an addon program that works with most driving sims. I woulld happily pay you for the arduino program as I have the hardware but know nothing about the software writing.
    Are you based in the UK?
    Neil.

  • Blake Short
    17:51 on December 2nd, 2012

    You are a genius!! I’m going to try this for another bit of software though. Thanks for posting.

  • Joao Correa
    20:33 on March 2nd, 2012

    Hello, congratulations for your projects, you can only use an arduino nano in both projects? The wind and pedal vibration? Thank you.

  • Miguel
    20:28 on December 11th, 2011

    Awesome project, I’ll be looking into doing something like this in the coming weeks. If my pc has spare fan connectors will i still need an external power supply/transistor or can I use the pc power and just regulate it with software? Thanks

  • Splunk4u
    19:00 on November 12th, 2011

    3 Questions:

    1. Would it be possible to wire 2, larger fans? (12v, but what amp limit?)

    2. Do you plan to make this work with other games if output telemetry were provided?

    3. Could this eventually be made to have directional fans? (ie: 2 front and 2 sides for spins)

    • fergo
      20:58 on November 12th, 2011

      Hi,

      1) You can, without any problem. If you connect the fans in parallel, they all will get 12v. The current will split between each fan, so you need to provide a power supply with enough amps to power both fans.

      2) I currently own iRacing only (don’t plan to switch to other sim), but that’s why I released everything as open source, so others can adapt the code to work with other sims.

      3) That would require some calculations based on acceleration and speed vectors of the car.

  • sonac
    14:05 on November 6th, 2011

    I too had to change the COM port by editing the program (Thank you Fergo for instructions), but now it works great. I also wired it up like Richard said, so that the fan is between 12V and the transistor.
    With a 120x120x38mm 6.3W fan, that I used, you get a really strong effect.

  • Richard
    7:04 on September 17th, 2011

    Fantastic!!! Love your work.
    I have just finished building it with a Teensy board and it works great. I did have to edit your program to get the correct COM port for my card and the wiring diagram needs a slight tweak isn’t the motor meant to me between 12V and the NPN transistor not between the transistor and ground.

    • fergo
      16:32 on September 17th, 2011

      Ooops! You’re right! I made the diagram in a hurry and placed the motor wrong, need to change that. Thanks for reporting!
      Glad to see you are using it too :)

      • nick
        9:38 on May 11th, 2012

        Hi Fergo,

        is the diagram changed to the correct position? or should i follow the schematic. i have a fan with 3 wires, one black red and yellow, how should i connect them? Can’t seem to get them working.

        • fergo
          11:37 on May 11th, 2012

          The diagram is still wrong, I have to fix that. Follow the change that Richard suggested.
          The yellow wire is the RPM sensor, you don’t have to use it. Just use the red and black.

          • nick
            9:49 on May 16th, 2012

            thanks! can you please tell me how can i change the com port in your program? i bought the arduino for this project and i can’t seem to get it working. my arduino is in com port 3. not sure if i need to change my arduino com port number to suit the exe file.

      • Chris
        12:35 on January 7th, 2013

        nice project. Did you change the digram yet ? Im an electronics newb so not sure how to make the change suggested. Where to the red and black frm the phan go to ?

  • PJ Losey
    20:42 on September 5th, 2011

    Nice. Give me a relay and a big fan and were making a windtunnel :)

  • Leave a Reply

    * Required
    ** Your Email is never shared