Dual power supply: really needed? DIY or buy?

Hello, I’m making a simple climate control for my aquarium and currently I’m puzzled with selecting a correct power supply.

Schema description: Arduino UNO with a bunch of sensors connected + RTC + 4 relay shield + LCD2004.
So I need to power Arduino, a fan (using TIP120 to control its speed) and presumably I need a separate power for relay shield.

I’d like to have only 1 power supply for this whole setup. Given that, it looks like I won’t be able to completely isolate the relay shield, since it’s going to be using the same power supply as Arduino.

Arduino needs 9v, relay 5v and fan 9-12v (and I’m struggling to determine the current each of these units need). So I was thinking either get some power supply like this: 60W-Dual-output-5V-12V-Switching-power-supply which seems to be a bit of an overkill or get a decent 9v 2-3a wall wart and use L7805 with capacitors to power the relay.

Any cons and pros of either of approaches? Currently I tend towards L7805, since it’s cheaper, probably gonna be physically smaller and it won’t look like I’m buying a power plant to power a single lamp. But then again, is a complete relay isolation that important?

Thanks in advance for any advice.

antti_s: I'm struggling to determine the current each of these units need.

The usual procedure is.... look up info about each device used. Get details of power consumption of those devices. Add up the estimated maximum power consumption. The maximum power output of the power supply should be significantly higher than the max power demand.

Thanks, that's what I'm trying to do. It's quite easy for relay: from datasheet 71,4 mA x 4 and for fan: label says 12v 0,23 A; so at 9v it should draw about 0,173 A. Though, I couldn't get definite datasheets for every sensor and Arduino, so I assume following current draw: Arduino Uno: 80 mA LCD 2004A: 4 mA + 260 mA (backlight) DS3231: 0,3 mA DS18B20: 1,5 mA IR Receiver: 5 mA DHT22: 1,5 mA BMP280: 0,003 mA.

If I'm correct in presumption, that I just have to sum up the currents, the total draw is 810 mA.

If my calculations are correct and given that I'm currently doing a prototype without a fan and using just two relays, the draw should be 0,5 A. The wall wart I use produces 1 A. Question: why when I switch on a relay the backlight of LCD dims a bit?

It depends on how you have everything wired. If you pull all required power from the Arduino 5V pin, you're probably overloading the on-board regulator.

Note on the 7805: it will need to dissipate power (e.g. 9V -> 5V), so might need a heatsink. In which case it's not that small anymore ;)

@sterretje, thanks! You're right, currently everything is powered from Arduino's 5V pin, so it looks like whether or not I want relay completely isolated, they should be powered not via Arduino.

I'm aware that I'll need a heatsink, but I think even with it the size of the whole assembly would be smaller than if I was to use a dual output power supply.

I had heating issue with 7805 and 7809. My requirement was to stepdown 12v to 9v for the Nano, I had to use 12v as my relays runs in 12v. The heat 7809 was producing was too high and I didnt have any space in my board for a heatsink. So i had to connect 12v to Nano’s VIN.

In the new version of my system I am using 328 alone, so I had to find a better step down approach and my search leads to LM2575 switching regulator. In my experiments these switching regulators produce less heat. To build this power supply I just followed the schematic provided with LM2575 datasheet. I also etched a board to power my 328, earlier the system was running in a bread board.

The above system provides 5v(LM2575) and 3.3v (via LM1117)

Two suggestions from me:

  1. Power the Nano with 5V through it's 5V pin with a regulated 5V supply. No need for 9V for the Nano.
  2. Relays are so last century! What purpose are you using them for? If it is for switching 12V or 24V DC, use MOSFETs with logic-level gates. They are much more efficient.

Paul

@PaulRB I'm using Uno, not nano. Relays I use for water pump, lights and heater, all operate from 220v, so I don't see any reason not to use relays or use something instead.

@sarouje, thanks, I'll check the LM2505, though, I don't yet completely get what's the advantage of using it in my case vs. 7805.

Fair enough, using relays for switching 220VAC is a safe option.

But Uno or Nano can be powered from a regulated 5V supply, removing the need for a 9V supply.

PaulRB: But Uno or Nano can be powered from a regulated 5V supply, removing the need for a 9V supply.

Could you please explain why? In some specs for uno I've read, that you should power it with something that is at least a bit more than 5v

antti_s: Could you please explain why? In some specs for uno I've read, that you should power it with something that is at least a bit more than 5v

If it's a regulated 5v then you can directly connect to 5v and thus powering the system. But not advisable to connect 5v to VIN, which is connected to an onboard regulator and need more than 6 or 7v to step down to 5v.

PaulRB: Fair enough, using relays for switching 220VAC is a safe option.

But Uno or Nano can be powered from a regulated 5V supply, removing the need for a 9V supply.

Uno can be powered with 5V DC if the supply is from USB right?

Otherwise, the DC input jack can be used (except for Nano, which doesn't have one), where the arduino website reckons 7 to 12V DC recommended. Although, various arduino users recommend a reduced range (not 7 to 12V). So, not sure why the arduino site sticks with the same range all the time (instead of amending it - maybe the original recommended range is ok).

And if the USB port or DC jack is not used, then there's the option of supplying external (either unregulated or unregulated) DC voltage to the Vin pin, which gets treated by the arduino's onboard voltage regulator.

In one of my system I powered one of my Nano with 12v unregulated power to VIN, it's running 24/7 without any heating issues for last couple of months. I guess 12v to VIN is not an issue.

antti_s:
Could you please explain why? In some specs for uno I’ve read, that you should power it with something that is at least a bit more than 5v

By connecting a regulated 5V supply to the 5V pin, you bypass the Uno’s on-board regulator. It is the on-board regulator that needs 6.5V or more to create a 5V regulated supply

I guess 12v to VIN is not an issue.

If you will run into an issue or not - that's a question of the voltage drop times the mA, which the Arduino draws. The internal 5V regulator has to bear the load:

the regulator reaches a temperature of 67°C for each Watt to dissipate

and the maximum temperature it can bear is about 120° Celsius - which is already really hot and will not contribute to a long life in comfort for the poor regulator ...

Let's say, you are drawing 350 mA total, then your regulator has to deal with: - (12V - 5V) x 0.35A = 2.45 W !! which is way too much for the 7805 onboard regulator.

Following is an excerpt of this website with maximum power consumption values:

– 12 V Power Supply: I = 2 / (12-5) = 2 / 7 = 285mA

– 9V Power Supply: I = 2 / (9-5) = 2/4 = 500mA

– 7 V Power Supply: I = 2 / (7-5) = 2/2 = 1A

sarouje: In one of my system I powered one of my Nano with 12v unregulated power to VIN, it's running 24/7 without any heating issues for last couple of months. I guess 12v to VIN is not an issue.

It all depends on how much current is being drawn @ 5V by your circuit. If only a small current is drawn, the regulator will get barely warm. If a lot of current is drawn, it will heat up and is life will be reduced.

sarouje: In one of my system I powered one of my Nano with 12v unregulated power to VIN, it's running 24/7 without any heating issues for last couple of months. I guess 12v to VIN is not an issue.

Till you start drawing a lot of current out of the 5V pin ;)

No I am not drawing much current from the 5v pin or from GPIO, that explains why it's not heating.

Thanks for the answers and discussion, so it looks like I'd be better off powering arduino with 5V via 5V pin, since arduino itself will only have few sensors and an LCD2004 to power.

Next question is LM2575 vs LM7805 for 9V -> 5V step down. I've read the specs, but I don't yet get why I should choose one over the other. So far the only difference that I see for myself is that LM2575 should produce less heat, anything else I'm missing? Also again from specs looks like the circuit for LM2575 is bit more complicated (i.e. has got more elements).

And finally regarding the relays and isolation. I'm using relays to control 220V devices. If I'm going to use one power supply for arduino and relay, there isn't really a complete isolation between those two, right? How critical is it to have one?

So... the only component needing 9V is the fan? Have you tried the fan on 5V? Is it too slow at 5V? It might be simpler to use a 5-9V or 5-12V voltage booster for the fan!

As long as your 5V PSU has enough current to run everything, plus a decent margin, isolating the relays should not be necessary. If in doubt, add some fat caps (470uf) to soak up the extra demand when the relays switch.