Announcement

Collapse
No announcement yet.

I need to make a fan controller.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #21
    Re: I need to make a fan controller.

    I accidentally found the website where I got my initial ideas for a fan controller!

    Lots of good circuits with good explanations and ready made stripboard designs.
    http://www.pcsilencioso.com/cpemma/index.html

    EDIT: A quick google search led me to find that someone has created basically the same circuit as what I am describing (except without the indicator LED's).
    http://www.instructables.com/id/Use-...-control-moto/

    Just replace the battery pack with the 12V rail from the power supply. There is no need for the small capacitor they describe as PC fans are brushless. They only show a breadboard design, so a more permanent solution would need to be created (stripboard, PCB etc.) It includes a small explanation of the circuit and a simple test program for the Arduino microcontroller (only two lines of code). Adding the potentiometer and adjusting the PWM value based on it would only add a few more lines of code.
    Last edited by shadow; 02-04-2012, 10:03 PM.

    Comment


      #22
      Re: I need to make a fan controller.

      Originally posted by shadow View Post
      I tried to find the schematic for the fan controller I designed. Unfortunately I could not find it. I only have the board design. I have tested the design on a breadboard in the past and it worked brilliantly. However I would suggest you test out the circuit on a breadboard first.

      The part list is shown below. Keep in mind that I chose the components I did to minimise cost (around where I live). Some of them are incredibly over specified, however they are commonly available here for next to nothing. Getting a smaller or more appropriately sized component would have cost me a lot more. The best example of this is the Darlington transistor I chose. It is rated for up to 5A of power output. However a single fan only outputs 0.34A. Just a little overspeced. I am also assuming you want to control the speed of 5 fans with a single potentiometer.

      5x TIP120 - NPN Darlington Transistor
      5x 1kΩ resistors
      5x 1N5817 - Schottky Diode
      1x Potentiometer
      5x LED's
      5x 560Ω resistors

      The last two components are optional. They are simply indicator LED's (along with a current limiting resistor) so you can visually see which fan is being powered. You may need to adjust the resistor value for the LED to match the LED's which you are using.

      You may also wish to add a couple of capacitors to filter the voltage from the power supply a bit. I think this is optional as the power from the power supply should be pretty clean.

      With regards to a microcontroller. Since you are an amateur, I would highly recommend an Arduino microcontroller (or a clone). These are programmed with just a USB cable (they come with a bootloader preloaded on the microcontroller), no need for any special programmers or devices.

      Something like this is a good start:
      http://arduino.cc/en/Main/ArduinoBoardUno

      I think it would be pretty cool to design the circuit on an Arduino 'shield'. A shield is something like a daughter board which sits on top of the microcontroller. The daughter board connects all the pins from the controller to the daughter board and you can solder up a circuit in the middle and use those pins. You can solder up a circuit any way you wish, more complex designs will not fit on such a small shield, perhaps you can think about using stripboard (like my original idea) or create your own PCB.
      http://arduino.cc/en/Main/ArduinoProtoShield

      I have to create a schematic for you from scratch (I only have a stripboard design which is for a much more sophisticated fan controller than what you are after). The reason why I didn't post anything yet is because I am scared that when I draw up a circuit, I will have the diode or the LED polarity wrong which would cause the circuit to not function at all. I would like to test out the circuit again on a breadboard before I am comfortable releasing a schematic.
      Well I like the idea, but I went shopping for the arduino it's nearly $25-30 for it. it would be fine if it was reusable as in programming other stuff but since it's going to be stuck on the fan controller for the rest of it's life, it's kind of hard to justify, especially if something were to happen to it.

      Not saying I'm cheap, just looking at it from an investment perspective.

      As for the rest it looks fine except I don't need LEDs since this thing is going to be stash away in the case. The other thing I question is, do the transistors need a heatsink? if so I don't think it's going to fit on a arduino shield 2"x2"

      Originally posted by shadow View Post
      I accidentally found the website where I got my initial ideas for a fan controller!

      Lots of good circuits with good explanations and ready made stripboard designs.
      http://www.pcsilencioso.com/cpemma/index.html

      EDIT: A quick google search led me to find that someone has created basically the same circuit as what I am describing (except without the indicator LED's).
      http://www.instructables.com/id/Use-...-control-moto/

      Just replace the battery pack with the 12V rail from the power supply. There is no need for the small capacitor they describe as PC fans are brushless. They only show a breadboard design, so a more permanent solution would need to be created (stripboard, PCB etc.) It includes a small explanation of the circuit and a simple test program for the Arduino microcontroller (only two lines of code). Adding the potentiometer and adjusting the PWM value based on it would only add a few more lines of code.
      How is this being powered it looks like the usb cable is powering the arduino and bat pack is powering the fan. The transistor is pulsing the supply via the arduino.


      What if I don't want to do arduino but an actual MCU programmed with C?

      What would I need then?

      Comment


        #23
        Re: I need to make a fan controller.

        Originally posted by Mad_Professor View Post
        Well I like the idea, but I went shopping for the arduino it's nearly $25-30 for it. it would be fine if it was reusable as in programming other stuff but since it's going to be stuck on the fan controller for the rest of it's life, it's kind of hard to justify, especially if something were to happen to it.

        Not saying I'm cheap, just looking at it from an investment perspective.
        The primary reason why I recommend Arduino is because it is very common and they come preloaded with a bootloader. Therefore you can program it with a regular USB cable and there is no need for any special programming cable.

        The Arduino hardware is completely open source (on the Creative Commons license), therefore clones are legal. Try Ebay (or other sources) for getting an Arduino clone. Most will ship from China or Hong Kong. Around 1.5 years ago I ended up getting an Arduino Mega clone, a breadboard, a bunch of jumper wires, a monochrome LCD, a bunch of LED's for about AU$40 for the lot coming from Hong Kong.

        You can try getting an Arduino in a different form factor or a smaller package such as the Arduino Nano. It is probably better for your uses as it is smaller and can be soldered directly onto stripboard.

        Another option is to use a different development board. I recommend checking out:
        http://www.sparkfun.com
        From there you can choose your preferred development board. A simple 8-bit microcontroller is more than enough for your uses. The most commonly used microcontrollers are normally PIC based ones or AVR based ones. The main issue with these development boards is that normally can not be programmed directly from the serial port or USB port, they would require you to either make or purchase a programming cable. Normally you can 'burn' a bootloader onto the microcontroller which will allow it to be programmed via. serial port or USB port.

        Another option is to create the circuit yourself from scratch. All of these development boards are open source with full schematics and part lists available. You can solder one up yourself without issues. However you will need to source all of the individual parts which are required and you still require a special programming cable.

        Originally posted by Mad_Professor View Post
        As for the rest it looks fine except I don't need LEDs since this thing is going to be stash away in the case. The other thing I question is, do the transistors need a heatsink? if so I don't think it's going to fit on a arduino shield 2"x2"
        The transistors will not need a heatsink. If you start pulling serious current from them, then you will need to have heatsinks. The TIP120 is designed to handle 60V at 5A, using it to switch a 12V source which draws 0.34A should not even make it warm. Even vastly lower speced transistors should not require heatsinks for this purpose.

        Originally posted by Mad_Professor View Post
        How is this being powered it looks like the usb cable is powering the arduino and bat pack is powering the fan. The transistor is pulsing the supply via the arduino.
        This is correct, in that example, the Arduino is powered via. the USB cable. The Arduino board can be powered either by USB or via. a DC Jack. The power on the board is regulated so it will work with any DC voltage input between 5V and around 12V. For your case, hook up the 5V line from the power supply to the DC Jack to power it.

        Originally posted by Mad_Professor View Post
        What if I don't want to do arduino but an actual MCU programmed with C?

        What would I need then?
        See what I wrote above.

        Just to clarify, the Arduino board is an actual MCU that can be programmed in proper C. Instead of using the Arduino IDE (which uses a higher level C like language) to program the board, use AVR Studio. AVR Studio is the programming software developed by Atmel for AVR microcontrollers (which the Arduino development boards so happen to use).

        Comment


          #24
          Re: I need to make a fan controller.

          Originally posted by Mad_Professor View Post
          Well I like the idea, but I went shopping for the arduino it's nearly $25-30 for it. it would be fine if it was reusable as in programming other stuff but since it's going to be stuck on the fan controller for the rest of it's life, it's kind of hard to justify, especially if something were to happen to it.

          Not saying I'm cheap, just looking at it from an investment perspective.
          If you want a cheap fan controller, use the one I posted or one similar. Using a full Arduino would be a waste.

          If you want to learn MCU programming, get an Arduino or other such device and use that separately for whatever you want.
          "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
          -David VanHorn

          Comment


            #25
            Re: I need to make a fan controller.

            Originally posted by shadow View Post
            The primary reason why I recommend Arduino is because it is very common and they come preloaded with a bootloader. Therefore you can program it with a regular USB cable and there is no need for any special programming cable.

            The Arduino hardware is completely open source (on the Creative Commons license), therefore clones are legal. Try Ebay (or other sources) for getting an Arduino clone. Most will ship from China or Hong Kong. Around 1.5 years ago I ended up getting an Arduino Mega clone, a breadboard, a bunch of jumper wires, a monochrome LCD, a bunch of LED's for about AU$40 for the lot coming from Hong Kong.

            You can try getting an Arduino in a different form factor or a smaller package such as the Arduino Nano. It is probably better for your uses as it is smaller and can be soldered directly onto stripboard.

            Another option is to use a different development board. I recommend checking out:
            http://www.sparkfun.com
            From there you can choose your preferred development board. A simple 8-bit microcontroller is more than enough for your uses. The most commonly used microcontrollers are normally PIC based ones or AVR based ones. The main issue with these development boards is that normally can not be programmed directly from the serial port or USB port, they would require you to either make or purchase a programming cable. Normally you can 'burn' a bootloader onto the microcontroller which will allow it to be programmed via. serial port or USB port.

            Another option is to create the circuit yourself from scratch. All of these development boards are open source with full schematics and part lists available. You can solder one up yourself without issues. However you will need to source all of the individual parts which are required and you still require a special programming cable.



            The transistors will not need a heatsink. If you start pulling serious current from them, then you will need to have heatsinks. The TIP120 is designed to handle 60V at 5A, using it to switch a 12V source which draws 0.34A should not even make it warm. Even vastly lower speced transistors should not require heatsinks for this purpose.



            This is correct, in that example, the Arduino is powered via. the USB cable. The Arduino board can be powered either by USB or via. a DC Jack. The power on the board is regulated so it will work with any DC voltage input between 5V and around 12V. For your case, hook up the 5V line from the power supply to the DC Jack to power it.



            See what I wrote above.

            Just to clarify, the Arduino board is an actual MCU that can be programmed in proper C. Instead of using the Arduino IDE (which uses a higher level C like language) to program the board, use AVR Studio. AVR Studio is the programming software developed by Atmel for AVR microcontrollers (which the Arduino development boards so happen to use).

            If I program the arduino ATmega 168 will it remain or will it clear out like a cmos when the battery is pulled?

            I was sitting here thinking and it came to me from reading this

            http://www.instructables.com/id/Build-Your-Own-Arduino/

            it sounds like I can just program the chip.

            if I program the arduino on the breadboard using USB FTDI TTL-232 cable and then just move the ATmega 168 chip onto a protoboard using a sip/IC socket use the 5V for the ATmega 168 and 12 for the circuit.

            Removing useless components like USB and DC jacks.

            would it work? or am I wrong?

            I wouldn't mine spending the $20 to build something like this. I'll probably use it again for something else.
            Last edited by Mad_Professor; 02-05-2012, 07:19 PM.

            Comment


              #26
              Re: I need to make a fan controller.

              I think I'll build the arduino.

              I'll build it on a breadboard, Use a parallel port programmer using an old db25 cable to upload the bootloader to the chip. Proceed to build the fan controller that will use the molex 5v/12 of the computer powersupply as power source, 5v for the atmega168 and 12v for pwm circuit.

              Then program via arduino.

              If successful then to stripboard.

              The only thing I haven't been able to solve is how to protect the thing from shorting on the case. I don't really have a place to mount it unless it hangs freely *dangerous* or I have it clamp or doublestick tape to the HDD rack or bottom of the case.

              One idea is to mount PCB to plexiglass via screw studs like the ones you find in computer cases then drill holes in the plexi and use strip ties to whatever. that will work if this thing is not too large that is.

              Comment


                #27
                Re: I need to make a fan controller.

                An Arduino is just an ATMega168 or similar, with extra support components and fancy stuff on a PCB.

                All you really need is the AVR itself, its crystal oscillator and loading capacitors (and if your code is non-critical, not even that, just use the internal oscillator), and a decent (filtered) power supply.

                And of course their bootloader so you can use their style of code.

                Everything else is optional depending on what you're doing.
                "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
                -David VanHorn

                Comment


                  #28
                  Re: I need to make a fan controller.

                  Originally posted by Mad_Professor View Post
                  If I program the arduino ATmega 168 will it remain or will it clear out like a cmos when the battery is pulled?

                  I was sitting here thinking and it came to me from reading this

                  http://www.instructables.com/id/Build-Your-Own-Arduino/

                  it sounds like I can just program the chip.

                  if I program the arduino on the breadboard using USB FTDI TTL-232 cable and then just move the ATmega 168 chip onto a protoboard using a sip/IC socket use the 5V for the ATmega 168 and 12 for the circuit.

                  Removing useless components like USB and DC jacks.

                  would it work? or am I wrong?

                  I wouldn't mine spending the $20 to build something like this. I'll probably use it again for something else.
                  Pretty much every microcontroller now will store its program in flash memory. Flash memory is persistent (just like your memory cards, USB Sticks, SSD's etc.) From memory, FPGA's do not behave in this way, however they are not microcontrollers either.

                  To clarify what you said, yes what you are saying will work. However you can not just program the microcontroller that does not the bootloader present with the USB FTDI TTL-232 device. For this to work, you will need to 'burn' the bootloader onto the chip using the ICSP port using the Parallel Cable Programmer, USBtinyISP or similar device. Since you want to save some money and save on the number of components. I would scrap this idea and don't bother with the bootloader and programming via. USB and program the whole microcontroller using the ICSP port.

                  Originally posted by Mad_Professor View Post
                  I think I'll build the arduino.

                  I'll build it on a breadboard, Use a parallel port programmer using an old db25 cable to upload the bootloader to the chip. Proceed to build the fan controller that will use the molex 5v/12 of the computer powersupply as power source, 5v for the atmega168 and 12v for pwm circuit.

                  Then program via arduino.

                  If successful then to stripboard.
                  This sounds like a good plan. However what I would do is not bother with uploading the bootloader to the microcontroller and just use the Parallel Port Programmer or another (easier to use) programmer the whole time and use it to upload the program to the microcontroller. This way, you save on useless components to you and there is no need for you to purchase a USB to TTL Serial device. Check out this article: http://www.tuki-tam.net/blog/?p=140

                  Another nice thing about this approach is you can still program the microcontroller while it's on your stripboard design (just make sure you solder up the ICSP connector on the stripboard design).

                  Originally posted by Agent24
                  An Arduino is just an ATMega168 or similar, with extra support components and fancy stuff on a PCB.

                  All you really need is the AVR itself, its crystal oscillator and loading capacitors (and if your code is non-critical, not even that, just use the internal oscillator), and a decent (filtered) power supply.

                  And of course their bootloader so you can use their style of code.

                  Everything else is optional depending on what you're doing.
                  This is absolutely correct. An Arduino is just an AVR microcontroller with nice supplementary circuitry and a standard hardware design that can facilitate 'shields'.

                  Some of the nice supplementary circuitry include:
                  * Voltage regulated supply - Can use any DC power source between 5V and 12V.
                  * Bootloader (normally preprogrammed) - To facilitate programming without special cables or devices via the microcontrollers Serial Port.
                  * USB to TTL Serial on board - Not many PC's now have Serial Ports, so a USB to Serial converter is included onboard. With the bootloader, the microcontroller can be programmed via. USB.
                  * RC Circuit on the Reset Line - The bootloader is a special small program which is run in the first few seconds when the microcontroller is turned on. On older Arduino designs, the end user had to manually restart the microcontroller (using the reset button) before they were able to program it through the USB Port. More modern Arduino designs now have a RC Circuit present on the Reset Line of the microcontroller so the compiler on the PC can automatically restart the microcontroller before programming the microcontroller.

                  There are probably a few more nice things.

                  Just to clarify again, the bootloader is only there to facilitate programming the microcontroller via. Serial or USB Port. This is nice as a simple, off the shelf cable can be used to program the device. No need for special cables or devices. It does not do anything else at all. It is not required to make use of the Arduino style language.
                  Last edited by shadow; 02-06-2012, 04:25 PM.

                  Comment


                    #29
                    Re: I need to make a fan controller.

                    Originally posted by shadow View Post
                    Just to clarify again, the bootloader is only there to facilitate programming the microcontroller via. Serial or USB Port. This is nice as a simple, off the shelf cable can be used to program the device. No need for special cables or devices. It does not do anything else at all. It is not required to make use of the Arduino style language.
                    Whoops, for some reason I thought the boot-loader also did some kind of code translation. Now that I think about it, that would be insane.
                    "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
                    -David VanHorn

                    Comment


                      #30
                      Re: I need to make a fan controller.

                      Originally posted by Agent24 View Post
                      An Arduino is just an ATMega168 or similar, with extra support components and fancy stuff on a PCB.

                      All you really need is the AVR itself, its crystal oscillator and loading capacitors (and if your code is non-critical, not even that, just use the internal oscillator), and a decent (filtered) power supply.

                      And of course their bootloader so you can use their style of code.

                      Everything else is optional depending on what you're doing.
                      If the AVR comes with it's own oscillator then why does it need an external crystal and capacitors? Would it still work without these components or would I need to give the chip special instructions?

                      How would you provide power to this chip if the power was coming from a computer power supply?

                      Originally posted by shadow View Post
                      Pretty much every microcontroller now will store its program in flash memory. Flash memory is persistent (just like your memory cards, USB Sticks, SSD's etc.) From memory, FPGA's do not behave in this way, however they are not microcontrollers either.

                      To clarify what you said, yes what you are saying will work. However you can not just program the microcontroller that does not the bootloader present with the USB FTDI TTL-232 device. For this to work, you will need to 'burn' the bootloader onto the chip using the ICSP port using the Parallel Cable Programmer, USBtinyISP or similar device. Since you want to save some money and save on the number of components. I would scrap this idea and don't bother with the bootloader and programming via. USB and program the whole microcontroller using the ICSP port.



                      This sounds like a good plan. However what I would do is not bother with uploading the bootloader to the microcontroller and just use the Parallel Port Programmer or another (easier to use) programmer the whole time and use it to upload the program to the microcontroller. This way, you save on useless components to you and there is no need for you to purchase a USB to TTL Serial device. Check out this article: http://www.tuki-tam.net/blog/?p=140

                      Another nice thing about this approach is you can still program the microcontroller while it's on your stripboard design (just make sure you solder up the ICSP connector on the stripboard design).



                      This is absolutely correct. An Arduino is just an AVR microcontroller with nice supplementary circuitry and a standard hardware design that can facilitate 'shields'.

                      Some of the nice supplementary circuitry include:
                      * Voltage regulated supply - Can use any DC power source between 5V and 12V.
                      * Bootloader (normally preprogrammed) - To facilitate programming without special cables or devices via the microcontrollers Serial Port.
                      * USB to TTL Serial on board - Not many PC's now have Serial Ports, so a USB to Serial converter is included onboard. With the bootloader, the microcontroller can be programmed via. USB.
                      * RC Circuit on the Reset Line - The bootloader is a special small program which is run in the first few seconds when the microcontroller is turned on. On older Arduino designs, the end user had to manually restart the microcontroller (using the reset button) before they were able to program it through the USB Port. More modern Arduino designs now have a RC Circuit present on the Reset Line of the microcontroller so the compiler on the PC can automatically restart the microcontroller before programming the microcontroller.

                      There are probably a few more nice things.

                      Just to clarify again, the bootloader is only there to facilitate programming the microcontroller via. Serial or USB Port. This is nice as a simple, off the shelf cable can be used to program the device. No need for special cables or devices. It does not do anything else at all. It is not required to make use of the Arduino style language.
                      The more I was reading into it, the more it sounded like I didn't need the USB/serial interface. Saved me $20.


                      I think I'm ready to build something.

                      but since I'm not an EE and I'm just a basic guy with basic knowledge, I'll need some help in design and parts.


                      This is what I'm thinking. excuse me if this is too simple.

                      Molex:
                      12v to fans via 3pin headers.
                      gnd to transistor collector.
                      5v and gnd to atmega chip.
                      1k ohm resistors from transistor base to PWM out of atmega chip.
                      diodes from collector to emitter then wire from emitter to ground of fans.

                      as for the chip, do I need the crystal and it's loading capacitor?

                      Do I need to filter the power from Computer's PSU to the chip?

                      What size strip board do I need?

                      What other components do I need?

                      and shadow what are the 560 ohm resistors for?

                      Comment


                        #31
                        Re: I need to make a fan controller.

                        Originally posted by Mad_Professor View Post
                        If the AVR comes with it's own oscillator then why does it need an external crystal and capacitors? Would it still work without these components or would I need to give the chip special instructions?
                        I had to look up the answer to this in the microcontrollers datasheet. Basically the microcontroller will work without a crystal and its loading capacitors. However there are several implications:

                        * The ATMega168 microcontroller can run at up to 20MHz, however the internal oscillator has a maximum frequency of 8MHz. Therefore you are limited to a maximum speed of 8MHz.
                        * The internal oscillator is not particularly accurate and varies with temperature and voltage.
                        * Using the internal oscillator (particularly with slower speeds) does save energy for very low power applications.

                        In short, it is possible to use and run the microcontroller without these components, however you will be limiting the speed of the microcontroller to less than half its maximum speed. The ATMega168 in its default configuration is configured to use its internal oscillator at 1MHz. Using the in-circuit programmer (parallel programmer, USBtinyISP etc.), you are able to change the 'fuse' settings on the microcontroller. One can think of a fuse on these microcontrollers as a software programmable DIP switch. There are many of these fuses which determine what kind of oscillator you will use, its frequency etc. You can check out: http://electrons.psychogenic.com/mod...HOWTOGuide.php

                        Originally posted by Mad_Professor View Post
                        How would you provide power to this chip if the power was coming from a computer power supply?
                        I'm not too sure what you mean by this. What chip are you talking about? If it is the microcontroller, there are power pins. One of them will require 5V and another is a ground connection which needs 0V. If you are talking about the external oscillator, it does not require an external source of power. However you do need to connect it to the microcontroller properly and I think the loading capacitors need to be connected to ground.

                        Originally posted by Mad_Professor View Post
                        as for the chip, do I need the crystal and it's loading capacitor?
                        I discussed this above. What it comes down to is whether you are willing to live with a maximum speed of 8MHz or not. For this application, I think 8MHz is more than enough. However ultimately it is up to you.

                        Originally posted by Mad_Professor View Post
                        Do I need to filter the power from Computer's PSU to the chip?
                        To tell you the truth, I am not too sure about this. I guess it depends how clean the power from the power supply is. Anyway the sort of capacitors which would be required are very cheap. General purpose capacitors would do which would cost a few cents each.

                        Originally posted by Mad_Professor View Post
                        What size strip board do I need?
                        Well it depends upon the size of your circuit. I highly recommend you design a stripboard on paper or in software where you can check it carefully for any mistakes. I have used Lochmaster in the past of stripboard designs, it is a fantastic piece of software. Too bad it is not free.

                        Originally posted by Mad_Professor View Post
                        What other components do I need?
                        I think we covered the essential components. Of course there are optional components like having a hardware reset button (which may be useful), voltage filtering capacitors etc.

                        Originally posted by Mad_Professor View Post
                        and shadow what are the 560 ohm resistors for?
                        The 560 Ohm resistors were for the indicator LED's. LED's need to have their current limited by resistors. Since you are not interested in LED indicator lights, you do need require these resistors.

                        Comment


                          #32
                          Re: I need to make a fan controller.

                          Originally posted by shadow View Post
                          I'm not too sure what you mean by this. What chip are you talking about? If it is the microcontroller, there are power pins. One of them will require 5V and another is a ground connection which needs 0V. If you are talking about the external oscillator, it does not require an external source of power. However you do need to connect it to the microcontroller properly and I think the loading capacitors need to be connected to ground.
                          The crystal connects between the two external oscillator pins of the uC, then each pin of the crystal has a loading capacitor between it and ground. Typical value is 22pF but crystals can be designed to use different values. The datasheet will tell you which to use.

                          In the case of a ceramic resonator (with the capacitors inbuilt), two pins (typically outer ones) go to the oscillator pins on the uC and the third, usually middle pin, goes to ground.

                          The oscillator should be as close to the uC as possible, and the loading capacitors should be close to the crystal. The ground connection to oscillator or capacitors should follow as short a path as possible back to the ground pin of the uC.


                          Originally posted by shadow View Post
                          To tell you the truth, I am not too sure about this. I guess it depends how clean the power from the power supply is. Anyway the sort of capacitors which would be required are very cheap. General purpose capacitors would do which would cost a few cents each.
                          +5v rail from the PC PSU is probably OK but if you have issues or doubts, get a 7805 regulator and power the circuit from +12v rail instead.

                          Don't forget decoupling capacitor(s) between the uC supply pins and ground. Again, these should be as close to the uC as possible.

                          Originally posted by shadow View Post
                          I highly recommend you design a stripboard on paper or in software where you can check it carefully for any mistakes. I have used Lochmaster in the past of stripboard designs, it is a fantastic piece of software. Too bad it is not free.
                          Stripboard is fairly easy to plan on paper, easier in software, and easier in either if you have already got a working breadboard design.

                          There are several free stripboard layout softwares, like VeroDes or the free version of VeeCAD.

                          I don't use stripboard much any more and mostly design PCBs with KiCAD which is totally free and open source
                          "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
                          -David VanHorn

                          Comment


                            #33
                            Re: I need to make a fan controller.

                            Ok so I don't need the crystal and loading caps and I can always add them in if it doesn't perform well. now I know I need caps for the incoming supply.

                            Looking at "Building an Arduino on a Breadboard" on the arduino website. They use two 10uf capacitors, I assume these are the decoupling caps?

                            I'll need one 10uf 6.3V or 10v caps for the 5v on mine? does ripple matter?

                            They also used 10k resistor for the reset, guess I'll need a reset button when programming the chip.


                            Originally posted by arduino
                            Pin 20 - AVcc - Suppply voltage for the ADC converter. Needs to be connected to power if ADC isn't being used and to power via a low-pass filter if it is (a low pass filter is a circuit that reduces noise from the power source. This example isn't using one)
                            I don't understand this but they show pin 20 connected to power in the picture.
                            Someone explain this to me and do I need to do the same.

                            Source: http://arduino.cc/en/Main/Standalone

                            Is that really it? Just a filtering cap on the 5v, a DAPA cable, avrdude to set fuses, arduino for the PWM function, 5x 1k ohm resistors 5x darling transistors 5x Schottky Diodes, add some power and viola!

                            The only thing left is the potentiometer, and I don't even know how to connect that to the atmega chip.
                            Last edited by Mad_Professor; 02-07-2012, 07:34 PM.

                            Comment


                              #34
                              Re: I need to make a fan controller.

                              Originally posted by Mad_Professor View Post
                              Looking at "Building an Arduino on a Breadboard" on the arduino website. They use two 10uf capacitors, I assume these are the decoupling caps?
                              Half of them, yes. Typically there are small value ceramics (0.1uF) next to each IC power pins and then larger capacitors (tens of uF) around the board. Voltage regulators of course have larger ones specifically.

                              http://www.seattlerobotics.org/encod...97/basics.html
                              http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

                              The setup as they show would probably work but without the decoupling capacitors might have spontaneous issues. It's better to add them I think.

                              Originally posted by Mad_Professor View Post
                              I don't understand this but they show pin 20 connected to power in the picture.
                              Someone explain this to me and do I need to do the same.
                              Pin 20 (AVcc) should be connected as they say. If you are not using the onboard ADC (analog-to-digital-converter) function of the ATMega (which I assume you are not right now) then connect it straight to +5v rail anyway.

                              If you do want to use the ADC, you need the filter.
                              "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
                              -David VanHorn

                              Comment


                                #35
                                Re: I need to make a fan controller.

                                Originally posted by Mad_Professor View Post
                                Looking at "Building an Arduino on a Breadboard" on the arduino website. They use two 10uf capacitors, I assume these are the decoupling caps?
                                Well looking at their circuit, they used a voltage regulator. The two capacitors are normally a requirement when using voltage regulators. Typically one larger one (typically an electrolytic) and one ceramic (typically very small value). Without these capacitors, a voltage regulator runs the risk of failure. However I looked up the datasheet for the regulator they used in that website and there is no mention of adding capacitors to the circuit. Judging from how they are wired, it seems like one of them is filtering the input voltage and the second one is filtering the output voltage.

                                Originally posted by Mad_Professor View Post
                                I'll need one 10uf 6.3V or 10v caps for the 5v on mine? does ripple matter?
                                General purpose capacitors would suffice in this application. So ESR and Ripple typically do not matter. I think adding decoupling capacitors is a nice to have thing.

                                Originally posted by Mad_Professor View Post
                                They also used 10k resistor for the reset, guess I'll need a reset button when programming the chip.
                                You do not necessarily require a hardware reset button (it is your choice). However the programmer (using the ICSP port) needs to be able to reset the microcontroller (it is one of the pins in the port). The reset line is active low. Therefore supplying GND voltage will reset the microcontroller and supplying Vcc voltage will NOT reset the microcontroller (opposite logic compared to normal). The 10k resistor is required as a pull-up resistor. During normal operation, Vcc will be supplied to the reset pin. However if the programmer provides a GND connection (through the ICSP port), then the reset pin will be pulled to GND and the microcontroller will reset.

                                Originally posted by Mad_Professor View Post
                                I don't understand this but they show pin 20 connected to power in the picture.
                                Someone explain this to me and do I need to do the same.
                                Unfortunately things are not so simple because you need to make use of the analog to digital converter (ADC) to use your potentiometer. Therefore according to the specifications, you require a low pass filter to be present on pin 20. According to the specifications, they recommend a 10uH inductor to be connected in series with the power supply and a 0.1uF capacitor to be connected between pin 20 and ground. I have read that many just add the capacitor (and don't bother with the inductor) with good success. Pin 21, Vref also needs to be tied to Vcc (However I have read that it is optional..which seems strange ).

                                Originally posted by Mad_Professor View Post
                                Is that really it? Just a filtering cap on the 5v, a DAPA cable, avrdude to set fuses, arduino for the PWM function, 5x 1k ohm resistors 5x darling transistors 5x Schottky Diodes, add some power and viola!
                                Pretty much.

                                Originally posted by Mad_Professor View Post
                                The only thing left is the potentiometer, and I don't even know how to connect that to the atmega chip.
                                The potentiometer is an analog sensor. It is very very simple to connect. Check out: http://www.arduino.cc/en/Tutorial/Potentiometer

                                Basically one side of the potentiometer is hooked up to 5V, the other side of the potentiometer is hooked up to 0V. The middle connection connects to one of the microcontrollers analog input pins. The potentiometer will provide that analog input pin with a voltage between 0V and 5V (depending on how much the potentiometer is turned). The ADC on the microcontroller converts this analog voltage to a discrete value (a number between 0 and 255 from memory on AVR microcontrollers). The program you write can read the value from the potentiometer as a number and act upon it.

                                Comment


                                  #36
                                  Re: I need to make a fan controller.

                                  Originally posted by Agent24 View Post
                                  Half of them, yes. Typically there are small value ceramics (0.1uF) next to each IC power pins and then larger capacitors (tens of uF) around the board. Voltage regulators of course have larger ones specifically.

                                  http://www.seattlerobotics.org/encod...97/basics.html
                                  http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

                                  The setup as they show would probably work but without the decoupling capacitors might have spontaneous issues. It's better to add them I think.



                                  Pin 20 (AVcc) should be connected as they say. If you are not using the onboard ADC (analog-to-digital-converter) function of the ATMega (which I assume you are not right now) then connect it straight to +5v rail anyway.

                                  If you do want to use the ADC, you need the filter.
                                  I read both those sites, now everything makes sense.

                                  They suggest a 47uf 50v lytic for the low freq. and then a 0.1uf 50v ceramic for high freq, would this work? or do I need to adjust?

                                  I still didn't understand ADC until shadow clue me in on it's purpose.

                                  Originally posted by shadow View Post
                                  Well looking at their circuit, they used a voltage regulator. The two capacitors are normally a requirement when using voltage regulators. Typically one larger one (typically an electrolytic) and one ceramic (typically very small value). Without these capacitors, a voltage regulator runs the risk of failure. However I looked up the datasheet for the regulator they used in that website and there is no mention of adding capacitors to the circuit. Judging from how they are wired, it seems like one of them is filtering the input voltage and the second one is filtering the output voltage.



                                  General purpose capacitors would suffice in this application. So ESR and Ripple typically do not matter. I think adding decoupling capacitors is a nice to have thing.



                                  You do not necessarily require a hardware reset button (it is your choice). However the programmer (using the ICSP port) needs to be able to reset the microcontroller (it is one of the pins in the port). The reset line is active low. Therefore supplying GND voltage will reset the microcontroller and supplying Vcc voltage will NOT reset the microcontroller (opposite logic compared to normal). The 10k resistor is required as a pull-up resistor. During normal operation, Vcc will be supplied to the reset pin. However if the programmer provides a GND connection (through the ICSP port), then the reset pin will be pulled to GND and the microcontroller will reset.



                                  Unfortunately things are not so simple because you need to make use of the analog to digital converter (ADC) to use your potentiometer. Therefore according to the specifications, you require a low pass filter to be present on pin 20. According to the specifications, they recommend a 10uH inductor to be connected in series with the power supply and a 0.1uF capacitor to be connected between pin 20 and ground. I have read that many just add the capacitor (and don't bother with the inductor) with good success. Pin 21, Vref also needs to be tied to Vcc (However I have read that it is optional..which seems strange ).



                                  Pretty much.



                                  The potentiometer is an analog sensor. It is very very simple to connect. Check out: http://www.arduino.cc/en/Tutorial/Potentiometer

                                  Basically one side of the potentiometer is hooked up to 5V, the other side of the potentiometer is hooked up to 0V. The middle connection connects to one of the microcontrollers analog input pins. The potentiometer will provide that analog input pin with a voltage between 0V and 5V (depending on how much the potentiometer is turned). The ADC on the microcontroller converts this analog voltage to a discrete value (a number between 0 and 255 from memory on AVR microcontrollers). The program you write can read the value from the potentiometer as a number and act upon it.
                                  Good! that's one less thing I need to order and I can easily short ground if I need to reset the chip.

                                  Just when I thought I got everything and was about to start sourcing parts;
                                  You just had to throw an inductor in.

                                  It's a good thing I'm asking these questions.

                                  All right so I supposedly need to put one in series. Does it have to be for the whole chip VCC, AREF, AVCC? or can I wire the inductor in series with a ceramic cap to AVCC?
                                  Last edited by Mad_Professor; 02-08-2012, 05:39 AM.

                                  Comment


                                    #37
                                    Re: I need to make a fan controller.

                                    Only the AVcc pin needs the inductor, which goes from +5v to AVcc.
                                    Hence, AVcc pin is fed the +5v supply through the inductor.

                                    Then, an 0.1uF ceramic capacitor goes between AVcc and ground, to decouple it, because it's a power supply pin.

                                    0.1 or 0.01uF is a good value for anything up to 50Mhz or so - according to this: http://www.hottconsultants.com/techtips/decoupling.html


                                    Not sure about the AREF pin though. On the Arduino I built (S3v3) the pin is broken-out but by default not connected to anything.

                                    Originally posted by shadow View Post
                                    Well looking at their circuit, they used a voltage regulator. The two capacitors are normally a requirement when using voltage regulators. Typically one larger one (typically an electrolytic) and one ceramic (typically very small value). Without these capacitors, a voltage regulator runs the risk of failure. However I looked up the datasheet for the regulator they used in that website and there is no mention of adding capacitors to the circuit.
                                    Not sure what datasheet you saw? Everything I've seen for any 78\79xx series tells you to use them.

                                    The first one from National (TI) you get in Google for 7805 shows a 0.22uF on input, 0.1uF on output and says "Bypass capacitors are recommended for optimum stability and transient response, and should be located as close as possible to the regulator"

                                    I would add them, I doubt they would make a problem even if unnecessary.
                                    Last edited by Agent24; 02-08-2012, 06:19 AM.
                                    "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
                                    -David VanHorn

                                    Comment


                                      #38
                                      Re: I need to make a fan controller.

                                      Originally posted by Agent24 View Post
                                      Not sure what datasheet you saw? Everything I've seen for any 78\79xx series tells you to use them.

                                      The first one from National (TI) you get in Google for 7805 shows a 0.22uF on input, 0.1uF on output and says "Bypass capacitors are recommended for optimum stability and transient response, and should be located as close as possible to the regulator"

                                      I would add them, I doubt they would make a problem even if unnecessary.
                                      Ah fair enough. I must have come across a dodgy datasheet then. They are definitely required thou. Without them, there is a serious risk of over-voltage on the output side.

                                      A friend of mine accidentally wired up a voltage regulator without the capacitors. Everything worked fine..until (what he believes) a voltage spike occurred and the regulator could not smooth out the output voltage without those capacitors. Needless to say, the circuit which was connected to the output of the voltage regulator fried.

                                      Comment


                                        #39
                                        Re: I need to make a fan controller.

                                        http://www.youtube.com/watch?v=hUGzeeTaJCs shows without decoupling capacitor the regulator starts oscillating with 1.2v peak-to-peak ripple at 12Mhz...
                                        "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
                                        -David VanHorn

                                        Comment


                                          #40
                                          Re: I need to make a fan controller.

                                          Wow that's crazy.

                                          Anyways,
                                          I'm ordering my stuff from digikey.

                                          But I don't know what kind of inductor I want?

                                          I'm guessing the one I want is going to be "FIXED" but there are so many variables and types, Half the stuff in the columns doesn't make any sense to me.

                                          Also does AREF need a ceramic cap?
                                          Last edited by Mad_Professor; 02-08-2012, 08:04 PM.

                                          Comment

                                          Working...
                                          X