The frozen computer fan - Page 1
Forum section: electronics / projects

author: jrmelsha
author_rank: Newbie
timestamp: January 09, 2016, 07:49:15 pm
content: Hello,I am a Senior Software Engineer, as well as a electronics hobbyist. Today I had the simple idea of using an Arduino's PWM capabilities to flash an LED at a computer fan to make it appear frozen. I have seen this trick done numerous times with other spinning objects. After a little bit of fudging, I managed to come up with the ideal duty cycle and frequency.I have seen computer fans in the past with LEDs mounted directly in the fan casing, pointing to the inside. My plan is to obtain one of these fans and install much more powerful LEDs, potentially RGB. After that I will need to design a circuit specifically designed to quickly and accurately read the fans tachometer, convert that into a frequency needed to make the fan look stopped, and then quickly and accurately set the LED frequency to that. The reason for accuracy / speed is so that the fan really looks stopped, currently my fan still vibrates ever so slightly. An additional design add-on would be for custom effects, such as making the fan go back-and-forth at certain rates, possibly even to music or something. It could also be used to give the illusion that the fan is spinning at different speeds.I am not an electrical engineer and lack formal education in this field, but currently I have some ideas of how to accomplish this. First of all, I will need a very reliable way to read the fans tachometer. I will be soldering sense/power/common wires directly to the fans PCB, that way I don't need to splice the wires and make it look ugly. Using PWM controlled fans (and by PWM I mean fans with a MOSFET already on board aka 4-pin fans) will probably be a requirement here. The reason to opt-in for the 4-pin fans is that I would like my circuit to need no external power (avoids messy wiring.) Another advantage of using 4-pin fans is that there is no need to compensate for the tachometer drop-out that occurs when the PWM wave is low. Once I have the tachometer signal, I would then route that to a micro controller that would calculate the RPM and then the required frequency it wishes to set (this would be where the cool effects get applied) and somehow controls an external LED/clock circuit. I really think it might be a good idea to avoid using on-board PWM to produce the frequency, I don't like the limited accuracy you get from using it. I would prefer to use an external circuit that is designed to produce a highly accurate PWM signal to power the LEDs. I believe that trying to reduce potential for noise will produce a better looking result. That about sums up my high level design idea for this project.My question - what are some good components / design ideas that I should use for this project? What are some problems with my current design / how can it be improved? Etc... I am open to any input! (that's why I posted here =])Anyway, thank you for checking out my real-world useless invention/project. Hopefully I can make something cool that people might want in their PCs or something.Technical info from the video:--- FanFan RPM = 1000 ±10 (fluctuation is due to the on board PC fan controller and or the fan's precision)--- LEDsFrequency = 120HzInput Voltage = 12VCurrent Draw = ~150mAPWM Duty Cycle = 4%Rated Voltage = 4.5V (came from a 3xAAA flash light)Rated Amps = ~800mA (gathered myself)Rated Watts = ~3.6W--- CircuitTransistor used = 30N06LPull-down resistor for transistor gate = 10k? (does not seem to make a difference)Arduino Uno (ATmega328P) @ 16MHzArduino Uno Source Code (C++):http://pastebin.com/kPqpTqur(If I left any details out just let me know and I'll add them.)

author: dom0
author_rank: Super Contributor
timestamp: January 09, 2016, 08:05:25 pm
content: QuoteAll PC fans have hall effect tachometers in them already, that's the signal on the third wire. Use that signal as a reference to lock the LED clock to.

author: jrmelsha
author_rank: Newbie
timestamp: January 09, 2016, 08:06:37 pm
content: Quote from: dom0 on January 09, 2016, 08:05:25 pmI apologize. I worded that incorrectly. What I meant is that I want a reliable/precision way to read that tachometer output. Sorry!

author: Monkeh
author_rank: Super Contributor
timestamp: January 09, 2016, 08:09:19 pm
content: Quote from: jrmelsha on January 09, 2016, 08:06:37 pmYou have a microcontroller, what's wrong with it?

author: jrmelsha
author_rank: Newbie
timestamp: January 09, 2016, 08:13:14 pm
content: Quote from: Monkeh on January 09, 2016, 08:09:19 pmThe package is too big, I would probably opt for the smaller packaged version of this chip. I was curious to see if there was a better chip out there for PWM input/outputs. The ATmega328p has some really funky PWM frequency control. I want a very precise output, within reason of course.

author: wraper
author_rank: Unknown
timestamp: January 09, 2016, 08:27:28 pm
content: WHY would you need to use PWM???

author: jrmelsha
author_rank: Newbie
timestamp: January 09, 2016, 08:38:32 pm
content: What do you mean? Are you speaking of the tachometer? I believe that would require an interrupt on the rising edge.

author: theatrus
author_rank: Frequent Contributor
timestamp: January 09, 2016, 10:06:47 pm
content: Three and four wire fans already have an open collector tach signal - it will fire 2x time per 360degrees.It feels like you may be overcomplicating this - not much calculation needed to strobe an LED at that exact point. You have the trigger signal, all you need is a timer to turn off the LED. No MCU is required.

author: SL4P
author_rank: Super Contributor
timestamp: January 09, 2016, 10:11:20 pm
content: +1it may be nice to add a delay (to adjust the strobe timing), and adjust the 'on' time (to optimise the LED illumination at the trigger point).PWM isn't part of the problem.Edge trigger on the tach.Turn on LEDs after (delay), and turn off after (period)Repeat.

author: lapm
author_rank: Frequent Contributor
timestamp: January 09, 2016, 10:30:08 pm
content: I would recommend adding finger quard inside too... Otherwise sooner or later someone will poke their finger there to touch it

author: SL4P
author_rank: Super Contributor
timestamp: January 10, 2016, 12:06:04 am
content: Quote from: wilfred on January 10, 2016, 12:04:32 amPWM isn't part of the problem.Edge trigger on the tach.Turn on LEDs after (delay), and turn off after (period)Repeat.

author: Helix70
author_rank: Unknown
timestamp: January 10, 2016, 08:29:54 am
content: To do other effects, set up a fast timer, count the ticks between each interrupt, then use this number (or variants depending on the "trick") to set timer interrupts to turn on the LED. Use another timer for turn off.

author: bxh
author_rank: Contributor
timestamp: January 10, 2016, 09:18:15 am
content: I've seen a ton of stroboscopic related projects, but for some reason this looks awesomeQuote from: jrmelsha on January 09, 2016, 08:13:14 pmCould you talk a bit more about what you meant by funky? I've used the 328p a fair bit and never noticed any issues with the PWM.

author: Seekonk
author_rank: Super Contributor
timestamp: January 10, 2016, 02:13:14 pm
content: I finally get what you are trying to do, just a show for a dumb computer case. Seems it would be more entertaining if you made it dance in a program instead of just being stopped. Stopped is nothing to look at after the first time. I was playing with fast strobes a couple years ago, dug up this picture. I had my finger over the flash to eliminate it. Instead everything was bathed in blood red (red arrow, notice how fuzzy from long flash) and white LED is the strobe. If going to use a micro, think multiple color LED and having each strobe at a slightly different frequency.