Ways to power an Arduino from 24 VDC











up vote
4
down vote

favorite












I want to power an Arduino (Wemos D1 Mini) with 5 or 3.3 V from my garage door opener, which has 24 VDC available.



As far as I understand, this can be solved in the following ways:




  1. Step down buck converter

  2. Linear voltage regulator

  3. Voltage divider circuit


What are the pros/cons of each of these?



I'm concerned about heat, and I don't want to burn down the garage. I haven't measured how much current my Arduino draws, but I guess it's very little like 250 mA or less(?). I'm only using the built-in Wi-Fi module and no external sensors/relays.










share|improve this question




















  • 2




    Hi and Welcome. It would be better to not "guess" - can you measure? A voltage divider is never recommended unless you at least know your load current and the load current is VERY stable.
    – mike65535
    Nov 29 at 13:23















up vote
4
down vote

favorite












I want to power an Arduino (Wemos D1 Mini) with 5 or 3.3 V from my garage door opener, which has 24 VDC available.



As far as I understand, this can be solved in the following ways:




  1. Step down buck converter

  2. Linear voltage regulator

  3. Voltage divider circuit


What are the pros/cons of each of these?



I'm concerned about heat, and I don't want to burn down the garage. I haven't measured how much current my Arduino draws, but I guess it's very little like 250 mA or less(?). I'm only using the built-in Wi-Fi module and no external sensors/relays.










share|improve this question




















  • 2




    Hi and Welcome. It would be better to not "guess" - can you measure? A voltage divider is never recommended unless you at least know your load current and the load current is VERY stable.
    – mike65535
    Nov 29 at 13:23













up vote
4
down vote

favorite









up vote
4
down vote

favorite











I want to power an Arduino (Wemos D1 Mini) with 5 or 3.3 V from my garage door opener, which has 24 VDC available.



As far as I understand, this can be solved in the following ways:




  1. Step down buck converter

  2. Linear voltage regulator

  3. Voltage divider circuit


What are the pros/cons of each of these?



I'm concerned about heat, and I don't want to burn down the garage. I haven't measured how much current my Arduino draws, but I guess it's very little like 250 mA or less(?). I'm only using the built-in Wi-Fi module and no external sensors/relays.










share|improve this question















I want to power an Arduino (Wemos D1 Mini) with 5 or 3.3 V from my garage door opener, which has 24 VDC available.



As far as I understand, this can be solved in the following ways:




  1. Step down buck converter

  2. Linear voltage regulator

  3. Voltage divider circuit


What are the pros/cons of each of these?



I'm concerned about heat, and I don't want to burn down the garage. I haven't measured how much current my Arduino draws, but I guess it's very little like 250 mA or less(?). I'm only using the built-in Wi-Fi module and no external sensors/relays.







resistors voltage-regulator voltage-divider buck heat






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 at 23:40









Peter Mortensen

1,58031422




1,58031422










asked Nov 29 at 12:23









Mats Faugli

233




233








  • 2




    Hi and Welcome. It would be better to not "guess" - can you measure? A voltage divider is never recommended unless you at least know your load current and the load current is VERY stable.
    – mike65535
    Nov 29 at 13:23














  • 2




    Hi and Welcome. It would be better to not "guess" - can you measure? A voltage divider is never recommended unless you at least know your load current and the load current is VERY stable.
    – mike65535
    Nov 29 at 13:23








2




2




Hi and Welcome. It would be better to not "guess" - can you measure? A voltage divider is never recommended unless you at least know your load current and the load current is VERY stable.
– mike65535
Nov 29 at 13:23




Hi and Welcome. It would be better to not "guess" - can you measure? A voltage divider is never recommended unless you at least know your load current and the load current is VERY stable.
– mike65535
Nov 29 at 13:23










4 Answers
4






active

oldest

votes

















up vote
11
down vote



accepted











  1. This is the most efficient solution, will provide good conversion rate but is a little bit more complex to do and also more expensive. Although you can find modules that are already soldered with components saving you the trouble of calculating everything.


  2. This is less efficient, it basically acts as a regulated resistor, dissipating the power you don't use through heating. Only need 3 components usually, the voltage regulator and 2 capacitors and it is cheaper than 1.


  3. Won't work for you, voltage divider is not regulated and depends on the load, thus the resulting voltage may vary.



For your case, I would buy a DC/DC buck converter module already assembled like this one.



Note there are also capacitor based voltage converters.






share|improve this answer























  • Don't you think #2 will not be feasible at all as well?
    – MaNyYaCk
    Nov 29 at 12:45










  • Yes of course it's feasible, it's just less power efficient.
    – Damien
    Nov 29 at 12:48






  • 7




    That linear regulator would be dissipating like five watts. A good, well-installed heatsink would be necessary, and even then I'd worry about airflow depending on the case.
    – Sneftel
    Nov 29 at 15:39










  • @Damien can you please explain what a capacitor based voltage converter works, or at least point me to a site with some basic information?
    – Mats Faugli
    Nov 30 at 11:24


















up vote
8
down vote













One point to consider between choosing a DC-DC buck converter or a linear regulator is the quality of the output. Because of how they work DC converters will always have some amount of high frequency ripple on the output while linear regulators are extremely smooth.



So, DC converters are very efficient, but noisy, and linear regulators are very smooth, but inefficient (they basically "waste" the voltage difference as heat; stepping down 24V→5V a very large amount of heat).



Whether the ripple matters or whether you can smooth out the DC converter output enough depends on the device you're powering. In your case, an Arduino with no sensors, it doesn't really matter that the power rail is somewhat noisy.



But if other cases if you have sensors that depend on exact input voltage, or other devices that are sensitive to ripple it may matter. With very sensitive devices you might even have to use a combination of a DC converter to drop the voltage down to close to your target, and then use a low dropout linear regulator to get the final stable voltage without losing a lot of efficiency in the linear stage (since it's only a small step down, instead of a large step down).



Option 3 doesn't work at all. It combines all the disadvantages of linear regulator inefficiency (you're dissipating the voltage difference in the resistors) with an unregulated output voltage that varies depending on the load. The load will vary considerably depending on what the Arduino is doing, and especially whether the WiFi module is sending data or not.






share|improve this answer























  • This is correct, but to be picky: It does not really answer the question, but only parts of it
    – Jounathaen
    Nov 29 at 15:57






  • 1




    Is that better now, @Jounathaen?
    – tylisirn
    Nov 29 at 16:33










  • Shouldn't ripple on a DC supply be fairly easy to correct? AC guy talking here. @Jounathaen Better a good half answer, than a good half answer and a shabby half answer that's only there for statutory reasons.
    – Harper
    Nov 29 at 20:54






  • 1




    Actually it is not that correct. It is a general assumption that linear regulator gives a smooth output. But in fact, it might be worse than a well done buck with filtering. The linear regulator are not good at ripple rejection, if you have an input with ripple, the output will also have significant ripple. Also linear regulator do oscillate on their own and varies depending on the current and capacitive load (capacitive load which varies over temperature if you use ceramic caps, thus you have a temperature dependent ripple).
    – Damien
    Nov 30 at 2:55












  • Rather than a heatsink you can use a power resistor between the 24V and the 5V regulator input to alleviate the thermal load on the regulator.
    – Misunderstood
    Dec 1 at 0:13


















up vote
1
down vote













First, make sure your garage uses 24VDC. A more common control voltage in residential wiring is 24VAC, seen in doorbells and thermostats. AC voltage is a big mess for a DC device, but it works with transformers!



Since it's part of a building, it must reasonably comply with the electrical codes. Fortunately those codes are pretty easy on low voltage (30V) low power (<55W) devices. You will need to use proper enclosures and do wiring to the low standards of doorbell or thermostat wiring (e.g. Neat and workmanlike, don't be stupid, make an effort to staple it out of harm's way, and don't use mains power wiring as a hanger.) So in a Code context:



A DC-DC converter



is a great way to handle it. The converter will make less than a watt of residual heat, and will be small, so it will fit neatly into a common, cheap steel 4" or 120mm square junction box. The steel's thermal conductivity and the size of the box will take care of heat dissipation. Its current draw will certainly be within the range available from the opener.



Code requires the use of "approved" equipment which generally means it is UL listed. "Equipment means "not components": difference being, the equipment has labeling/instructions describing its consumer use, and UL tested and listed it that way. But again, rules are relaxed for low voltage <55W stuff. The point of this is, favor a DC-DC that is packaged more like a finished good, i.e. That has screw terminals and a case, rather than wires sloppily soldered onto a unit meant for PCB mounting. If it's packaged neatly enough, you may not even need a steel junction box to hide it.



Resistor ladder



I've worked with resistor laddes a fair bit. For instance, Westinghouse HL traction drive equipment (the L is for line powered, not battery) uses a resistor ladder to synthesize roughly 80V from 600V line voltage. The lower resistor, between load and GND, keeps the voltage from floating upward toward 600V if there is no current draw by the load.



But the voltage varies considerably, since the lower resistor is paralleled with between 0 and 15 contactors on a 5-car train. This varying of voltage is the Achilles' heel of resistor ladders. You mitigate it by making the upper and lower bypass resistors larger (in watts and physical size, smaller in ohms). For any reasonable working range, the vast majority of power will be consumed in the resistor ladder, not the load.



In your application, you need to spec your resistor ladder so your voltage stays between 3.3V and 5V at load draws between 0A and 250ma (or whatever measurement proves out). The math isn't overly complicated, but that's a narrow range that I expect will require a fairly enormous resistor ladder. So you're going to be making a lot of heat, and will need appropriate safety caging for the resistor bank. I fully expect this will exceed the supply capacity of the garage door opener's power supply. It may even exceed the 55W statutory limit for relaxed rules for low voltage wiring! All in all, ladders are just not for things with narrow voltage requirements.



A linear voltage regulator



Something like a 7805 regulator is a resistor ladder -- but with the lower balance resistor deleted, only the Arduino as the lower resistor, and the regulator as a "smart" upper resistor, changing its resistance on the fly to track the load current. The whole circuit flows whatever the Arduino draws, which is up to 250ma, you say.



The voltage regulator must dissipate the difference between supply voltage and lutput voltage, e.g. 19-20.7 volts x circuit current. E.g. At 250ma that'd be about 5 watts. That will need to be heatsinked appropriately. Too much to use a 4x4 steel box as an ad-hoc heatsink.



Almost all voltage regulators are made for external heatsinking, so you have a big packaging problem as far as making it look like "not a science project". And you have to deal with ultimate heat removal: the heat sink has to interchange with ambient air, and you can't just let the junction box get hot.



Expand mains power at the opener; add a "wall wart"



A few garage door openers have provisions for a receptacle (mains socket e.g. NEMA 5-15). If not the socket, a pre-cut knockout where a socket could be installed. You could retrofit that.



Or you could fit a duplex mains socket at the garage door opener's supply, give it a power cord, and now you have an open socket.



Plug a wall-wart in there and done.






share|improve this answer




























    up vote
    0
    down vote













    One option that has not been pointed out (as far as I can see), is that you are not limited to choosing only one option. In particular, a buck regulator followed by a linear regulator can give you the best features of both.



    I would suggest a buck regulator to bring the voltage down from 24V to say 9V, then feed the 9V into a linear regulator down to 5V. At 250mA, the linear regulator is only dissipating 1W (9-5=4V x 250mA). Thus the buck regulator does most of the work, and the linear regulator provides a ripple free output.






    share|improve this answer





















      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("schematics", function () {
      StackExchange.schematics.init();
      });
      }, "cicuitlab");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "135"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f409541%2fways-to-power-an-arduino-from-24-vdc%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      11
      down vote



      accepted











      1. This is the most efficient solution, will provide good conversion rate but is a little bit more complex to do and also more expensive. Although you can find modules that are already soldered with components saving you the trouble of calculating everything.


      2. This is less efficient, it basically acts as a regulated resistor, dissipating the power you don't use through heating. Only need 3 components usually, the voltage regulator and 2 capacitors and it is cheaper than 1.


      3. Won't work for you, voltage divider is not regulated and depends on the load, thus the resulting voltage may vary.



      For your case, I would buy a DC/DC buck converter module already assembled like this one.



      Note there are also capacitor based voltage converters.






      share|improve this answer























      • Don't you think #2 will not be feasible at all as well?
        – MaNyYaCk
        Nov 29 at 12:45










      • Yes of course it's feasible, it's just less power efficient.
        – Damien
        Nov 29 at 12:48






      • 7




        That linear regulator would be dissipating like five watts. A good, well-installed heatsink would be necessary, and even then I'd worry about airflow depending on the case.
        – Sneftel
        Nov 29 at 15:39










      • @Damien can you please explain what a capacitor based voltage converter works, or at least point me to a site with some basic information?
        – Mats Faugli
        Nov 30 at 11:24















      up vote
      11
      down vote



      accepted











      1. This is the most efficient solution, will provide good conversion rate but is a little bit more complex to do and also more expensive. Although you can find modules that are already soldered with components saving you the trouble of calculating everything.


      2. This is less efficient, it basically acts as a regulated resistor, dissipating the power you don't use through heating. Only need 3 components usually, the voltage regulator and 2 capacitors and it is cheaper than 1.


      3. Won't work for you, voltage divider is not regulated and depends on the load, thus the resulting voltage may vary.



      For your case, I would buy a DC/DC buck converter module already assembled like this one.



      Note there are also capacitor based voltage converters.






      share|improve this answer























      • Don't you think #2 will not be feasible at all as well?
        – MaNyYaCk
        Nov 29 at 12:45










      • Yes of course it's feasible, it's just less power efficient.
        – Damien
        Nov 29 at 12:48






      • 7




        That linear regulator would be dissipating like five watts. A good, well-installed heatsink would be necessary, and even then I'd worry about airflow depending on the case.
        – Sneftel
        Nov 29 at 15:39










      • @Damien can you please explain what a capacitor based voltage converter works, or at least point me to a site with some basic information?
        – Mats Faugli
        Nov 30 at 11:24













      up vote
      11
      down vote



      accepted







      up vote
      11
      down vote



      accepted







      1. This is the most efficient solution, will provide good conversion rate but is a little bit more complex to do and also more expensive. Although you can find modules that are already soldered with components saving you the trouble of calculating everything.


      2. This is less efficient, it basically acts as a regulated resistor, dissipating the power you don't use through heating. Only need 3 components usually, the voltage regulator and 2 capacitors and it is cheaper than 1.


      3. Won't work for you, voltage divider is not regulated and depends on the load, thus the resulting voltage may vary.



      For your case, I would buy a DC/DC buck converter module already assembled like this one.



      Note there are also capacitor based voltage converters.






      share|improve this answer















      1. This is the most efficient solution, will provide good conversion rate but is a little bit more complex to do and also more expensive. Although you can find modules that are already soldered with components saving you the trouble of calculating everything.


      2. This is less efficient, it basically acts as a regulated resistor, dissipating the power you don't use through heating. Only need 3 components usually, the voltage regulator and 2 capacitors and it is cheaper than 1.


      3. Won't work for you, voltage divider is not regulated and depends on the load, thus the resulting voltage may vary.



      For your case, I would buy a DC/DC buck converter module already assembled like this one.



      Note there are also capacitor based voltage converters.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Nov 29 at 13:02

























      answered Nov 29 at 12:26









      Damien

      1,569214




      1,569214












      • Don't you think #2 will not be feasible at all as well?
        – MaNyYaCk
        Nov 29 at 12:45










      • Yes of course it's feasible, it's just less power efficient.
        – Damien
        Nov 29 at 12:48






      • 7




        That linear regulator would be dissipating like five watts. A good, well-installed heatsink would be necessary, and even then I'd worry about airflow depending on the case.
        – Sneftel
        Nov 29 at 15:39










      • @Damien can you please explain what a capacitor based voltage converter works, or at least point me to a site with some basic information?
        – Mats Faugli
        Nov 30 at 11:24


















      • Don't you think #2 will not be feasible at all as well?
        – MaNyYaCk
        Nov 29 at 12:45










      • Yes of course it's feasible, it's just less power efficient.
        – Damien
        Nov 29 at 12:48






      • 7




        That linear regulator would be dissipating like five watts. A good, well-installed heatsink would be necessary, and even then I'd worry about airflow depending on the case.
        – Sneftel
        Nov 29 at 15:39










      • @Damien can you please explain what a capacitor based voltage converter works, or at least point me to a site with some basic information?
        – Mats Faugli
        Nov 30 at 11:24
















      Don't you think #2 will not be feasible at all as well?
      – MaNyYaCk
      Nov 29 at 12:45




      Don't you think #2 will not be feasible at all as well?
      – MaNyYaCk
      Nov 29 at 12:45












      Yes of course it's feasible, it's just less power efficient.
      – Damien
      Nov 29 at 12:48




      Yes of course it's feasible, it's just less power efficient.
      – Damien
      Nov 29 at 12:48




      7




      7




      That linear regulator would be dissipating like five watts. A good, well-installed heatsink would be necessary, and even then I'd worry about airflow depending on the case.
      – Sneftel
      Nov 29 at 15:39




      That linear regulator would be dissipating like five watts. A good, well-installed heatsink would be necessary, and even then I'd worry about airflow depending on the case.
      – Sneftel
      Nov 29 at 15:39












      @Damien can you please explain what a capacitor based voltage converter works, or at least point me to a site with some basic information?
      – Mats Faugli
      Nov 30 at 11:24




      @Damien can you please explain what a capacitor based voltage converter works, or at least point me to a site with some basic information?
      – Mats Faugli
      Nov 30 at 11:24












      up vote
      8
      down vote













      One point to consider between choosing a DC-DC buck converter or a linear regulator is the quality of the output. Because of how they work DC converters will always have some amount of high frequency ripple on the output while linear regulators are extremely smooth.



      So, DC converters are very efficient, but noisy, and linear regulators are very smooth, but inefficient (they basically "waste" the voltage difference as heat; stepping down 24V→5V a very large amount of heat).



      Whether the ripple matters or whether you can smooth out the DC converter output enough depends on the device you're powering. In your case, an Arduino with no sensors, it doesn't really matter that the power rail is somewhat noisy.



      But if other cases if you have sensors that depend on exact input voltage, or other devices that are sensitive to ripple it may matter. With very sensitive devices you might even have to use a combination of a DC converter to drop the voltage down to close to your target, and then use a low dropout linear regulator to get the final stable voltage without losing a lot of efficiency in the linear stage (since it's only a small step down, instead of a large step down).



      Option 3 doesn't work at all. It combines all the disadvantages of linear regulator inefficiency (you're dissipating the voltage difference in the resistors) with an unregulated output voltage that varies depending on the load. The load will vary considerably depending on what the Arduino is doing, and especially whether the WiFi module is sending data or not.






      share|improve this answer























      • This is correct, but to be picky: It does not really answer the question, but only parts of it
        – Jounathaen
        Nov 29 at 15:57






      • 1




        Is that better now, @Jounathaen?
        – tylisirn
        Nov 29 at 16:33










      • Shouldn't ripple on a DC supply be fairly easy to correct? AC guy talking here. @Jounathaen Better a good half answer, than a good half answer and a shabby half answer that's only there for statutory reasons.
        – Harper
        Nov 29 at 20:54






      • 1




        Actually it is not that correct. It is a general assumption that linear regulator gives a smooth output. But in fact, it might be worse than a well done buck with filtering. The linear regulator are not good at ripple rejection, if you have an input with ripple, the output will also have significant ripple. Also linear regulator do oscillate on their own and varies depending on the current and capacitive load (capacitive load which varies over temperature if you use ceramic caps, thus you have a temperature dependent ripple).
        – Damien
        Nov 30 at 2:55












      • Rather than a heatsink you can use a power resistor between the 24V and the 5V regulator input to alleviate the thermal load on the regulator.
        – Misunderstood
        Dec 1 at 0:13















      up vote
      8
      down vote













      One point to consider between choosing a DC-DC buck converter or a linear regulator is the quality of the output. Because of how they work DC converters will always have some amount of high frequency ripple on the output while linear regulators are extremely smooth.



      So, DC converters are very efficient, but noisy, and linear regulators are very smooth, but inefficient (they basically "waste" the voltage difference as heat; stepping down 24V→5V a very large amount of heat).



      Whether the ripple matters or whether you can smooth out the DC converter output enough depends on the device you're powering. In your case, an Arduino with no sensors, it doesn't really matter that the power rail is somewhat noisy.



      But if other cases if you have sensors that depend on exact input voltage, or other devices that are sensitive to ripple it may matter. With very sensitive devices you might even have to use a combination of a DC converter to drop the voltage down to close to your target, and then use a low dropout linear regulator to get the final stable voltage without losing a lot of efficiency in the linear stage (since it's only a small step down, instead of a large step down).



      Option 3 doesn't work at all. It combines all the disadvantages of linear regulator inefficiency (you're dissipating the voltage difference in the resistors) with an unregulated output voltage that varies depending on the load. The load will vary considerably depending on what the Arduino is doing, and especially whether the WiFi module is sending data or not.






      share|improve this answer























      • This is correct, but to be picky: It does not really answer the question, but only parts of it
        – Jounathaen
        Nov 29 at 15:57






      • 1




        Is that better now, @Jounathaen?
        – tylisirn
        Nov 29 at 16:33










      • Shouldn't ripple on a DC supply be fairly easy to correct? AC guy talking here. @Jounathaen Better a good half answer, than a good half answer and a shabby half answer that's only there for statutory reasons.
        – Harper
        Nov 29 at 20:54






      • 1




        Actually it is not that correct. It is a general assumption that linear regulator gives a smooth output. But in fact, it might be worse than a well done buck with filtering. The linear regulator are not good at ripple rejection, if you have an input with ripple, the output will also have significant ripple. Also linear regulator do oscillate on their own and varies depending on the current and capacitive load (capacitive load which varies over temperature if you use ceramic caps, thus you have a temperature dependent ripple).
        – Damien
        Nov 30 at 2:55












      • Rather than a heatsink you can use a power resistor between the 24V and the 5V regulator input to alleviate the thermal load on the regulator.
        – Misunderstood
        Dec 1 at 0:13













      up vote
      8
      down vote










      up vote
      8
      down vote









      One point to consider between choosing a DC-DC buck converter or a linear regulator is the quality of the output. Because of how they work DC converters will always have some amount of high frequency ripple on the output while linear regulators are extremely smooth.



      So, DC converters are very efficient, but noisy, and linear regulators are very smooth, but inefficient (they basically "waste" the voltage difference as heat; stepping down 24V→5V a very large amount of heat).



      Whether the ripple matters or whether you can smooth out the DC converter output enough depends on the device you're powering. In your case, an Arduino with no sensors, it doesn't really matter that the power rail is somewhat noisy.



      But if other cases if you have sensors that depend on exact input voltage, or other devices that are sensitive to ripple it may matter. With very sensitive devices you might even have to use a combination of a DC converter to drop the voltage down to close to your target, and then use a low dropout linear regulator to get the final stable voltage without losing a lot of efficiency in the linear stage (since it's only a small step down, instead of a large step down).



      Option 3 doesn't work at all. It combines all the disadvantages of linear regulator inefficiency (you're dissipating the voltage difference in the resistors) with an unregulated output voltage that varies depending on the load. The load will vary considerably depending on what the Arduino is doing, and especially whether the WiFi module is sending data or not.






      share|improve this answer














      One point to consider between choosing a DC-DC buck converter or a linear regulator is the quality of the output. Because of how they work DC converters will always have some amount of high frequency ripple on the output while linear regulators are extremely smooth.



      So, DC converters are very efficient, but noisy, and linear regulators are very smooth, but inefficient (they basically "waste" the voltage difference as heat; stepping down 24V→5V a very large amount of heat).



      Whether the ripple matters or whether you can smooth out the DC converter output enough depends on the device you're powering. In your case, an Arduino with no sensors, it doesn't really matter that the power rail is somewhat noisy.



      But if other cases if you have sensors that depend on exact input voltage, or other devices that are sensitive to ripple it may matter. With very sensitive devices you might even have to use a combination of a DC converter to drop the voltage down to close to your target, and then use a low dropout linear regulator to get the final stable voltage without losing a lot of efficiency in the linear stage (since it's only a small step down, instead of a large step down).



      Option 3 doesn't work at all. It combines all the disadvantages of linear regulator inefficiency (you're dissipating the voltage difference in the resistors) with an unregulated output voltage that varies depending on the load. The load will vary considerably depending on what the Arduino is doing, and especially whether the WiFi module is sending data or not.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Nov 29 at 16:30

























      answered Nov 29 at 14:13









      tylisirn

      1013




      1013












      • This is correct, but to be picky: It does not really answer the question, but only parts of it
        – Jounathaen
        Nov 29 at 15:57






      • 1




        Is that better now, @Jounathaen?
        – tylisirn
        Nov 29 at 16:33










      • Shouldn't ripple on a DC supply be fairly easy to correct? AC guy talking here. @Jounathaen Better a good half answer, than a good half answer and a shabby half answer that's only there for statutory reasons.
        – Harper
        Nov 29 at 20:54






      • 1




        Actually it is not that correct. It is a general assumption that linear regulator gives a smooth output. But in fact, it might be worse than a well done buck with filtering. The linear regulator are not good at ripple rejection, if you have an input with ripple, the output will also have significant ripple. Also linear regulator do oscillate on their own and varies depending on the current and capacitive load (capacitive load which varies over temperature if you use ceramic caps, thus you have a temperature dependent ripple).
        – Damien
        Nov 30 at 2:55












      • Rather than a heatsink you can use a power resistor between the 24V and the 5V regulator input to alleviate the thermal load on the regulator.
        – Misunderstood
        Dec 1 at 0:13


















      • This is correct, but to be picky: It does not really answer the question, but only parts of it
        – Jounathaen
        Nov 29 at 15:57






      • 1




        Is that better now, @Jounathaen?
        – tylisirn
        Nov 29 at 16:33










      • Shouldn't ripple on a DC supply be fairly easy to correct? AC guy talking here. @Jounathaen Better a good half answer, than a good half answer and a shabby half answer that's only there for statutory reasons.
        – Harper
        Nov 29 at 20:54






      • 1




        Actually it is not that correct. It is a general assumption that linear regulator gives a smooth output. But in fact, it might be worse than a well done buck with filtering. The linear regulator are not good at ripple rejection, if you have an input with ripple, the output will also have significant ripple. Also linear regulator do oscillate on their own and varies depending on the current and capacitive load (capacitive load which varies over temperature if you use ceramic caps, thus you have a temperature dependent ripple).
        – Damien
        Nov 30 at 2:55












      • Rather than a heatsink you can use a power resistor between the 24V and the 5V regulator input to alleviate the thermal load on the regulator.
        – Misunderstood
        Dec 1 at 0:13
















      This is correct, but to be picky: It does not really answer the question, but only parts of it
      – Jounathaen
      Nov 29 at 15:57




      This is correct, but to be picky: It does not really answer the question, but only parts of it
      – Jounathaen
      Nov 29 at 15:57




      1




      1




      Is that better now, @Jounathaen?
      – tylisirn
      Nov 29 at 16:33




      Is that better now, @Jounathaen?
      – tylisirn
      Nov 29 at 16:33












      Shouldn't ripple on a DC supply be fairly easy to correct? AC guy talking here. @Jounathaen Better a good half answer, than a good half answer and a shabby half answer that's only there for statutory reasons.
      – Harper
      Nov 29 at 20:54




      Shouldn't ripple on a DC supply be fairly easy to correct? AC guy talking here. @Jounathaen Better a good half answer, than a good half answer and a shabby half answer that's only there for statutory reasons.
      – Harper
      Nov 29 at 20:54




      1




      1




      Actually it is not that correct. It is a general assumption that linear regulator gives a smooth output. But in fact, it might be worse than a well done buck with filtering. The linear regulator are not good at ripple rejection, if you have an input with ripple, the output will also have significant ripple. Also linear regulator do oscillate on their own and varies depending on the current and capacitive load (capacitive load which varies over temperature if you use ceramic caps, thus you have a temperature dependent ripple).
      – Damien
      Nov 30 at 2:55






      Actually it is not that correct. It is a general assumption that linear regulator gives a smooth output. But in fact, it might be worse than a well done buck with filtering. The linear regulator are not good at ripple rejection, if you have an input with ripple, the output will also have significant ripple. Also linear regulator do oscillate on their own and varies depending on the current and capacitive load (capacitive load which varies over temperature if you use ceramic caps, thus you have a temperature dependent ripple).
      – Damien
      Nov 30 at 2:55














      Rather than a heatsink you can use a power resistor between the 24V and the 5V regulator input to alleviate the thermal load on the regulator.
      – Misunderstood
      Dec 1 at 0:13




      Rather than a heatsink you can use a power resistor between the 24V and the 5V regulator input to alleviate the thermal load on the regulator.
      – Misunderstood
      Dec 1 at 0:13










      up vote
      1
      down vote













      First, make sure your garage uses 24VDC. A more common control voltage in residential wiring is 24VAC, seen in doorbells and thermostats. AC voltage is a big mess for a DC device, but it works with transformers!



      Since it's part of a building, it must reasonably comply with the electrical codes. Fortunately those codes are pretty easy on low voltage (30V) low power (<55W) devices. You will need to use proper enclosures and do wiring to the low standards of doorbell or thermostat wiring (e.g. Neat and workmanlike, don't be stupid, make an effort to staple it out of harm's way, and don't use mains power wiring as a hanger.) So in a Code context:



      A DC-DC converter



      is a great way to handle it. The converter will make less than a watt of residual heat, and will be small, so it will fit neatly into a common, cheap steel 4" or 120mm square junction box. The steel's thermal conductivity and the size of the box will take care of heat dissipation. Its current draw will certainly be within the range available from the opener.



      Code requires the use of "approved" equipment which generally means it is UL listed. "Equipment means "not components": difference being, the equipment has labeling/instructions describing its consumer use, and UL tested and listed it that way. But again, rules are relaxed for low voltage <55W stuff. The point of this is, favor a DC-DC that is packaged more like a finished good, i.e. That has screw terminals and a case, rather than wires sloppily soldered onto a unit meant for PCB mounting. If it's packaged neatly enough, you may not even need a steel junction box to hide it.



      Resistor ladder



      I've worked with resistor laddes a fair bit. For instance, Westinghouse HL traction drive equipment (the L is for line powered, not battery) uses a resistor ladder to synthesize roughly 80V from 600V line voltage. The lower resistor, between load and GND, keeps the voltage from floating upward toward 600V if there is no current draw by the load.



      But the voltage varies considerably, since the lower resistor is paralleled with between 0 and 15 contactors on a 5-car train. This varying of voltage is the Achilles' heel of resistor ladders. You mitigate it by making the upper and lower bypass resistors larger (in watts and physical size, smaller in ohms). For any reasonable working range, the vast majority of power will be consumed in the resistor ladder, not the load.



      In your application, you need to spec your resistor ladder so your voltage stays between 3.3V and 5V at load draws between 0A and 250ma (or whatever measurement proves out). The math isn't overly complicated, but that's a narrow range that I expect will require a fairly enormous resistor ladder. So you're going to be making a lot of heat, and will need appropriate safety caging for the resistor bank. I fully expect this will exceed the supply capacity of the garage door opener's power supply. It may even exceed the 55W statutory limit for relaxed rules for low voltage wiring! All in all, ladders are just not for things with narrow voltage requirements.



      A linear voltage regulator



      Something like a 7805 regulator is a resistor ladder -- but with the lower balance resistor deleted, only the Arduino as the lower resistor, and the regulator as a "smart" upper resistor, changing its resistance on the fly to track the load current. The whole circuit flows whatever the Arduino draws, which is up to 250ma, you say.



      The voltage regulator must dissipate the difference between supply voltage and lutput voltage, e.g. 19-20.7 volts x circuit current. E.g. At 250ma that'd be about 5 watts. That will need to be heatsinked appropriately. Too much to use a 4x4 steel box as an ad-hoc heatsink.



      Almost all voltage regulators are made for external heatsinking, so you have a big packaging problem as far as making it look like "not a science project". And you have to deal with ultimate heat removal: the heat sink has to interchange with ambient air, and you can't just let the junction box get hot.



      Expand mains power at the opener; add a "wall wart"



      A few garage door openers have provisions for a receptacle (mains socket e.g. NEMA 5-15). If not the socket, a pre-cut knockout where a socket could be installed. You could retrofit that.



      Or you could fit a duplex mains socket at the garage door opener's supply, give it a power cord, and now you have an open socket.



      Plug a wall-wart in there and done.






      share|improve this answer

























        up vote
        1
        down vote













        First, make sure your garage uses 24VDC. A more common control voltage in residential wiring is 24VAC, seen in doorbells and thermostats. AC voltage is a big mess for a DC device, but it works with transformers!



        Since it's part of a building, it must reasonably comply with the electrical codes. Fortunately those codes are pretty easy on low voltage (30V) low power (<55W) devices. You will need to use proper enclosures and do wiring to the low standards of doorbell or thermostat wiring (e.g. Neat and workmanlike, don't be stupid, make an effort to staple it out of harm's way, and don't use mains power wiring as a hanger.) So in a Code context:



        A DC-DC converter



        is a great way to handle it. The converter will make less than a watt of residual heat, and will be small, so it will fit neatly into a common, cheap steel 4" or 120mm square junction box. The steel's thermal conductivity and the size of the box will take care of heat dissipation. Its current draw will certainly be within the range available from the opener.



        Code requires the use of "approved" equipment which generally means it is UL listed. "Equipment means "not components": difference being, the equipment has labeling/instructions describing its consumer use, and UL tested and listed it that way. But again, rules are relaxed for low voltage <55W stuff. The point of this is, favor a DC-DC that is packaged more like a finished good, i.e. That has screw terminals and a case, rather than wires sloppily soldered onto a unit meant for PCB mounting. If it's packaged neatly enough, you may not even need a steel junction box to hide it.



        Resistor ladder



        I've worked with resistor laddes a fair bit. For instance, Westinghouse HL traction drive equipment (the L is for line powered, not battery) uses a resistor ladder to synthesize roughly 80V from 600V line voltage. The lower resistor, between load and GND, keeps the voltage from floating upward toward 600V if there is no current draw by the load.



        But the voltage varies considerably, since the lower resistor is paralleled with between 0 and 15 contactors on a 5-car train. This varying of voltage is the Achilles' heel of resistor ladders. You mitigate it by making the upper and lower bypass resistors larger (in watts and physical size, smaller in ohms). For any reasonable working range, the vast majority of power will be consumed in the resistor ladder, not the load.



        In your application, you need to spec your resistor ladder so your voltage stays between 3.3V and 5V at load draws between 0A and 250ma (or whatever measurement proves out). The math isn't overly complicated, but that's a narrow range that I expect will require a fairly enormous resistor ladder. So you're going to be making a lot of heat, and will need appropriate safety caging for the resistor bank. I fully expect this will exceed the supply capacity of the garage door opener's power supply. It may even exceed the 55W statutory limit for relaxed rules for low voltage wiring! All in all, ladders are just not for things with narrow voltage requirements.



        A linear voltage regulator



        Something like a 7805 regulator is a resistor ladder -- but with the lower balance resistor deleted, only the Arduino as the lower resistor, and the regulator as a "smart" upper resistor, changing its resistance on the fly to track the load current. The whole circuit flows whatever the Arduino draws, which is up to 250ma, you say.



        The voltage regulator must dissipate the difference between supply voltage and lutput voltage, e.g. 19-20.7 volts x circuit current. E.g. At 250ma that'd be about 5 watts. That will need to be heatsinked appropriately. Too much to use a 4x4 steel box as an ad-hoc heatsink.



        Almost all voltage regulators are made for external heatsinking, so you have a big packaging problem as far as making it look like "not a science project". And you have to deal with ultimate heat removal: the heat sink has to interchange with ambient air, and you can't just let the junction box get hot.



        Expand mains power at the opener; add a "wall wart"



        A few garage door openers have provisions for a receptacle (mains socket e.g. NEMA 5-15). If not the socket, a pre-cut knockout where a socket could be installed. You could retrofit that.



        Or you could fit a duplex mains socket at the garage door opener's supply, give it a power cord, and now you have an open socket.



        Plug a wall-wart in there and done.






        share|improve this answer























          up vote
          1
          down vote










          up vote
          1
          down vote









          First, make sure your garage uses 24VDC. A more common control voltage in residential wiring is 24VAC, seen in doorbells and thermostats. AC voltage is a big mess for a DC device, but it works with transformers!



          Since it's part of a building, it must reasonably comply with the electrical codes. Fortunately those codes are pretty easy on low voltage (30V) low power (<55W) devices. You will need to use proper enclosures and do wiring to the low standards of doorbell or thermostat wiring (e.g. Neat and workmanlike, don't be stupid, make an effort to staple it out of harm's way, and don't use mains power wiring as a hanger.) So in a Code context:



          A DC-DC converter



          is a great way to handle it. The converter will make less than a watt of residual heat, and will be small, so it will fit neatly into a common, cheap steel 4" or 120mm square junction box. The steel's thermal conductivity and the size of the box will take care of heat dissipation. Its current draw will certainly be within the range available from the opener.



          Code requires the use of "approved" equipment which generally means it is UL listed. "Equipment means "not components": difference being, the equipment has labeling/instructions describing its consumer use, and UL tested and listed it that way. But again, rules are relaxed for low voltage <55W stuff. The point of this is, favor a DC-DC that is packaged more like a finished good, i.e. That has screw terminals and a case, rather than wires sloppily soldered onto a unit meant for PCB mounting. If it's packaged neatly enough, you may not even need a steel junction box to hide it.



          Resistor ladder



          I've worked with resistor laddes a fair bit. For instance, Westinghouse HL traction drive equipment (the L is for line powered, not battery) uses a resistor ladder to synthesize roughly 80V from 600V line voltage. The lower resistor, between load and GND, keeps the voltage from floating upward toward 600V if there is no current draw by the load.



          But the voltage varies considerably, since the lower resistor is paralleled with between 0 and 15 contactors on a 5-car train. This varying of voltage is the Achilles' heel of resistor ladders. You mitigate it by making the upper and lower bypass resistors larger (in watts and physical size, smaller in ohms). For any reasonable working range, the vast majority of power will be consumed in the resistor ladder, not the load.



          In your application, you need to spec your resistor ladder so your voltage stays between 3.3V and 5V at load draws between 0A and 250ma (or whatever measurement proves out). The math isn't overly complicated, but that's a narrow range that I expect will require a fairly enormous resistor ladder. So you're going to be making a lot of heat, and will need appropriate safety caging for the resistor bank. I fully expect this will exceed the supply capacity of the garage door opener's power supply. It may even exceed the 55W statutory limit for relaxed rules for low voltage wiring! All in all, ladders are just not for things with narrow voltage requirements.



          A linear voltage regulator



          Something like a 7805 regulator is a resistor ladder -- but with the lower balance resistor deleted, only the Arduino as the lower resistor, and the regulator as a "smart" upper resistor, changing its resistance on the fly to track the load current. The whole circuit flows whatever the Arduino draws, which is up to 250ma, you say.



          The voltage regulator must dissipate the difference between supply voltage and lutput voltage, e.g. 19-20.7 volts x circuit current. E.g. At 250ma that'd be about 5 watts. That will need to be heatsinked appropriately. Too much to use a 4x4 steel box as an ad-hoc heatsink.



          Almost all voltage regulators are made for external heatsinking, so you have a big packaging problem as far as making it look like "not a science project". And you have to deal with ultimate heat removal: the heat sink has to interchange with ambient air, and you can't just let the junction box get hot.



          Expand mains power at the opener; add a "wall wart"



          A few garage door openers have provisions for a receptacle (mains socket e.g. NEMA 5-15). If not the socket, a pre-cut knockout where a socket could be installed. You could retrofit that.



          Or you could fit a duplex mains socket at the garage door opener's supply, give it a power cord, and now you have an open socket.



          Plug a wall-wart in there and done.






          share|improve this answer












          First, make sure your garage uses 24VDC. A more common control voltage in residential wiring is 24VAC, seen in doorbells and thermostats. AC voltage is a big mess for a DC device, but it works with transformers!



          Since it's part of a building, it must reasonably comply with the electrical codes. Fortunately those codes are pretty easy on low voltage (30V) low power (<55W) devices. You will need to use proper enclosures and do wiring to the low standards of doorbell or thermostat wiring (e.g. Neat and workmanlike, don't be stupid, make an effort to staple it out of harm's way, and don't use mains power wiring as a hanger.) So in a Code context:



          A DC-DC converter



          is a great way to handle it. The converter will make less than a watt of residual heat, and will be small, so it will fit neatly into a common, cheap steel 4" or 120mm square junction box. The steel's thermal conductivity and the size of the box will take care of heat dissipation. Its current draw will certainly be within the range available from the opener.



          Code requires the use of "approved" equipment which generally means it is UL listed. "Equipment means "not components": difference being, the equipment has labeling/instructions describing its consumer use, and UL tested and listed it that way. But again, rules are relaxed for low voltage <55W stuff. The point of this is, favor a DC-DC that is packaged more like a finished good, i.e. That has screw terminals and a case, rather than wires sloppily soldered onto a unit meant for PCB mounting. If it's packaged neatly enough, you may not even need a steel junction box to hide it.



          Resistor ladder



          I've worked with resistor laddes a fair bit. For instance, Westinghouse HL traction drive equipment (the L is for line powered, not battery) uses a resistor ladder to synthesize roughly 80V from 600V line voltage. The lower resistor, between load and GND, keeps the voltage from floating upward toward 600V if there is no current draw by the load.



          But the voltage varies considerably, since the lower resistor is paralleled with between 0 and 15 contactors on a 5-car train. This varying of voltage is the Achilles' heel of resistor ladders. You mitigate it by making the upper and lower bypass resistors larger (in watts and physical size, smaller in ohms). For any reasonable working range, the vast majority of power will be consumed in the resistor ladder, not the load.



          In your application, you need to spec your resistor ladder so your voltage stays between 3.3V and 5V at load draws between 0A and 250ma (or whatever measurement proves out). The math isn't overly complicated, but that's a narrow range that I expect will require a fairly enormous resistor ladder. So you're going to be making a lot of heat, and will need appropriate safety caging for the resistor bank. I fully expect this will exceed the supply capacity of the garage door opener's power supply. It may even exceed the 55W statutory limit for relaxed rules for low voltage wiring! All in all, ladders are just not for things with narrow voltage requirements.



          A linear voltage regulator



          Something like a 7805 regulator is a resistor ladder -- but with the lower balance resistor deleted, only the Arduino as the lower resistor, and the regulator as a "smart" upper resistor, changing its resistance on the fly to track the load current. The whole circuit flows whatever the Arduino draws, which is up to 250ma, you say.



          The voltage regulator must dissipate the difference between supply voltage and lutput voltage, e.g. 19-20.7 volts x circuit current. E.g. At 250ma that'd be about 5 watts. That will need to be heatsinked appropriately. Too much to use a 4x4 steel box as an ad-hoc heatsink.



          Almost all voltage regulators are made for external heatsinking, so you have a big packaging problem as far as making it look like "not a science project". And you have to deal with ultimate heat removal: the heat sink has to interchange with ambient air, and you can't just let the junction box get hot.



          Expand mains power at the opener; add a "wall wart"



          A few garage door openers have provisions for a receptacle (mains socket e.g. NEMA 5-15). If not the socket, a pre-cut knockout where a socket could be installed. You could retrofit that.



          Or you could fit a duplex mains socket at the garage door opener's supply, give it a power cord, and now you have an open socket.



          Plug a wall-wart in there and done.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 30 at 0:42









          Harper

          5,819625




          5,819625






















              up vote
              0
              down vote













              One option that has not been pointed out (as far as I can see), is that you are not limited to choosing only one option. In particular, a buck regulator followed by a linear regulator can give you the best features of both.



              I would suggest a buck regulator to bring the voltage down from 24V to say 9V, then feed the 9V into a linear regulator down to 5V. At 250mA, the linear regulator is only dissipating 1W (9-5=4V x 250mA). Thus the buck regulator does most of the work, and the linear regulator provides a ripple free output.






              share|improve this answer

























                up vote
                0
                down vote













                One option that has not been pointed out (as far as I can see), is that you are not limited to choosing only one option. In particular, a buck regulator followed by a linear regulator can give you the best features of both.



                I would suggest a buck regulator to bring the voltage down from 24V to say 9V, then feed the 9V into a linear regulator down to 5V. At 250mA, the linear regulator is only dissipating 1W (9-5=4V x 250mA). Thus the buck regulator does most of the work, and the linear regulator provides a ripple free output.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  One option that has not been pointed out (as far as I can see), is that you are not limited to choosing only one option. In particular, a buck regulator followed by a linear regulator can give you the best features of both.



                  I would suggest a buck regulator to bring the voltage down from 24V to say 9V, then feed the 9V into a linear regulator down to 5V. At 250mA, the linear regulator is only dissipating 1W (9-5=4V x 250mA). Thus the buck regulator does most of the work, and the linear regulator provides a ripple free output.






                  share|improve this answer












                  One option that has not been pointed out (as far as I can see), is that you are not limited to choosing only one option. In particular, a buck regulator followed by a linear regulator can give you the best features of both.



                  I would suggest a buck regulator to bring the voltage down from 24V to say 9V, then feed the 9V into a linear regulator down to 5V. At 250mA, the linear regulator is only dissipating 1W (9-5=4V x 250mA). Thus the buck regulator does most of the work, and the linear regulator provides a ripple free output.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 30 at 3:05









                  user85471

                  1164




                  1164






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Electrical Engineering Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f409541%2fways-to-power-an-arduino-from-24-vdc%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      If I really need a card on my start hand, how many mulligans make sense? [duplicate]

                      Alcedinidae

                      Can an atomic nucleus contain both particles and antiparticles? [duplicate]