Welcome, Guest
Username: Password: Secret Key Remember me
  • Page:
  • 1
  • 2

TOPIC: Basic Electronics Transistor Question

Basic Electronics Transistor Question 1 year 2 months ago #18039

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
I am having a problem getting my head around this issue. I band-aid fixed it by using a home-made opto-coupler using two IR send and receive pairs and modifying them to switch the "channels".

The problem I have is with a legacy non-PWM case fan I love and have a few of still. It' the ANTEC TRI-COOL blue led 120mm fan. It has a connector for 12vdc, and a cable with a 3 position slid switch. The switch has three pins with one being common. OFF-OFF-OFF, ON-ON-OFF, and ON-OFF-ON so 1) no pins connected, 2) pins 1 and 2 connected, and 3) pins 1 and 3 connected. I voltage tested each of the three wires against the 12vdc ground and got 6vdc on the common wire, and 12vdc on the other two wires. When wires common and 2 (red) are tied, the voltage on that bridge is 8vdc. When command and 3 (yellow) are tied, the voltage on that bridge is 12vdc.

My home-made opto-coupler ties these connections just fine with desired results. But what if I want to use a pair of transistors, like 2 2n2222 npn types? After all, the emitter would be 6vdc above ground, and the collector would be 12vdc above ground. And they have to share ground with the MCU controlling the transistor.

Any ideas?

Basic Electronics Transistor Question 1 year 2 months ago #18040

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Well, for my application this worked. Actually a lot better than I expected so I will probably stick with it. I do not have a way to get RPM's from the fan as of yet so I cannot test voltage vs RPM's, but I get variable RPM's from the fan based on a variable voltage into the IR LED. Now all I need to do is either build a 4 bit resistor ladder DAC or a PWM to voltage converter. Again, this works great with my particular fan because when no voltage is applied to the black wire, that floats at 6vdc from the fan's ground, it runs at it's slowest speed. So I do not have to worry about kick starting from zero RPM. I just reduce the resistance between the max speed wire and the black wire to increase the speed. The stock switch already statically did that.

For the home made opto-coupler, I just used another IR pair case, removed the divider plastic on the inside along with the additional emitter and detector, lined the inside with a little foil (shiny side showing), capped the business end of the IR/Detector pair, then used heat shrink tubing to keep it all together. Works great!

For detecting the RPM's, I thought I would look at the black wire on my scope to see if I can find revolution transients, and see how consistent they are at all speeds. If the spikes are viable, I can use something like an op amp to amplify the spikes and condition them with a schmitt trigger. then it is a matter of filtering with software for however many transients in a revolution. It doesn't have to be NASA accurate, since I will average samples anyway.

The problem I have now, thinking forward, is the MCU lines needed for the 16 speeds (4). If I use PWM, I can control more fan speeds with a single STM32F103. For my computer case, I have 2 PWM fans, and 4 non-PWM fans. Doable with both methods but I want room for temperature sensors, one per fan, and maybe a few extra for regional space sampling.

Basic Electronics Transistor Question 1 year 2 months ago #18041

  • Jon Chandler
  • Jon Chandler's Avatar
  • Offline
  • Moderator
  • Posts: 365
  • Thanks received: 352
Here's something to try to determine speed. Get an FFT analyzer program for your phone. There are a number of free ones for Android I know, and I assume for iPhones too.

Hold the phone microphone next to the fan blades and take an FTT - this shows frequency vs. amplitude. If you have the option of a log or dB amplitude scale, select that option.

Some simple vibration analysis. Shaft rate is the once/rev speed of the motor, usually measured in Hz (cycles per second). An 1800 rpm motor has a shaft rate of 30 Hz (1800/60). The shaft rate of a fan will not make much audible noise.

The vane rate or blade rate is the number of fan blades (or pump vanes) times the shaft rate. Say the fan has 10 blades, and the shaft rate is 30 Hz. The vane rate will be 10×30 = 300 Hz. The blade rate will be the biggest peak in the audible spectrum.

So count the number of blades. Let's say there are 12 blades. Take a FFT reading and look for the first big peak. There may be harmonics of this peak at equal spacing, but the first big peak should be what we're after. Let's say it's 280 Hz (and there may be harmonics at 560, 840, etc). Divide 280 by the number of blades to determine shaft rate:

280 / 12 = 23.3 Hz

Multiply by 60 to get rpm:

23.3 × 60 = 1400 rpm.
The following user(s) said Thank You: hop

Basic Electronics Transistor Question 1 year 2 months ago #18043

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Wow! That's awesome Jon!! I am going right after that! That is great for testing, but what about on the installed version? There are numerous Microchip PIC DSP's that can handle this I am sure, but what about the algorithm? I am getting ahead of myself here, and I am sure this info is out there for the finding. If you know where I am going with this though....

This is really really cool! I now have four methods to test for the RPM's. I want you to know that I was considering sound as a means, but not as elaborate as you recommended. I was just going to look for tone pitch of the blades.
  • Sound (FFT / Pitch / Harmonics).
  • (THANKS FOR THE MATH!)
  • Hall Effect (tricky because there is no wire for that, have to install one).
  • Broken/interrupted IR beam.
  • Power supply spikes (transients).

Money is a concern here. I want something efficient but financially doable also.

Another item on this project. Considering using a digital SPI potentiometer, like the microchip MCP4131-103E/P for 81 cents USD for the device to control either the fan speed directly or using my home made optocoupler. :)
Last Edit: 1 year 2 months ago by hop. Reason: afterthought

Basic Electronics Transistor Question 1 year 2 months ago #18045

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Unconventional as it may be... I am using my homemade optocoupler with a circuit to convert PWM to voltage. Real simple stuff here, with only needing a 3.9k resistor and a .1uf capacitor (ceramic) to turn the PWM to a voltage for the optocoupler LED. This appears to alter the RPM's of the fan beautifully! I am building it now. More when I finish it. :)

Basic Electronics Transistor Question 1 year 2 months ago #18046

  • Jon Chandler
  • Jon Chandler's Avatar
  • Offline
  • Moderator
  • Posts: 365
  • Thanks received: 352
If it works, it's perfect! :)
The following user(s) said Thank You: hop
  • Page:
  • 1
  • 2
Time to create page: 0.228 seconds