PCB Heaven

General Category => Your projects => Topic started by: kam on June 21, 2009, 17:51:33 PM

Title: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: kam on June 21, 2009, 17:51:33 PM
It was about time. About two years ago, i had start designing the PC box of my dreams. This PC box was supposed to be at first practical. I had many parameters in my mind when designing it. In hurry:

1.  The box should be part of the whole PC furniture
2.  The box had to be big enough to fit at least 2 complete PCs
3.  The keyboard deck should be vandal proof.
4.  The height of the keyboard should be MAX 70cm above ground
5.  The monitor should stand MAX 25cm above the keyboard
6.  There should be a place between those two, that would be an angled plane. That would be the control panel of the box/pcs and not only.
7.  The box should be able to become air tight close (for later peltier cooling project)
8.  The box should be easy to reach
9.  The box should be as close to the control panel as possible, so that USB, DVDs, LEDs, card readers and staff would be fit onto the control panel with no cable extensions...
10. My legs should be able to go all the way back (the overall depth is 95cm) and my knees should not hit anywhere under
11. Any part of the furniture must be able to handle 110 kilos of load, no matter if this part is fixed or moving
12. My legs should rest on a 20cm leg-rest that exists deep under the furniture
13. The box must be well cooled with under-powered silent fans, so that it will be as silent as possible.
14. The overall width of the furniture is 1,35 meters
15. On the monitor deck, bookshelves are standing, thus the monitor deck must handle a hell of heavy load.
16. Nothing is considered to be wireless inside my room. Absolutely nothing. So considerations for all wires (internet, intranet, telephone, power, UPS power, sound etc etc etc etc) must be taken into account

Maybe there was more parameters that i have currently forgotten....

Tens of ideas came from my mind. More than two years i was in the designing room with a 3d modeling software, making and deleting projects. Others was too big, others too small, others had the PC away from the control panel, others had a tiny keyboard place, others had big keyboard place but with no durability... None was perfect enough for my tech lab. Until one day, a lightning struck inside my head giving the boosts in my imagination. Check the 3d models of the tech labs furnitures!

Title: From design to reality
Post by: kam on June 21, 2009, 19:04:28 PM
I could be considered a a lucky bastard, as i am a CNC technician, and daily i visit different woodworking industries. Also, i happen to be good to my work and good in PR ( ;D ;D ;D). Because of the previous facts, i have easy access to woodworking machines, from the simplest band saw, to the finest "edge of technology" so far CNC machine. Therefore, i can release my imagination when designing furniture.

It took me about a week (not daily work of course) to full-fill the whole furniture (all 4 of them including the leg support). I have attached some photos from what we are interested of: The computer furniture!

Title: The main subject of this project is the fan controller
Post by: kam on June 21, 2009, 19:19:22 PM
Hopefully, my efforts and calculations proved to be according to my expectations. The furniture is working perfect, and is ergonomic.

But hey, the subject is the controller, not the furniture

Well, now you've got the point. I need to cool this box. I could have all 4 fans to work at full load but it would be like a truck in my room. I could have them undervoltaged as well. that would work ( at about 800rpm i get about 8 to 8.5 degrees higher temperature) but it would not be "me".

The project that i am currently making is a PIC fan controller. The PIC will have two temperature sensors: one to measure the ambient temperature and one to measure the box temperature. The sensors are implimented by the DS1621 chip that i love and trust.

The controller shall operate into two modes: The manual mode and the automatic mode. In manual mode, the speed of the fans shall be set by hand and shall bekept no matter the temperature. In automatic mode, the speed is changed according to PC box temperature. The speed is divided into 5 steps. Each step corresponds to different rpm of the fans. I could have make 4 different PWM controllers but i preferred to make one and power all the fans from the same mosfet. I expect to have some tens of rpm differencies between the fans, even though all of them are exactly the same.

There will be an rpm measurement taken from each and every fan separately. There will also be a master fan. This fan will be the rpm feedback. All fans are monitored according to the maser fan. They should have rpm within a threshold. Also, none of the fans should have less than the maximum rpm threshold that each speed (1-5) has.

Attached i have an open office spread sheet (converted to excell format). Within this, i have kept measurements of the temperatures (ambient and box) that i get after hours of operation in the same speed (rpm). The results are for further setting of the automatic operation of the box.
Title: The circuit
Post by: kam on June 21, 2009, 19:33:43 PM
The circuit is controlled by a PIC 16F88. The PIC will control the LCD ( 20x4 classic or blue LCD with backlight) via two CD4094 SIPO shift registers. Also, it will control the fans with the built-in PWM controller, via an IRF520 mosfet with heatsink. The temperature is taken from two DS1621 digital temperature sensors. The fans will have their rpm feedback pin connected to four BC328 amplifiers. the signal will be 12V at this point. Following, a CMOS buffer (4049) will make the signal into clear rectangular pulses. Right after, the signal shall be dropped down to 5V using a 4081. A 4017 will select each time only one fan's signal to be driven through a 4066 bi-directional switch. The rpm interface circuit described above will be a separate PCB placed near by the fans. On this board, the mosfet will also be placed. This PCB will be conneted with the main controller with 7 wires (using an 8-pin connector).

A buzzer will be the alarm if a failure occurs.
Title: The menu system and the menu control
Post by: kam on June 21, 2009, 20:00:35 PM
The most interesting, hard and impressive part is the menu system.

it will be controlled by a rotary encoder with momentary pushbutton attached. I found those beauties from an ebay bid for as low as 20cents a piece. I bought all 15 pieces of the bid for 3 euros... You can see one of them in the first picture attached.

The main screen is the one shown in the first attached image. In this screen, the ambient and box temperatures are indicated, as well as the rpms of the 4 fans. Also, the fan gear selected will be indicated (1 to 5) . Below that, there is the mode (Auto of Man for manual). Last, on the bottom left corner, the signal "mute" appears if the user selects the buzzer to be inactive.

To enter the menu system, the user must keep the rotary encoder pressed for about 2 seconds. The first screen appeared is as the second image attached. Then, by rotating the encoder left or right, the user can select the value to change. The values are as follows:

Operation: Auto or manual
Sound: On of Off
Speed 1 D.C.: A value from 0 to 255.
Speed 2 D.C.: A value from 0 to 255.
Speed 3 D.C.: A value from 0 to 255.
Speed 4 D.C.: A value from 0 to 255.
Speed 2 temp: A value from 0 to 255
Speed 3 temp: A value from 0 to 255
Speed 4 temp: A value from 0 to 255
Speed 5 temp: A value from 0 to 255
Startup speed: A value from 1 to 5

The first two values are straight forward. The next set of 4 values indicates the PWM duty cycle for each speed. Zero D.C. is 0 and max (100%) D.C is the value 255
Following set of 4 values indicates the PC box max temperature that each speed works. If for example the temperature inside the box is greater than the value in Speed 3, then the PIC will shift up one speed and will go to 4 etc.

The last value is the startup speed. This is the speed that the fans will operate (if in manual mode was pre-selected) when the circuit starts up or resets due to brown out or other interference.

To change a value, the user will have to select first this value and then click once. Then the LCD will display an image like the attached photo 3.
By rotating the encoder, the value is increased or decreased accordingly. Then, one click will transfer the cursor to the bottom menus (Edit-Discard-Save). The Edit will send the cursor back to edit mode. The Discard will discard any changes and the save will save the ne value of the parameter. With the encoder the appropriate action is selected and confirmed with a click. The LCD is changed back to the previous "parameter selection" menu.

To leave the menu and return into operation screen, the encoder button should be pressed and held for about 2 secs.
Title: A first schematic impression
Post by: kam on June 22, 2009, 18:31:41 PM
That would be just a first schematic for the controller (and just the controller). Right now, this is the way it works, but it could change...
Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: spic0m on June 22, 2009, 19:11:33 PM
Built it quick kam cause i'm also preparing my htpc with LinuxMCE and I WANT IT! :)
Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: kourt on June 22, 2009, 22:09:06 PM
Great   :o
Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: kam on June 22, 2009, 22:12:13 PM
i am waiting a batch of transistors that i run out of (  :-\ ). As a matter of fact, it is working in the pcbh techlabs. Right now, this is the cooling system of the box. I just need to make a nice pcb and hook up all together. Oh, and a nice article for the people.
Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: sysKo on June 25, 2009, 22:16:05 PM

This is my pc front Lian Li TR-5B 5.25" LCD Panel Thermometer and is very good!!!
Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: kam on June 25, 2009, 22:58:29 PM

This is my pc front Lian Li TR-5B 5.25" LCD Panel Thermometer and is very good!!!

perfect! And how many fans can you control/monitor?
Title: Bad news, back to the R&D
Post by: kam on June 26, 2009, 18:22:38 PM
Actually i was kinda expecting to see that happen. My goodies just arrived, and together the 3 beloved transistors came. I hook up all of them to the breadboard, did some soft-work and saw the results. I was rather astonished by the accuracy and the sampling rate of the 4 rpm counters within just one PIC (that does some tens of other jobs as well together), but i was also disappointed from the numbers acquired from the above results. The four fans when are in full power have almost the same rpms, around 1200rpm. But when i pwm them, i get funny results. Differences of up to 300 rpm!!! I planned to have 5 speeds for the fans, 600,800,1000,1100 and 1200 rpm, but with these differences, it is impossible.

The solution:
Another PIC shall be imported to the system. The only work of this pic will be to keep the fans in steady rpm with constant PWM change. A threshold of 20-40 rpm shall be kept of course. Each fan will have it's own mosfet. I will also try a transistor for lowering the cost ( :D ). The PIC shall receive a signal with the speed selection from the main controller (1st PIC) and the only thing to return is the rpm for each fan and an error message when in failure.

As you understand, the above scenario will take out the PIC built in PWM generator as i need 4 independent PWM signals. The new PWM signal will be generated from software according to the rpm readings.

Hopefully this will not delay that much the whole procedure.

An estimation of causes:
it would be rather un-scientific not to try to estimate the causes of this malfunction. How can be that 4 identical fans, that runs in identical rpm when in full speed, have such differences when underpowered. Stupid estimations have been made from time to time from more clever and reliable people than me. Bill Gates for example estimated, during the birth of the XTs, that 640k of memory would be far enough for any software.................. This gives me the right to make an estimation as well. I think that during runtime, dust goes inside the fans. Furthermore, more dust goes inside the push-fans than in the pull-fans. This dust has no observable occurrence when the fans are full powered as they generate enough torque to overcome such little frictions. But when they get so much power, as to revolve in certain rpm (as a result of the reduced torque), the push fans will have bigger friction of the pull-fans and therefore less rpm. And this is actually that i observed. The 2 push fans (in the push-pull arrangement) had significantly less rpm than the pull fans.

Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: kam on July 01, 2009, 19:26:04 PM
More problems...

But that's the idea and the salt of a project.  8)

I tried several ways to have a single PIC to control 4 fans with PWM simultaneously. That precisely sucks. don't try this at home. I could instead use a pic with 4 built in PWMs. Although that could be a solution, it would not be as elegant as i wanted, and it also would be more expensive as expected. A chip like this would cost me more than 10 euro. Also, 16bit code would be used, making things more complicated.

An one hot summer night... Out of the blue... Microchip strikes again with the Microchip MAPS (http://=http://www.microchip.com/maps/microcontroller.aspx)...

Those boys do work!!!

Well, in less than a minute i found the solution. And that is final (hopefully). A bus will be driven from the main PIC, the one that drives the LCD, reads the temps etc. It will still read the rpms. Each fan will have it's own dedicated PIC. Those pics are the 12F615. I found them really cheap and handy. They are as small as a 555 chip(8 pins), they are cheap, they have one built in PWM controller and a built in 4 or 8 oscillator. Those 4 pics shall be connected to the main PIC with the BUS. They will only receive data with a 2 byte protocol such as for example:

xxxxyyyy - dddddddd

And that would mean in out world that the PIC number xxxx (0-16) should do an action yyyy (eg 0001=set speed) with data dddddddd. I can only imagine one command, the "Set speed" command until now. But further on i may enrich it. The speed could be expressed in 10s, so a number 01101110 (110 in decimal) would mean speed 1100 rpm.

Each chip will do nothing more than set a PWM for it's fan so that to maintain this speed. Feedback shall be acquired from the fan so that the PIC will always change the PWM output to maintain this speed. Splendid~!

I am really in find of this idea! I go to work at once

Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: spic0m on July 02, 2009, 20:51:04 PM
I'm more than interested in this, have you calculated an estimated cost of all that stuff? I mean the circuitry not the fans :).
Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: kam on July 02, 2009, 22:16:08 PM
I'm more than interested in this, have you calculated an estimated cost of all that stuff? I mean the circuitry not the fans :).

I would say around 40 euro including the LCD, the connectors and the rotary encoder. The main PIC costs about 4 euro and each other PIC around a euro or so. The LCD is a standard 20x4 with backlit, that you may not find it more than 17 euro.
Title: Re: Automatic 4-fans (120mm) PC-box cooler/regulator + temperature indicator/alarm
Post by: spic0m on July 06, 2009, 19:00:12 PM
Sound good and reasonably priced for what it does. Keep 'em coming.  ;)
Title: Perfect way of measuring RPM with simple 3-wire PWM powered fan!!!!
Post by: kam on August 01, 2009, 20:04:10 PM
PWM on 3-wire fan, NO kicking sound, Perfect and easy RPM feedback!!!

Well, this sounds too good to be true. Again, i look onto the monitor and rub my eyes dry. It just works !!!!!!!!!!!!!!!!

Although my PICs have not arrive yet (thanks to that lazy irrisponsible futurlec that delayed me over a month WITH NO INFORM AT ALL!) i made a single chip-single fan controller with a 16F18 just for educational reasons. While messing around, i discovered a phenomenon that really gave me the shiver!

As known, when powering with PWM a 3-wire fan, what you get on the 3rd rpm feedback wire is the PWM pulses themselves. That is true indeed. The output would look like the first attachment. A mess of pulses that have no begin and no end. Nothing useful.

And here are the good news. I put a resistor between the yellow rpm feedback wire and the +V. Revelation! I found out that, you may actually get the PWM pulses as an output, but the output current is not the same for all pulses! What i mean is that the pulses that arrives when the rpm feedback should be positive, have much more power than the pulses that arrive when the rpm feedback should be zero!

This phenomenon may not apply to all 3-wire fans. I will check some others that i have in my lab but now i cannot think of anything else!

So what i did is i chose a proper epitaxial transistor and with some resistors look what i get. A series of pulses like the second attachment. The green channel (bottom) shows the clean result of the transistor output. While the RPM feedback is zero, i get nothing. While it is HIGH, i get the PWM pulses.

Then, i chose a PWM frequency above the acoustic 20KHz and proper for my calculations. That would be 48KHz. I had to do some fine tuning on the PIC frequency to achieve this frequency. So, now, what i do is to measure how many pulses comes along during a whole positive rpm feedback! Wonderful it is not? :D :D :D :D

And yes it does work. First of all, i do not need to kill my PWM with a capacitor across the mosfet, because i have no kicking sound. Wrong, i DO have a kicking sound but it vibrates at 48KHz, impossible for a human to heat. I first thought of making it vibrating at 4KHz to use it as a mosquito repellent but hey, too much noise in my lab   ;D ;D ;D

I put all the bits and bytes needed in a PIC 16F88 and test it. The results are astonishing. I have a f3-wire fan powered with pure PWM pulses with absolutely NO (acoustic) kicking sound and with rpm feedback ready to be used. I have a register in the pic with a number from 60 to 120, and the PIC will keep the RPM of the fan steady from 600 (for 60) to 1200 (for 120) according to the register's value.

I think that i have solved this problem for good. I will let it run for a week burn-test and hopefully, the project will be a step higher.