EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: McMonster on February 28, 2012, 10:36:46 pm
-
I'm looking for some advice on a project. It is a simple fan controller with 1-wire temperature sensors for my home server machine with some watchdog functionality to power the machine back on after power failure or when it crashes. The main blocks are MCU with 3 V battery backup, serial interface with MAX232 for server OS monitoring and control of the fans, 4 logic-level mosfet fan drivers, a 1-wire bus, motherboard connector and main power from standard ATX power supply connector.
What bothers me is mostly the power supply. Here I've used a Schottky (with lowest Vf I could find) diode-OR circuit for 3 V battery and 5 V line from ATX, but it has some drawbacks, mostly with interfacing to other circuitry that's not powered through the same diode (I only want and need MCU to be backed up) and hence working on a bit higher voltage. I put resistors and let AVR's embedded clamping diodes do the rest in places where it matters (1-wire bus and serial RX signal, TX input high level is well inside MAX232's specs) just to be on the safe side. Will it work as I expect?
Among less important things are resistor values and fan and molex connectors pin orientation, those are always giving me a headache.
PS. Strange electrolytic capacitor symbols are the effect of a bug in KiCAD SVG export function, they look fine everywhere else. There's also OSHW logo that's supposed to be larger and in a different place. Any KiCAD devs here?
PS2. I have two free I/O and one ADC pin left, any interesting ideas for those?
-
http://geoffg.net/fancontroller.html (http://geoffg.net/fancontroller.html)
-
http://geoffg.net/fancontroller.html (http://geoffg.net/fancontroller.html)
Thanks, I wasn't looking for any existing devices like this, I just wanted to design something myself.
-
http://geoffg.net/fancontroller.html (http://geoffg.net/fancontroller.html)
Thanks, I wasn't looking for any existing devices like this, I just wanted to design something myself.
Unless you wish to reinvent the wheel for reinventions sake, couldn't you perhaps find some good ideas from other proven designs?
-
I do electronics for fun and I wanted to design something from scratch for both practise and practical use, so reinventing the wheel is acceptable for me. It's surely overengineered, but if it's likely to work, then I'll be happy with that.
-
Overengineering is the best kind of engineering. Maybe I'm biased, because I made a fan controller, too...
Are you PWMing the fan outputs? Because if you are, and you're switching the ground leg of the fan, the tachometer output will be garbage. But just switching on and off (slowly of course) will work fine, as long as you don't read the tach while it is off. You also may want to add a RC filter to the tach line to kill the noise. 3.3K/1n worked well for that purpose in my testing.
Your battery domain looks fine. A schottky diode drop isn't going to make a difference, but if you're paranoid you could use another diode to feed all the other parts except the fans so that the voltage is equal. Speaking of fan voltage, why not use 12V? Most fans expect 12V, and you'll get better results with a 12V silent fan than by undervolting a faster fan.
-
I don't see any glaring problems.
I wouldn't use PWM for fan speed control but that's just a personal preference.
I'd feel a little better if there was more than just 10uF of bypass capacitance on Vcc.
So far as having issues with Vcc being a diode's drop above MCU_POWER, I'm like you--I don't know if that will be an issue or not. If you're really paranoid about it then you can use an OR-ing controller IC like the LTC4412. It uses MOSFETs instead of diodes so there's practically no difference between the two voltages.
The first attached circuit is a snippet from one of my projects.
You could do something similar. You wouldn't have the power jack or regulator obviously. Your Vcc would then be VREG in my schematic. Your MCU_POWER would be my Vcc. So you'd have something like the second attachment. (I haven't figured out how to put images in-line.)
IC4B and IC5A look like they are backwards but that's how they need to be wired-up since the OR-ing controller IC relies on those parasitic diodes so that it can be powered. IC4A isn't strictly necessary and you may not need it for your application.
Edit: Whoops. Somehow my two attachments got out of order.
-
Overengineering is the best kind of engineering.
Overengineering can hardly be considered engineering at all! perhaps you meant Overdesigning.
-
Thank you for suggestions. It was my error, that should be 12 V for fans. This OR-ing IC looks nice, but it's 6$, so I'll keep the diodes.
-
Thank you for suggestions. It was my error, that should be 12 V for fans. This OR-ing IC looks nice, but it's 6$, so I'll keep the diodes.
You should be able to get it cheaper but I'm sure you'll be fine as-is.
-
Overengineering is the best kind of engineering.
Overengineering can hardly be considered engineering at all! perhaps you meant Overdesigning.
I just had to start with something to get some practice. I won't learn much by looking at other people's designs without trying to do my own.
-
I just had to start with something to get some practice. I won't learn much by looking at other people's designs without trying to do my own.
You'll learn even less by ignoring the work, both good and bad of others and devoting your time to reinvention.
-
I just had to start with something to get some practice. I won't learn much by looking at other people's designs without trying to do my own.
You'll learn even less by ignoring the work, both good and bad of others and devoting your time to reinvention.
People "reinvent" (a truly misused term) things to feel better about themselves. It helps them feel productive. It helps them apply what they have learned.
99.99% of what anyone will ever do has already been done by someone else. If a person were to take your advice then they would produce nothing.
Never, never, never tell a so-called peer that what they are doing isn't worth doing simply because it has already been done. You ALWAYS encourage your peers.
Always.
-
People "reinvent" (a truly misused term) things to feel better about themselves. It helps them feel productive.
So it achieves nothing of consequence.
It helps them apply what they have learned.
Applied ignorance! There's a good one. Have you considered politics? There is always a vacancy there for that kind of skill set.
99.99% of what anyone will ever do has already been done by someone else.
Makes it kinda dumb to be doing it the hard way then, doesn't it?
If a person were to take your advice then they would produce nothing.
On the contrary, the survivors of our species were those who learned from the success and failures of others and adapted accordingly. By your way of thinking every man should have a lion chase him just so they can determine for themselves that they may get eaten.
Never, never, never tell a so-called peer that what they are doing isn't worth doing simply because it has already been done.
I never never told anyone anything of the sort! Since your slow on the uptake what I suggested was that it would be advantageous to consider the merits of of how others have approached similar problems.
You ALWAYS encourage your peers.
Quite right. And about now I am encouraging you to pull your head in and stop demanding how I or anyone else should conduct themselves. If you are too stupid to comprehend the difference between suggestion, opinion and demand then you are unlikely to gain much from any sensible conversation.
PS: If you must invent your own wheel, round would be a shape worthy of consideration.
-
Uncle Vernon, sorry if I came across as a crank. If you truly thought you were being helpful then I suppose I just misunderstood. I have a big pet peeve about people who actively discourage others.
If you feel there is something wrong with the OP's schematic then, by all means, share it with us. I'm sure the OP would love to get all the advice he can before he actually builds his project.
-
One other thing, since those motors are inductive loads, don't forget to put flyback diodes across the terminals leading to your fan motors. (Terminals 1 & 2 of connectors K1, K2, K3 & K4.)
-
I'd question the wisdom of having a server health monitor being monitored by the server whose health is being monitored. It should be completely independent. Why not add an ethernet port to it?
-
@Uncle Vernon
You're right that I should check existing work on this topic and I didn't look for existing MCU fan controllers with temperature feedback as a whole device and I thank you for suggestions. I did learned something in the process though, like dealing with MOSFETs, power dissipation, motor PWM control and a bunch of different topics, so this wasn't reinventing just for reinvention's sake.
I'd question the wisdom of having a server health monitor being monitored by the server whose health is being monitored. It should be completely independent. Why not add an ethernet port to it?
This device can in fact work independently, it has its own power source (since fans, serial and temp sensors only need to operate with a powered PC there's no point not to power them from the same source and have just the MCU on backup) and own logic for fan control. I can use serial port for the bootloader, tweaking some parameters (like implementing a PID in AVR and remotely changing it's parameters) if I want and it was simple to add it to the circuit. What I need from the PC side for watchdog functionality is just some way to indicate normal operation like a simple message to MCU and predefined intervals. When the PC fails to report on time, then reset it. Or I could even write some more advanced algorithm using current server load information or anything else an AVR could handle.
-
Personally I dislike any new electronic device designed today which uses an RS232 serial interface, unless it's specifically intended to interface to an existing old legacy hardware over an RS232 interface.
For a basic interface to a PC I would strongly recommend using a USB interface, even if you're using an FT232 (or similar) USB virtual UART bridge chip (you don't have to change the whole microcontroller system to a different microcontroller with USB onboard).
Even if your computer still has an RS232 port, using USB means that you can reproduce the same system for use on any other computer, or anybody else you give the design to can use it on their computers, without headaches on most computers that don't have RS232.
Dallas OneWire temperature sensors (eg. DS18B20 or similar) are relatively expensive for a temperature sensor, they're approx. several dollars each usually. Unless you specifically need to have a multi-drop OneWire bus using multiple sensors bussed together with just a couple of wires I would recommend considering changing the temperature sensors to a "dumber" sensor device as this will mean significant reductions in BOM cost.
I'm pretty sure (from vague memory) that there are some chips on the market (from Microchip for example) that are specifically designed for control and health monitoring of small DC brushless fans such as computer fans, they can automatically generate an interrupt output if the fan fails and they can do speed control without sacrificing speed monitoring, stuff like that IIRC.
-
Personally I dislike any new electronic device designed today which uses an RS232 serial interface, unless it's specifically intended to interface to an existing old legacy hardware over an RS232 interface.
For a basic interface to a PC I would strongly recommend using a USB interface, even if you're using an FT232 (or similar) USB virtual UART bridge chip (you don't have to change the whole microcontroller system to a different microcontroller with USB onboard).
Even if your computer still has an RS232 port, using USB means that you can reproduce the same system for use on any other computer, or anybody else you give the design to can use it on their computers, without headaches on most computers that don't have RS232.
This device is designed with a particular machine (or with particular segment of older PCs) in mind, that's why I used MAX232. FT232 is relatively expensive.
Dallas OneWire temperature sensors (eg. DS18B20 or similar) are relatively expensive for a temperature sensor, they're approx. several dollars each usually. Unless you specifically need to have a multi-drop OneWire bus using multiple sensors bussed together with just a couple of wires I would recommend considering changing the temperature sensors to a "dumber" sensor device as this will mean significant reductions in BOM cost.
It's just 1.45$ for DS18B20 comparing to 1.16$ for LM35DZ in a local shop. But I originally used 1-wire sensors because I was short on free pins in early versions of this design, so replacing them will save me some flash and headache with matching a particular DS with a particular fan and that's what I'll do.
I'm pretty sure (from vague memory) that there are some chips on the market (from Microchip for example) that are specifically designed for control and health monitoring of small DC brushless fans such as computer fans, they can automatically generate an interrupt output if the fan fails and they can do speed control without sacrificing speed monitoring, stuff like that IIRC.
Such chips are usually not possible to get from local distributors and bigger ones, like Farnell don't really support hobbyists, they have a minimum order of 100$ for individuals here. Not to mention that the shipping rates to Poland can throw you off your chair.
-
Dear McMonster and Terminaljack505:
To McMonster:
--I found your post interesting and enlightening. I understand exactly what you are doing, in trying to design your own custom fan controller. If you design it yourself, it will work exactly as you want, and you will not have to conform your wishes to the features of a purchased device. This kind of determination, is part and parcel of Engineering I am sorry that you were discouraged and called stupid. Dave keeps trying to get more beginners to join, and, mores the pity, a couple of our members keep trying to get them to go away. I completely understood what you meant by "over-engineered", it is not like no one ever heard it before. It is a very common phrase. If everyone took some of the advice you were given, no child would ever build his own radio, or anything else.
** rest of inflammatory post deleted by moderator **
"He was born ignorant, and has been losing ground ever since."
Fred Allen 1894 1956
Best Regards
Clear Ether
-
One of the main limitations of every variable speed "smart" fan I have seen is that they work after the fact - they react to the components heating up. I have a design for one that uses a predictive approach - it senses the power usage of the system and would rev up in advance when it detects an increase in power. My design happens to have a power measurement shunt for other purposes, but an accurate sensor is not necessary for good feedforward - sensing the DC voltage drop across a power supply inductor or piece of wire works well enough.
I'm doing this because Intel's Turbo Boost (automatic overclocking) partly relies on the CPU being cool to stay in boost. A traditional feedback control would have a thermal delay, but sensing the power for doing predictive control is almost instantaneous. And that can add up to more time in boost and greater perceived performance. (Yes, I'm overengineering it since I could just run the fan at full speed all the time, but smart fans are standard nowadays and I would like to demonstrate one done right.)
-
One of the main limitations of every variable speed "smart" fan I have seen is that they work after the fact - they react to the components heating up. I have a design for one that uses a predictive approach - it senses the power usage of the system and would rev up in advance when it detects an increase in power. My design happens to have a power measurement shunt for other purposes, but an accurate sensor is not necessary for good feedforward - sensing the DC voltage drop across a power supply inductor or piece of wire works well enough.
Interesting approach, haven't though of that. My general idea was to use a PID or other kind of advanced algorithm. I'll have to poke around with a multimeter and some shunt resistors (got some 5 W 0.1 Ohm for that) to see what contributes the most to power usage and how the power usage patterns look like in "production" conditions. Still got one ADC pin left and haven't started laying out the PCB so I might just put an opamp and a connector for shunt resistor and be able just to play around in software to get the best results. I don't expect sudden changes in CPU load with this machine though, but thank you for the idea.
-
If you want to sense the return current ( and are not too worried about accuracy or linearity) use a voltage divider of say 1k and 100R to sense the drop across the one ground lead to the PSU from the CPU power connector. Connect the bottom end of the resistor to the negative lead near the PSU, and read the common connection of the resistors. Use the end nearest the CPU to connect the monitor to the PC power rail. Will be a low voltage that drops as current increases, but is cheap and needs little in firmware. Will probably need calibration for each board if production unit, but you can just use power up value and go from there. Will be noisy, and the range will be only a few dozen counts from zero to full power draw, but cheap and quick, with minimal modification to the motherboard, other than needing to have a connection to both ends of one wire from the PSU.
-
You can apply a low pass filter (1Hz or less cutoff) to make the noise nearly zero. The fan cannot rev up or down that quickly so any faster is a waste unless you have another use for it. My design would be sampling at 15Hz or so (actually faster to use oversampling) since the real time power display needs 15 FPS or so to look realtime.