1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics UPDATE:Your 2 button fanbus w/ memory

Discussion in 'Modding' started by Hazer, 16 Sep 2003.

  1. Hazer

    Hazer In time,you too will be relixalated

    Joined:
    14 Apr 2003
    Posts:
    957
    Likes Received:
    2
    Updated 1/1/04

    Ive been watching the posts about wanting a fanbus controlled by 2 pushbuttons. So after 2 failures and one success, here is my humble solution:

    2 buttons, one to switch from one fan channel to another, and one to change voltage level from 6V to (almost) full 12V in 8 steps (a step = 0.85V).

    Each fan channel has a blue LED to indicate which fan you are currently controlling, and a 8bar LED bargraph to show voltage level.

    This circuit will produce a top voltage level of 12V - 0.15V. Something Ive been trying to work out for awhile. So you go from 6V to 6.85V to 7.7V to 8.55V etc till you get 11.85V.

    The circuit will store all fanchannels settings in memory. So if power is turned off, the system will remember what each channel was set at from the last time.

    Also, a NC 5V relay is used to give all fans 11.85V supply in case of circuit failure. The relay is shutoff once the system takes control. This way, you can turn your computer off and on without losing your fan settings, and you dont have to worry about something going wrong and all fans being shutoff due to component failure.

    PartA of the circuit:
    [​IMG]

    The way this works is using a voltage division circuit with 3Amp TIP42C PNP power transistor and a general purpose NPN 2N3904 transistor to change from 6V to 11.2V. This is taken from cpemma's transistor fan control guide. :rock: :rock:

    For inputs V2 to V8, you select different resistor combinations to achieve the voltage division neccesary to get your voltage steps. The only drawback of this system is that the 0.7V drop on the NPN transistor (Q2) takes away 0.7V from the motor. In order to get as close to full 12V as possible, Ive added a way to shutoff the voltage divider circuit and apply the base of the TIP42C to ground. Doing this means you only get (I measured this after testing each circuit pattern) 0.15V drop across the Emitter-Collector junction of the TIP42C. V1 input closes the base to ground path, while the inverter opens the connection to R9 (the resistor used to create the voltage division).

    A normally closed 5V relay is used to close the ground connection (bypassing the V1 input) as a way to protect the PC from inactive fans in case of circuit failure. The SL input will have 5V input when the circuit is ready to takeover. A 4PDT relay would be best, spread out between the fan channels.

    Edit: A ULN2803 octal darlington driver is used to pull each resistor to ground.

    Here's PartB:

    [​IMG]

    The V1:V8 inputs are done by an Octal D flip-flop Latch. Each channel will require one latch for controlling voltage division, and one latch for displaying the bargraph. The bargraph could be connected to the Latch that controls the voltage division, but only one LED would be lit at a time. Using diodes would cut too much voltage away. And it would take 32 diodes anyway to try to get the same effect. CS (channel select) is used to enable the latch to latch in the data to control the fan. Using the enables on the latches means you have an 8 bit data path, and 2 lines per fan (one for CS and one for DS Display Select for displaying the LED bargraph).

    PartC:

    [​IMG]

    Using a 28 pin uPIC, you send out your 8 bit data to your latches and CS/DS control lines. The blue LEDs can be directly attached to the output of the CS lines. The current circuits show a 4 fan fanbus, but there are 2 open output pins left to make another. You would need to get a 28pin device that has writable EEPROM, so the voltage settings would be stored in memory. The boot-up part of the code would retrieve the last recorded settings and apply them at power-on. Once voltage levels have been established, the relay is given 5V (to open the switches). The 2 buttons are used for the following:

    Button1: switches from fan to fan.

    Button2: adjusts voltage level of current selected fan.

    Ive tested all of the PartA circuits. It works like a charm. The rest is easy stuff. This requires no use of the often abused 4017, and no need for timing. All of this is handled in the code. If you want to know how to code a uPIC for this circuit, I beleive there is a thread about that hanging around somewhere......... :naughty:

    An alternative would be to use an 18pin uPIC and use a 3:8 demux for the CS/DS lines to reduce input/output lines. This would require that the 18pin device have EEPROM and internal oscilating setting to free up 16 input/output lines.

    It may seem like overdoing it, but I'd like to see an alternative that provided the following:

    Full 12V supply.
    No power circuit protection (fans fully on).
    Proper voltage display.
    All settings stored in memory when no power applied.
    Multiple voltage stepping, no 0V-7V-12V trick.


    PS: I just noticed the CP output. That can be ignored, as I put it in there for using non-latching D flip-flops. I just didn't change the circuit diagram. :duh:

    EDIT: Some mistakes I noticed. The buttons should be tied to ground, and the 1kOhm resistors connected as pull-ups. There should be a 1N4001 in parallel attached to the relay coil for current-switching protection. As I said, I tested PartA to make sure all voltages and currents were OK. My first attempt was to change the base current to alter fan current. The BJTs didnt want to work the way I wanted them too. But I wouldnt post this without having tested to make sure this worked. This circuit works the way its supposed to, upto 300mA load. Theoretically, this should work upto 1 Amp.
     
    Last edited: 1 Jan 2004
    cpemma likes this.
  2. Hazer

    Hazer In time,you too will be relixalated

    Joined:
    14 Apr 2003
    Posts:
    957
    Likes Received:
    2
    PS: It can handle 1 Amp fans easily. Thats what the TIP42C is for. The voltage division using BJT's means that the stepping will work regardless of the fans amperage ratings.

    Another thing that took some time to figure out.
     
  3. NiHiLiST

    NiHiLiST New-born car whore

    Joined:
    18 Aug 2001
    Posts:
    3,987
    Likes Received:
    6
    Wow! That's some nice work Hazer, though the circuit will take a fair bit of skill to assemble. Will you be making one? If so then we expect pics :D
     
  4. splashdream

    splashdream What's a Dremel?

    Joined:
    9 Jul 2003
    Posts:
    62
    Likes Received:
    0
    First, beautiful idea and plan. Good to see someone breaking from the norm for fan speed control.

    Now for the inquiring side of me. You state that this is a 4 channel fan controller but the schematic only shows 1 bargraph and one fan which leads me to think that this is only one of the 4 channels displayed. Is this correct? Or, is ther something I missed? Sorry for the questions but this solution is almost exactly what I was hoping to figure out for my case design.

    splashdream
     
  5. Hazer

    Hazer In time,you too will be relixalated

    Joined:
    14 Apr 2003
    Posts:
    957
    Likes Received:
    2
    PartA and PartB are single channel schematics only. The relay and the inverter in partA can be shared among all 4 channels.

    PartC is the main control.

    This means that the 8 bit data path connects to 2 8 bit latches per channel, so for 4 fans, you need 8 seperate latches all connected together. Only one latch at a time will change states by having its enable line driven, thats what the control lines CS/DS are for. Theres alot of stuff to it, but its not really that bad considering some of the issues I addressed.

    As an afterthought, I considered the idea of using a 4:16 demux to be able to control upto 8 fans using only 4 lines from the uPic for control. This means you can use an 18 pin uPic: 8 outputs for data, 4 outputs for control, 1 output for SL, and 2 inputs for your buttons (17 I/Os). You would need 2 4PDT relays across the 8 fan channels, and an octal/hex inverter package. Total IC count would be:

    1 18 pin uPic with EEPROM and internal osc
    16 octal lacthes
    8 NPN transistor arrays
    1 4:16 demux
    2 relays (PCB)
    24 2N3904
    8 2N3906
    8 TIP42C
    8 Bargraphs
    9 150 or 220 Ohm sips
    88 resistors (whew!)
    8 Blue (or whatever) LEDs
    Odds and ends (decoupling caps, crystal, 2 momentary buttons)

    If anyone caught on, the buttons on PartC are wrong, they need to be tied to ground and the 1kOhm resistors are pull-ups.
     
  6. splashdream

    splashdream What's a Dremel?

    Joined:
    9 Jul 2003
    Posts:
    62
    Likes Received:
    0
    duh...guess I should have paid attention to the connections and what they were for. thanks for the clarification.

    splashdream
     
  7. Hazer

    Hazer In time,you too will be relixalated

    Joined:
    14 Apr 2003
    Posts:
    957
    Likes Received:
    2
    Updated design: :idea:


    Here is the main control with part of the latches to show how this works:
    [​IMG]

    Using a 14pin Pic instead with EEPROM and internal oscilator, can be bought for USD$1.50.

    The input buttons are pulled-up correctly now. Only need a 0.1uF Tantalum cap for decoupling. This design is now 8 channels. The 16F630 is a simple Pic with 12 I/O's, with 2 6bit ports.

    EDIT: The 16F630 has configurable weak-pullups, so there is no need for the pull-up resistors on the buttons.

    RA5 is the SL (safety line) for energizing the relays.

    The 74HC154 is a 4:16 demux with normally high outputs, with the selected output going Low. RC0:3 select which output goes low, thus enabling which latch is to be changed. RC4 is the 74HC enable line. Nothing changes till this bit goes low.

    The 74HC259 is an addressable latch. A0:3 selects which flip-flop is to be changed, the D input is the data to be latched (high or low), and the ~E is the enable-on-low line.

    Using these chips instead (which I found to be cheaper than previous latches) you use the follwing steps in your Pic code:

    1: Select flip-flip via RA0:2
    2: Output data (high or low for that flip flop) via RC5
    3: Select which latch to enable via RC0:3
    4: Enable the 4:16 demux (thus enabling the flip-flop to latch the data) via RC4

    The 74HC family can sink/source upto 25mA, enough to drive both the latch and an LED, so the blue LEDs will light when the Channel latch is active. The latch outputs are the same as before.

    Ive also found some darlington NPN arrays that are much cheaper than the previous ones, ULN2803A.

    RA0:2 is a 3bit bus connected to all of the 74HC259 latches. Also, RC5 is connected to all the D lines of the latches. The 16 Y outputs of the 74HC goes to each individual latch enable line.

    For a quick picture of what this would look like to the user (how the LEDs are arranged), here ya go:
    [​IMG]

    I dont plan on building this anytime soon. I know the BJT part works fine with TTL level inputs. Im going to test the darlington array soon. The demux and addressable latches are in the mail, but I only order a couple of them. I think the total to build the whole thing (minus the PCB and molex connector) turned out to be something like $25.

    Any thoughts?

    EDIT: Just found 2 things I forgot to add. You should use optoisolators to interface the SL line with the relays (include resistors for the opto LED). This way, they wont have to be Normally closed if you use a pull-up resistor with the opto NPN.
    Changed the CA4099 to 74HC259 addressable latch. The 74HC259 can handle 20mA per output, and can drive the LED bargraph on its own.
     
    Last edited: 1 Jan 2004
  8. splashdream

    splashdream What's a Dremel?

    Joined:
    9 Jul 2003
    Posts:
    62
    Likes Received:
    0
    Wow this idea has me thinking...hmmm...what if this fanbus had the following features:

    - Smart temperature based fan speed control were if the temperature of the case get's too high it would automatically step the voltage of the fans on channels 1-4 by 2 voltage levels or the highest voltage until the temp of the case or the CPU fell back to within the normal range at which point it would be set the channels back to the previous manually adjuted speed settings.

    - LCD display instead of LED's displaying the voltages for each channel as there actual voltage or as a Bar Graph.

    - Configurable system temperature alarms for each channel that display on the LCD which channel has the alarm and send an audible alert via either the sound card and a .wav file or via a standard system beep.

    Don't worry I am not asking for these things just decided to share my ideas for other useful or cool functionality that could be possible given the flexibility of PIC micro's. Although they would of course require an alternative to the PIC listed in this design but all possible and not extremely complex other than the idea to use an LCD instead of LED's as it would require an interface between the circuit and the display that would definitely become complicated in a hurry.

    Hazer, thanks for sharing this design with all of us. The only question I have is do you have a shopping list that you would be willing to share with us? I know you have listed most of the parts above within the posts for this project but since you mentioned that the price for the components was around $25 I am assuming that you have a parts list already assembled. I would love to build this project but don't know what the best components to use would be. If you do I will definitely build this soon as the new case project is finally underway and the FanBus is a critical element of it.
     
  9. Hazer

    Hazer In time,you too will be relixalated

    Joined:
    14 Apr 2003
    Posts:
    957
    Likes Received:
    2
    You can find most of the parts at www.futurelec.com.

    In USD:

    PIC16F630 $1.50
    74HC154 $1.45
    16 x CD4099 $0.45 ea
    8 x Blue LED $0.20 ea
    2 x DPDT 5V relay $1.00 ea
    2 x minature momentary pushbutton
    8 x 10kOhm res net sip $0.20 ea
    8 x 1kOhm res net sip $0.20 ea
    32 x square red LED $0.08 ea
    32 x square green LED $0.08 ea
    74HC14 octal inverter $0.25
    82 x resistors $0.10 for 10
    0.1uF Tantulum cap $0.20
    8 x TIP42C $0.50 ea
    16 x 2N3904 NPN $0.10 ea
    8 x 2N3906 PNP $0.10 ea
    9 x ULN2003A darlington NPN array $0.35 ea
    14 pin socket $0.20
    2 x 4N25 optoisolator
    (forgot to add this in. Use this on RA5 output to energize the SL line. You will need a resistor to limit the current for the internal LED, and have a pull-down resistor attached to the high side of the relay coil.)
    Molex connector

    You could either buy $1.00 solder board or have one made (for significantly more). If I get bored, I may do a EaglePCB design.

    Im getting the parts soon to be able to test the functionality of this design. When I do, Ill post results. I dont see anything not working. Ive considered using the DS1809 to replace the resistor network for voltage division, but keep coming back to price. Yes, you could replace this design with the DS1809 for its EEPROM memory, and use a LM3914 for the bargraph display, but those are 2 very expensive parts. The transistor array is only $0.40 at most, with a few penny resistors. Per channel, the PIC and latches are only $0.80 (($1.50 + $1.46 / 8) + $0.45). The DS1809 is a $2.50 part, you would need 8 of them.

    Your suggestions are actually pretty easy. Using this design, you could get rid of the display latches and reduce one I/O. It takes only 7 I/Os for a HD44780 4 bit interface. Then 8+ more for ADC channels. A 40 pin Pic would be best. It could do the voltage sampling for temperature and display actual voltage on each channel. It may be possible to do this on a 28pin Pic, just use 1 pin for the ADC and 3 or 4 pins for switching an analog multiplexor switch. The thing about this design though is that the 8 'steps' have no variance in voltage regardless of current draw.
     
    Last edited: 21 Sep 2003
  10. splashdream

    splashdream What's a Dremel?

    Joined:
    9 Jul 2003
    Posts:
    62
    Likes Received:
    0
    Cool thanks for the parts list.

    Also, glad to hear that the ideas I have are fairly easy and that they aren't too out there from the feasibility standpoint. I think I might just research them a little more.
     
  11. Hazer

    Hazer In time,you too will be relixalated

    Joined:
    14 Apr 2003
    Posts:
    957
    Likes Received:
    2
    Just updated the schematics. Changed a few parts too. The ULN2803A is octal, so its better to use. The 74HC259 can handle more current, and both of these parts are cheaper. 2 good sources are futurlec.com and goldmine-elec.com.

    Well, Ive gone through each step of the design process and wanted to let you guys see how this works. The resistor values got changed. Rd was too low to handle the current draw once the TIP42C was in saturation. Rd was changed to 10kOhms, and the R2 through R8 resistors were also changed. The original design used linear calculations, when I should have been using logarithmic, since Im using BJT transistors and they are inheremntly current amplifiers. The new resistance values are measured to accurately give voltage levels for a 140mA fan.

    Of course, Im not gonna state this will run high current fans without testing them so:

    [​IMG]

    That there is my Delta 1.5AMP test engine :naughty: .

    This is just one channel built on the breadboard. I had to use a spare PC PSU to drive this. With such a high-current fan, the voltage levels did dip a little. Only about 400-500mV. That TIP42C was being driven pretty high, so there would naturally be a higher voltage drop across the Vce junction. Since this circuit can drive anywhere from 100mA fans to 1.5A (or higher) fans with only a minimal variance, I think the design is pretty good. That tiny IC in the top right of the breadboard is the PIC16F630.

    Im already working on design changes to reduce the number of resistors and ICs needed to build a 8 channel solution. It requires the use of simple programmable arrays. I do have a BIG project using the basis from this design to build something that is currently not availble on the market. Its going slowly, but hopefully I can get something out for a possible review before too long (and loss of interest).
     
  12. NiHiLiST

    NiHiLiST New-born car whore

    Joined:
    18 Aug 2001
    Posts:
    3,987
    Likes Received:
    6
    Looking very nice indeed!
     
  13. RR5

    RR5 What's a Dremel?

    Joined:
    7 Dec 2003
    Posts:
    710
    Likes Received:
    0
    I'll say Hazer, keep up the good work. I definately want to see more of this.
     
  14. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    If people are intrested in a non-MCU fanbus, i made a 256-speed one for my first year A-Level project i could post the schematic for, it would chase an RPM, and show the speed on 10 LEDs in 500rpm incriments.

    I like Hazer's power stepping system, makes the power amplification nice n easy!
     
  15. RR5

    RR5 What's a Dremel?

    Joined:
    7 Dec 2003
    Posts:
    710
    Likes Received:
    0
    Start up a new thread in Electronics and post it up. You might end up helping someone.
     
  16. '99

    '99 What's a Dremel?

    Joined:
    5 Jan 2004
    Posts:
    30
    Likes Received:
    0
    Nice projekt :D , any chance that you will release a circuit board? I don't know enough about electronics to make one my self :sigh: . Do you btw. plan on using a LCD display instead of LED's?
     
  17. Hazer

    Hazer In time,you too will be relixalated

    Joined:
    14 Apr 2003
    Posts:
    957
    Likes Received:
    2
    So many projects, so little time and money.........

    To answer your question '99: Ive stopped working on the design for this. I only got the parts to build the test unit a month ago (Futurlec didn't like my ATM card, so I had to mail in a money order...sigh). Anywho, I breadboarded the unit as in the pictures above to make sure I wasnt talking out of my (censored for public consensus).

    The main reason why I stopped from making the whole design as above is that Ive decided this would be better to be tweaked for individual projects. I have a uATX project I will be working on, so I plan to 'custom' make the controller for that. Also, Ive been building my own GAL16V8 programmer to reduce IC count, and a few design changes to reduce resistor count and increase the number of voltage steps.

    I havent worked with PCB software yet, so releasing a layout will not be in the near future. I honestly dont know where Im going from here with this design. Any suggestions?
     
  18. computer

    computer What's a Dremel?

    Joined:
    10 Jan 2004
    Posts:
    205
    Likes Received:
    0
    add LCD support!!! :D
     

Share This Page