.... hitting the fan - Page 1
Forum section: electronics / beginners

author: PerranOak
author_rank: Frequent Contributor
timestamp: August 01, 2019, 05:13:00 pm
content: I have a fan from an old PC which is in really good nick and would like to do a few things with it for education purposes.Firstly, I'd like to measure the speed of rotation. I tried a bright light and a photodiode but the 'scope signal was mostly mains interference. I could see the change in voltage when I passed my hand in front of it so the circuit "works" but I guess the light intensity is too low to register over the noise given the short on-time between blade rotations.Is there a better way? Is a photodiode (jelly bean) going to be fast enough? Should I use a laser diode for higher intensity?Any advice welcome.

author: bdunham7
author_rank: Super Contributor
timestamp: August 01, 2019, 06:02:02 pm
content: Quote from: PerranOak on August 01, 2019, 05:13:00 pmWhy mains interference? Does your light (or the room lights) flicker? You might try a bit of aluminum foil on one blade. Or, how about a small microphone placed right near the ends of the blades to pick up the pressure pulses?To answer your other question, I've never heard of a photodiode so slow it couldn't pick up fan blades. An old CdS resistance cell, maybe.

author: soldar
author_rank: Super Contributor
timestamp: August 01, 2019, 06:10:59 pm
content: Quote from: PerranOak on August 01, 2019, 05:13:00 pmWhat "bright light" did you use?Can you show us the schematic of the detector?

author: magic
author_rank: Super Contributor
timestamp: August 01, 2019, 10:29:20 pm
content: Quote from: PerranOak on August 01, 2019, 05:13:00 pmIt doesn't have a three or four pin connector by any chance?One thing about those fans is that they contain a magnet in the rotor. I'm not sure how much of a coil it would take to induce measurable voltage from its rotation, but that should be possible in theory.

author: Brumby
author_rank: Unknown
timestamp: August 01, 2019, 11:41:52 pm
content: Quote from: PerranOak on August 01, 2019, 05:13:00 pmI'm going to guess that you have your light source and sensor on opposite sides of the fan and placed at right angles to the plane of the fan blades. If the fan you have is anything like the ones I've seen, there isn't much of an optical gap between each blade, so my suggestion is simple - turn the body of the fan so that the angle of the blades allows more light through, increasing the "on-time between blade rotations".

author: Cubdriver
author_rank: Unknown
timestamp: August 01, 2019, 11:54:52 pm
content: Turn the room lights off to reduce ambient light interference and increase the signal to noise ratio?-Pat

author: StillTrying
author_rank: Super Contributor
timestamp: August 02, 2019, 12:24:26 am
content: Quote from: PerranOak on August 01, 2019, 05:13:00 pmJust a photo diode connected to a 1M scope will have only a near DC bandwidth, a photo diode with a 2k2 in parallel with it should be fast enough to see the few 100 Hz of fan blades and the 100Hz 8% of light ripple from a mains powered incandescent.QuoteJust adjust the light source to try to get 50mVpp to 250mVpp out of the PD+2k2 between light/shadow and call it done.Afterquite a fewexperiments I managed to get about 20MHz of BW out of SFH213's.https://www.eevblog.com/forum/chat/20w-halogen-bulb-viewed-by-a-photodiode/msg2411274/#msg2411274

author: ledtester
author_rank: Super Contributor
timestamp: August 02, 2019, 01:07:00 am
content: Do you have a photo-transistor? Just a 10K pull-up on the collector should give you nice pulses:Code:+5---/\/\/\/----C ... E --- GND10KC = the collector of the photo-transistor; E = the emitter.The emitter of the photo-transistor is grounded. Put your scope probe / frequency counter on the collector.If your computer fan has 3 wires, the third one (non-Vcc and non-GND) is usually a open-collector tachometer signal. Just connect a 10K resistor from it to Vcc and it will give digital pulses as the fan rotates.

author: wraper
author_rank: Unknown
timestamp: August 02, 2019, 01:12:43 am
content: Use IR LED and phototransisor powered through a few kOhm resistor from something like 5V.

author: PerranOak
author_rank: Frequent Contributor
timestamp: August 02, 2019, 02:48:36 pm
content: Thank you very much guys - I will look into all of this but two things first.I feel that I am missing something fundamental here.Two things:1. Putting the 2k2 resistor in parallel to the photodiode - what does this do to make the diode faster?2. My fan has four wires and I couldn't get anything sensible from the other (i.e. excl. Vcc and GND) two. Now, when I put the 10k resistor to Vcc, I see the pulses as promised! Why when I just connected the 'scope to this wire did I see nothing? Is it because very little current was flowing?Thank you, now I'll get on with the further points!

author: StillTrying
author_rank: Super Contributor
timestamp: August 03, 2019, 09:51:19 am
content: Putting the 2k2 resistor in parallel to the photodiode - what does this do to make the diode faster?A PD can only produce a small-ish current, and can't sink any, with only the scope's 1M to discharge the (PD + scope's) 20-100pF the fall time will be very slow, so it's a pull-down resistor.Now, when I put the 10k resistor to Vcc, I see the pulses as promised! Why when I just connected the 'scope to this wire did I see nothing? Is it because very little current was flowing?Open collector of course, that's a pull-up resistor.On 3 wire fans the 3rd wire is a speed output.

author: PerranOak
author_rank: Frequent Contributor
timestamp: August 03, 2019, 10:35:20 am
content: Ah, thank you. I didn't realise that the photodiode generated current - I though of them as being, essentially, a type of variable resistor and so never bothered to find out about them.How did you know it is an open collector!? I wish I had your knowledge ... hence all the questions!

author: StillTrying
author_rank: Super Contributor
timestamp: August 03, 2019, 11:40:29 am
content: Open collector and open drain is VERY common.https://en.wikipedia.org/wiki/Open_collectorI don't know whether it's the fan speeds, or the viewing of the blades through a photo diode that you're interest in.Why don't you spend a year (on and off) reading 50 websites, 50 pdfs, and flashing LEDs and bulbs at photodiodes just to see what the light shapes look like, I did as in the link above.

author: janoc
author_rank: Super Contributor
timestamp: August 03, 2019, 12:05:24 pm
content: Quote from: Brumby on August 01, 2019, 11:41:52 pmAn even better way in this case could be sticking a piece of white or reflective tape to a blade and sensing reflected light. I.e. put the LED and the phototransistor/diode on the same side, just don't forget to put something between them so that the LED doesn't shine directly on the sensor. That's how most of the commercially sold tachometers work.

author: Jwillis
author_rank: Super Contributor
timestamp: August 04, 2019, 12:08:31 am
content: A typical 4 wire brush less fan motor wiring has a Gnd , Pos, PWM signal in and a signal out or speed sense. The PWM controls the duty cycle to make the motor run faster or slower. The Signal out or speed sense wire sends a signal back to the PWM to help regulate the speed and/or computer to display the speed. You can use the signal out to a simple 555 tachometer circuit to get a speed of the motor.You can also use that same type of circuit with a photo transistor to detect RPM of a fan.The internet has lots of 555 tachometer circuits. Although most are for connecting to a distributor ,that's not a problem since the point contacts only have a voltage of 6-12 volts. Simply connect a photo transistor collector to power source and the emitter to signal input .A photo transistor is much more sensitive than a photo diode and really would only need ambient light to function.Just as a side note , you will have to calculate the relation between the frequency of light pulses and number of blades to get the RPM of the fan motor.Household LED lamps work with a PWM.Frequencies can be quite high. So can receive weird readings on a light sensitive tachometer.I seem to get readings around 7200 Hz on a Digital Tachometer for RC aircraft engines. Incandescent bulbs of course "flicker" between 100 and 120Hz.Florescent lights can be as high as 60kHz .

author: Rick Law
author_rank: Super Contributor
timestamp: August 04, 2019, 08:18:36 pm
content: You have a lot of variables here. You did not post any base line numbers so it is hard to judge. After you read this, you can decide if you missed anything, and if what you missed is fundamental.There is at least two lights we have discussed, (#L1) your ambient light hitting the photo diode and (#L2) your light source aiming at and hitting direct on the photo diode.A third one is actually in play: (#L3) reflection. Some of the light from your source that isn't hitting directly on the photo diode will hit directly on something else. They get reflected around and eventually some amount of this reflected hitting your photo diode.The diode reading is a result of #L1 + #L2 + #L3. Your measurement strategy is to measure delta in #L2, but #L1 plus #L3 may overwhelm your delta in #L2. You may need to determine if that is the case.This is referenced in Case 2described later. But there is some homework to do first.Firstlets do some base line validation described below as Case 1.Case 1 overviewTryrotating the blades manuallyand see the range of measurements between max and min light block.Ideally, you don't want your hands there during measurement if you can help it. Your hand would block some light and reflect some light thus complicate things. This is tricky - since most fans have magnet and they may cause the blades to stop at "preferred positions" instead of stopping at the position you want. So you may need something to hold the blade in max blocking position and min blocking position. May be hold it with a small piece of tape, or may be a small piece of paper to jam it at the position. Note the reading at max light blocking (VmaxBlock) and at min light blocking (VminBlock). Also note the difference as Vdelta.Case 1 (#C1) Test if your diode can measure a difference(betweenwhen the blade is stopped(jamed/taped)at max and at min blocking:If NO (ie: can't measure a difference), go to Case 2Else stay here on Case 1Your setup is working and measurable when static at both positions. Failure to plot a good graph when FAN is spinning with POWER ON means (#C1a) scope setting may merely be incorrect for the speed of the FAN, or (#C1b) perhaps your circuit is indeed too slow.Now you can narrow it down, is it #C1a, #C1b, or both combined.C1#a, scope trigger setting issues:(#C1a1) The scope should set to expected voltage is between VmaxBlock and VminBlock.(#C1a2) The scope should set timing to what is expected, but expected frequency depends on the RPM. We know the lower bound is 0 RPM. For PC fans, RPM wont be millions or 100K+, it is probably < 10K RPM and likely < 5K RPM. Each blade cause a cycle, so the upper bound is number-of-blades times RPM. For 6 blades fan at 10K RPM max, that would be 60KHz max. Likely it would be 5K RPM max and that would equal 30KHz max.So, when successful, you should be seeing a plot from VmaxBlock to VminBlock with frequency at number-of-blades times RPM expected to be.Note that when the blade is turning, the reflected light changes. You may want to proceed Case 1b's slow down test to alter the FAN speed a bit to see the RPM range it works.For Case 1#C1b, yourfan is faster than your circuit, but before you accept that,you need to verify that before working on speeding up the circuit. You verify by slowing the fan by either lowering the voltage running the fan, or by putting some friction on the fan blade-assembly as a friction-brake. Whatever you use to friction-brake the fan should not be adding shadow or reflecting more light. A very small rod like the wood chopstick you get from Chinese restaurant may work. You figure that out.Ifby slowing it down you can now measure, then you have validated FAN speed faster than your system is the problem. You go solve that and solving that equals success.Case 2 (#C2) if your diode cannot measure a difference(between when the blade is stopped (jammed/taped) at max and at min blocking, then it is the light level between different lights. L#2 delta is indeed overwhelmed by L#1 and L#3. This is when you will be adjust light left and right to find the right mix so L#2delta is not overwhelmed by L#1 and L#3. Success-exit is not here. Once you succeed in solving this, you go back to Case 1 to get to success-exit.For ambient light (L#1), it is easy to control, so L#1 is easy.For reflected light (L#3), this is harder. You need to minimize light from your light source NOT hitting directly on the photo diode so there is less to reflect around.Here are some (but not all) of the way to minimize the reflection:- Focusable flash light or laser as you pointed out, but you need a laser with frequency that can drive the diode. Flashlight's light wave has a mix of frequency. Laser has light with a single frequency. So it is important to check that the laser light is indeed one that your diode can work with.- Source blocking - send the light pass a light guide like a pipe. Put your flashlight inside a PVC pipe or the core of a roll of paper towel.- Target blocking - cover your photo diode with only a small hole opening that is aligned to the source-blocking's exit hole.Each time you make adjustments, you test it with Case 1's manual blade position change to see if you get it to register a change.When succeed in dealing with Case 2, you got back to Case 1. The Case 1's tests has the success-exit.

author: ledtester
author_rank: Super Contributor
timestamp: August 04, 2019, 11:06:18 pm
content: @PerranOak... could you post a pic of your setup?And what's the make and model of your fan and part number of your photo diode?Thanks

author: Brumby
author_rank: Unknown
timestamp: August 05, 2019, 03:07:51 am
content: Quote from: ledtester on August 04, 2019, 11:06:18 pmI think that should have been asked a lot sooner.

author: koloko
author_rank: Newbie
timestamp: August 05, 2019, 05:59:16 pm
content: You could glue a little magnet on one blade and use a hall effect sensor to measure the speed of the fan.

author: magic
author_rank: Super Contributor
timestamp: August 05, 2019, 10:04:59 pm
content: There already is a big magnet inside the rotor. These are permanent magnet motors.Also, the fan's controller senses this magnet's orientation using precisely a Hall sensor and that's how it knows how to drive the stator windings.

author: StillTrying
author_rank: Super Contributor
timestamp: August 06, 2019, 06:59:15 am
content: Hasn't anyone done this simple viewing fan blades with a photo diode yet.A 2k2 to 5k6 across the PD and a LED torch works fine.

author: Circlotron
author_rank: Super Contributor
timestamp: August 06, 2019, 10:05:57 am
content: Put a 10 ohm or therabouts resistor in series with the DC power lead and put your scope across the resistor and watch the rate the current gets chopped as the fan rotates. Could be 3, 4, or 6 times per revolution or similar.

author: Nominal Animal
author_rank: Super Contributor
timestamp: August 06, 2019, 10:52:53 am
content: Most PC fans have a tach signal (yellow wire), that provides two pulses per revolution.

author: PerranOak
author_rank: Frequent Contributor
timestamp: August 07, 2019, 04:19:10 pm
content: Thank you everyone for all the replies. So, in order:bdunham7 : I’m guessing it’s mains as it’s 50Hz. I really wanted to use the photodiode (PD) as I already have some.soldar: the light I use is a bright LED torch. Initially, the “detector” was simply the PD connected to a battery with the scope attached! However, see below.magic: The fan has four wires but I want to learn how to measure the speed myself first using the PD.Brumby: you’re quite right! I did try it otherwise but similar results. However, I will do as you suggest in future.Cubdriver: I can’t – there are no curtains in this room! It’s a long story about SWMBO, etc.StillTrying: I tried and it was better but went with an amplifier circuit.ledtester: thank you but I don’t have a phototransistor and wanted to use the PD.wraper: see above.janoc: interesting, I’ll keep that one in my back pocket.Jwillis: cheers, I will save all that good advice for when things are running better.Rick Law: wow mate! That’s fantastic! I’m gonna print it out and go through it once I’ve posted this reply!ledtester: it’s from an old Dell and is made by: Minebea-Matsushita Motor Corp and is the: 3615KL-04W-B96. It’s 12V and says on it “2.50A” which I guess is maximum current. Photo attached – this is embarrassing, now you can see my “Heath Robinson” attempts(!) The breadboard near the fan is the PD and LM358 while the one behind is a simple 555 based PMW speed controller.koloko: thanks but I really want to use the PD.StillTrying: Ah, really? Just the PD and a LED torch? I had, in the meantime, gone for an amplifier with an LM358 and the PD in photovoltaic mode. I think I’ll go back and try your way.Circlotron: that is interesting – I’ll try that after.Nominal Animal: I admit I did cheat and look at that but I want to come back to that, if I may.I have a lot of work to do, thank you all very much.

author: StillTrying
author_rank: Super Contributor
timestamp: August 07, 2019, 06:05:05 pm
content: You won't get much output from the PD using that large diffuse side of the torch, you need a smaller intense beam to create sharper blade shadows on the PD. I used a beam torch similar to this.https://www.ebay.co.uk/itm/Tactical-Outdoor-LED-T6-Lamp-Flashlight-Torch-50000LM-Zoomable-5-Modes-18650/173555276628At about the same distances as your PD and torch it was quite easy to get a 0.35Vpp cog-tooth shaped waveform, fan had 7 blades.

author: Rick Law
author_rank: Super Contributor
timestamp: August 07, 2019, 07:41:23 pm
content: Quote from: PerranOak on August 07, 2019, 04:19:10 pmNice of you to say that. Let's hope that indeed helps you narrow the problem.As you work through that, the most important would be theVdeltabaseline which is the difference (in absolute value) betweenVmaxBlockingandVminBlocking. That will tell you a lot. Take note on the noise level there too. Since you are moving the fan blade manually, any of significant noise there (compared to Vdelta) is going to cause problem.I think there is a good possibility that your reflected light (plus ambient light) is overwhelming that light that hits directly your photo diode. Looking at the size of your light source, it will leak a lot of light to eventually reflect on to your photo diode, so reflected light could be a significant problem-contributor.It is not necessary good to have an overly strong light source. Strong light source reduces ambient light problem but it also introduce more reflected light. The idea is tomaximize Vdelta.Beside moving the blade to get VmaxBlocking and VminBlocking, you should also note the reading when the fan is absent (VnoFan). That will give you a sense of the best way to approach maximizing Vdelta.Let us know how it goes.Rick

author: Circlotron
author_rank: Super Contributor
timestamp: August 08, 2019, 02:04:35 am
content: Quote from: Circlotron on August 06, 2019, 10:05:57 amI went and tried the above. At 12 volts supply there are two pulses per rev with my fan, approx 13mS apart. Scope says 77.878Hz which is 4673 pulses per minute. Actual speed measured with a Uni-t UT372 reflective tacho is 2344 rpm averaged over about 30 sec. 4673ppm/2344 rpm = 2 pulses per rev.

author: ledtester
author_rank: Super Contributor
timestamp: August 09, 2019, 04:49:58 am
content: QuoteThe methods described in this Analog Devices lab should also work with a photodiode:https://wiki.analog.com/university/courses/electronics/electronics-lab-led-sensorThe Darlington-pair circuit in particular should be very effective at amplifying the current produced by the photodiode. Of course, you could also use an LED.Also, Forrest Mims III also has written extensively on how to use LEDs/photodiodes as a light detector. Here's an article of his that appeared in Make magazine:https://makezine.com/projects/make-36-boards/how-to-use-leds-to-detect-light/