Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Designing a PWM to Analog mini board for fans

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    17
    139
    12.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Egon.Netundefined
      Egon.Net @taconite
      last edited by

      @taconite said in Designing a PWM to Analog mini board for fans:

      @Egon-Net
      mhh thats a bummer πŸ˜• . I wanted to do 12V PWM to 5 V analog.

      But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
      https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12

      Do you realize you could just use the PWM- from duet and 5V instead of Duet's Fan Vcc? You are not forced to use 24V/12V from Duet.

      Here you have a example just with passive components:

      SimpleLowPass.png

      Since your load is Arduino's analog input, and assuming it has quite a high input impendance (IIRC, 1MOhm) you could just pull-up with your 5V supply with a 1K resistor (5mA current draw) and use VFan- from Duet (which is a PWM open drain). You'll have a little offset from de resistive divisor around A1, but it would be small. According my simulations, 2.3V for 50% PWM, 0V for 0% PWM and 4.54V por 100% PWM. You can play with R2 and C1 values a bit more to achieve even better results (for example 10k-10u).

      Of course you could also use my board, but I think your problem doesn't need it.

      1 Reply Last reply Reply Quote 1
      • Egon.Netundefined
        Egon.Net @zapta
        last edited by

        @zapta said in Designing a PWM to Analog mini board for fans:

        @Egon-Net said in Designing a PWM to Analog mini board for fans:

        Comments?

        Looks great and cute πŸ˜‰

        A few random thoughts, please take with a grain of salt.

        1. Are the components at the back of the board optional?

        No, just the led and its resistor are optional

        1. It seems that the new layout considerably restricted the ground path from the GND input to the transistor. I don't know if it matters or not.

        There's a dual GND plane, top and bottom are GND. Plenty of copper for GND πŸ™‚

        1. Is there sufficient clearance for a spacer wall at the bottom, at the screw hole near the diode? Hard to see from the pictures here.

        A real diode is not as huge as in the render, so there should be no problem. Just in case, I was going to print the PCB in paper and check the clearances for every hole. We could also use a SMD diode, but I have a lot of 1N4001 at home, that's why I picked it.

        1. You may want to add voltage input specification on the top of bottom silk screen. e.g. 12V - 24V or whatever the range is.

        Good idea. It should be good for 4.5V-40V (But the hight the voltage, the lower the usable current due to power dissipation)

        1. I think that VCC typically means +5V. Maybe change to Vin+

        Mmm VCC for me means "any positive voltage", but I can rename it to Vin+ if it seems clearer.

        1. The PWM input is active low. That is, if ones measure 10% high, it means 90% PWM value. I wonder if it can be conveyed somehow on the board to avoid confusion.

        PWM is active low, but I configured the comparator opamp to do inversion, so it follows the PWM percentage. It will be active low when using PWM voltage.

        Looking at the responses here, it seems to be a great ideas that will benefit many.

        I'm very glad!

        1 Reply Last reply Reply Quote 1
        • zaptaundefined
          zapta @taconite
          last edited by zapta

          @taconite said in Designing a PWM to Analog mini board for fans:

          But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
          https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12

          What exactly do you want to achieve? An Arduino reading the FAN PWM output from a duet?

          The optocoupler provides electrical isolation which you may or may not need. Then you can convert it to analog signal as feed it to the Arduino as such (see @Egon-Net's explanation) or feed it to the Arduino as a digital signal and let the Arduino determine the PWM value (e.g. using this standard function https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/ ).

          Egon.Netundefined 1 Reply Last reply Reply Quote 0
          • Egon.Netundefined
            Egon.Net @zapta
            last edited by

            @zapta said in Designing a PWM to Analog mini board for fans:

            @taconite said in Designing a PWM to Analog mini board for fans:

            But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
            https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12

            What exactly do you want to achieve? An Arduino reading the FAN PWM output from a duet?

            The optocoupler provides electrical isolation which you may or may not need. Then you can convert it to analog signal as feed it to the Arduino as such (see @Egon-Net's explanation) or feed it to the Arduino as a digital signal and let the Arduino determine the PWM value (e.g. using this standard function https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/ ).

            Didn't know about pulsein function, but for me it seems the way to go...

            1 Reply Last reply Reply Quote 0
            • taconiteundefined
              taconite
              last edited by taconite

              haven't heard about the pulsein function aswell. I wanted to get the 24V (or 12V) PWM into an equivalent 5V analog voltage hence the optocoupler. But principle should work, shouldn't it?

              EDIT:
              @Egon-Net said in Designing a PWM to Analog mini board for fans:

              @taconite said in Designing a PWM to Analog mini board for fans:

              @Egon-Net
              mhh thats a bummer πŸ˜• . I wanted to do 12V PWM to 5 V analog.

              But as it seems you are a specialist in electronics. Do you have an idea why this simple optocoupler didn't work for that purpose:
              https://forum.duet3d.com/topic/19325/powering-arduino-nano-and-leds-from-5v-rail/12

              Do you realize you could just use the PWM- from duet and 5V instead of Duet's Fan Vcc? You are not forced to use 24V/12V from Duet.

              Here you have a example just with passive components:

              SimpleLowPass.png

              Since your load is Arduino's analog input, and assuming it has quite a high input impendance (IIRC, 1MOhm) you could just pull-up with your 5V supply with a 1K resistor (5mA current draw) and use VFan- from Duet (which is a PWM open drain). You'll have a little offset from de resistive divisor around A1, but it would be small. According my simulations, 2.3V for 50% PWM, 0V for 0% PWM and 4.54V por 100% PWM. You can play with R2 and C1 values a bit more to achieve even better results (for example 10k-10u).

              Of course you could also use my board, but I think your problem doesn't need it.

              Oh no I didn't know that this would be possible - thanks!

              Custom ANET A8
              Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

              All I do here is under this license: CC BY-NC-SA

              1 Reply Last reply Reply Quote 0
              • Egon.Netundefined
                Egon.Net
                last edited by

                Well, I think I have the final design:

                PCB3-render.png

                PCB3-render2.png

                Besides minor cosmetic changes, I've added a jumper column to select PWM active high or active low with two jumpers. You can put the pins and jumpers or just solder it fixed. The silkscreen guides you about which ones to short por PWM active HIGH or PWM active LOW. PCB now is a bit bigger, but I think is worth it.

                Any comments before I launch the order?

                fcwiltundefined 1 Reply Last reply Reply Quote 1
                • gaweyoundefined
                  gaweyo
                  last edited by

                  Nice work! Could you perhaps add a surface mount pad to the diode so the same board can accommodate both the through hole and surface mount part?

                  Egon.Netundefined 1 Reply Last reply Reply Quote 0
                  • Egon.Netundefined
                    Egon.Net @gaweyo
                    last edited by

                    @gaweyo said in Designing a PWM to Analog mini board for fans:

                    Nice work! Could you perhaps add a surface mount pad to the diode so the same board can accommodate both the through hole and surface mount part?

                    Good idea!

                    1 Reply Last reply Reply Quote 0
                    • fcwiltundefined
                      fcwilt @Egon.Net
                      last edited by

                      @Egon-Net said in Designing a PWM to Analog mini board for fans:

                      Any comments before I launch the order?

                      Are you going to have someone install the parts? Or at least the SMDs?

                      Frederick

                      Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                      Egon.Netundefined 1 Reply Last reply Reply Quote 0
                      • Egon.Netundefined
                        Egon.Net @fcwilt
                        last edited by

                        @fcwilt said in Designing a PWM to Analog mini board for fans:

                        @Egon-Net said in Designing a PWM to Analog mini board for fans:

                        Any comments before I launch the order?

                        Are you going to have someone install the parts? Or at least the SMDs?

                        Frederick

                        I'll do it by myself, I have a hot air soldering station and I've build many smd boards already.

                        BTW, @gaweyo, I've just added the smd diode footprint πŸ™‚

                        fcwiltundefined 1 Reply Last reply Reply Quote 1
                        • fcwiltundefined
                          fcwilt @Egon.Net
                          last edited by

                          @Egon-Net said in Designing a PWM to Analog mini board for fans:

                          I'll do it by myself, I have a hot air soldering station and I've build many smd boards already.

                          That's a skill I have never tried. I have a hot air soldering station but the project I purchased it for got canceled.

                          So there it sets new and unused.

                          How much are you going to be selling them for - say 25 units.

                          Frederick

                          Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                          Egon.Netundefined zaptaundefined 2 Replies Last reply Reply Quote 0
                          • Egon.Netundefined
                            Egon.Net @fcwilt
                            last edited by

                            @fcwilt said in Designing a PWM to Analog mini board for fans:

                            @Egon-Net said in Designing a PWM to Analog mini board for fans:

                            I'll do it by myself, I have a hot air soldering station and I've build many smd boards already.

                            That's a skill I have never tried. I have a hot air soldering station but the project I purchased it for got canceled.

                            So there it sets new and unused.

                            How much are you going to be selling them for - say 25 units.

                            Frederick

                            I haven't calculated costs yet, but I my plan is just sharing the costs, just not to loose with each board. Once I have the prototype board working, I'll put a price for the DIY kit (board+components), just the bare PCB, and the complete mounted and tested board. And of course, I can send the gerbers for free too.

                            Would kind of kit would you need? Bare, components kit, mounted...?

                            fcwiltundefined zaptaundefined 2 Replies Last reply Reply Quote 0
                            • fcwiltundefined
                              fcwilt @Egon.Net
                              last edited by

                              @Egon-Net said in Designing a PWM to Analog mini board for fans:

                              Would kind of kit would you need? Bare, components kit, mounted...?

                              As busy as I am I would prefer completely assembled units - ready to install in a printer.

                              And you should price them to make some profit.

                              Frederick

                              Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                              1 Reply Last reply Reply Quote 0
                              • zaptaundefined
                                zapta @fcwilt
                                last edited by

                                @fcwilt said in Designing a PWM to Analog mini board for fans:

                                That's a skill I have never tried. I have a hot air soldering station but the project I purchased it for got canceled.

                                You can try one of those practice kits instead. https://www.aliexpress.com/item/32909277203.html

                                A solder iron, flux paste, and solder are all you need. A cheap Chinese stereoscopic optical microscope makes even easier.

                                fcwiltundefined 1 Reply Last reply Reply Quote 1
                                • fcwiltundefined
                                  fcwilt @zapta
                                  last edited by

                                  @zapta said in Designing a PWM to Analog mini board for fans:

                                  You can try one of those practice kits instead. https://www.aliexpress.com/item/32909277203.html

                                  Great idea.

                                  A solder iron, flux paste, and solder are all you need. A cheap Chinese stereoscopic optical microscope makes even easier.

                                  I actually have all of those.

                                  Frederick

                                  Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                  1 Reply Last reply Reply Quote 0
                                  • zaptaundefined
                                    zapta @Egon.Net
                                    last edited by

                                    @Egon-Net, one option you have is ordering assembled from vendors such as JLCPCB.

                                    https://jlcpcb.com/smt-assembly

                                    You may need to make design changes to reduce cost and use their standard parts. https://jlcpcb.com/parts

                                    https://www.youtube.com/results?search_query=jlcpcb+assembly

                                    Just an idea.

                                    Egon.Netundefined 1 Reply Last reply Reply Quote 0
                                    • Egon.Netundefined
                                      Egon.Net @zapta
                                      last edited by

                                      @zapta said in Designing a PWM to Analog mini board for fans:

                                      @Egon-Net, one option you have is ordering assembled from vendors such as JLCPCB.

                                      https://jlcpcb.com/smt-assembly

                                      You may need to make design changes to reduce cost and use their standard parts. https://jlcpcb.com/parts

                                      https://www.youtube.com/results?search_query=jlcpcb+assembly

                                      Just an idea.

                                      I don't think we are going to do so many boards to be an advantage. For the time being I will do the boards by myself, but maybe in the future I'm overwhelmed by all the people wanting the boards and I have to look something like that! ☺

                                      BTW, I'm already a costumer of JLCPCB πŸ™‚

                                      1 Reply Last reply Reply Quote 0
                                      • dc42undefined
                                        dc42 administrators
                                        last edited by

                                        PCB assembly is easier if all the SMD components are on the same side. Then it's easily done using a hotplate, solder paste, and a Mylar solder stencil (available in the UK from Hobbytronics).

                                        Duet WiFi hardware designer and firmware engineer
                                        Please do not ask me for Duet support via PM or email, use the forum
                                        http://www.escher3d.com, https://miscsolutions.wordpress.com

                                        Egon.Netundefined 1 Reply Last reply Reply Quote 0
                                        • Egon.Netundefined
                                          Egon.Net @dc42
                                          last edited by

                                          @dc42 said in Designing a PWM to Analog mini board for fans:

                                          PCB assembly is easier if all the SMD components are on the same side. Then it's easily done using a hotplate, solder paste, and a Mylar solder stencil (available in the UK from Hobbytronics).

                                          I know, but for low quantity runs I do it with hot air and without stencil, with very good results. And for this design, size is a constrain. If I were to do a bigger run, I'd rearrange the pcb to be one side only and get it done somewhere lije JLCPCB.

                                          Thanks for the advice anyway πŸ™‚

                                          1 Reply Last reply Reply Quote 0
                                          • marceloriderundefined
                                            marcelorider
                                            last edited by

                                            It’s getting really nice πŸ‘πŸ»
                                            I’m pumped to get my hands on one!

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA