how to power our projects is an
important question in this video I will
focus on mains-powered projects and try
to establish a step-by-step approach to
get to the right decision Gritty
youtubers here is the guy with the Swiss
accent with a new episode and fresh
ideas around sensors and
microcontrollers remember if you
subscribe you will always sit in the
first row in this video we will start
with the needs of our project look at
the different available possibilities to
connect the project domains in a future
video we will probably do the same for
batteries and finally find the right
questions to ask to find the right
solution I also will provide a decision
tree let's start with the properties of
mains power as an energy source for our
projects mains power is quite simple if
we focus on small hobby projects its
capacity is unlimited compared with our
needs its voltage is quite constant it
is very cheap if used in small doses and
it has no relevant current limits first
we always need a power supply that
transforms 110 or 220 volt AC to a low
DC voltage for simplicity I distinguish
between USB power supplies and others
all USB power supplies can deliver 5
volts and at least 1 ampere most of the
newer power brakes deliver two or more
amperes so they definitely are an
excellent choice also for Raspberry Pi
projects I still have lots of these old
bricks with different voltages like 9 or
12 volts and I still use them because
they are easy to use and the more
important reason it is far easier to
mount around power jack than a micro USB
plug into my cases if your project needs
more oomph you get those bigger power
supplies they all look similar and you
get them for all voltages and amperage
it is good to have a few laying around
in your lap just in case one of those is
inside this power supply for example and
you get these PCB power supplies for
smaller projects they can be used if you
do not want to have a separate case for
your power supply but you have to pay
attention if you use one of those
because the mains voltage gets very
close to your project so definitely the
preferred solution is a USB power supply
and if you watch video number 244 you
even can paint them up to at least 12
volts if they are QC compatible as the
next point we have to divide the needs
of our projects into categories fivefold
projects 3.3 world projects and other or
mixed voltages projects fivefold
projects mainly use old Arduino boards
or are powered through USB 3.0 volt is
the new standard also the newer Arduino
boards use it and others are projects
which need higher voltages because they
use motors for example how can we
connect the power sources with our
projects here we can mainly distinguish
between four possibilities a direct
connection linear regulators switching
regulators and others if the output
voltage of our power brick is the same
as the voltage of our project we can
directly connect it if our project needs
different voltages or if the power
supply voltage is higher than the
project voltage we need voltage
regulators to drop it in mains powered
projects you rarely find so-called boost
converters which create a higher output
voltage usually you start with the
highest needed voltage we will cover
boost converters in the batteries video
linear regulators destroy the voltage
difference between the input and the
output by converting it into heat
therefore they have a terrible
efficiency which is not critical for
mains power and low power projects
switching
regulators transform the voltage by
switching the power supply on and off
this usually creates some noise on the
output wires as well as in the air
around the device but they are very
efficient and others include unregulated
power supplies as well as power supplies
which only use capacitors and resistors
for very low power we will not cover
this category in the video let's now
take a typical project to find out the
questions we have to ask this recently
Biltmore's a trainer consists of an ESP
32 a small audio amplifier and a ps2
keyboard the first question is mains or
battery-powered I will use it in my lab
and therefore it can't be powered by
mains so it fits in today's video the
next two questions we have to ask are
which is the highest voltage our project
needs and how much current does it
consume the ESP 32 can be powered by 3.3
volts the keyboard runs on five faults
and the audio amplifier needs at least 5
volts better would be more because it
would provide a louder tone the current
will be quite small for sure less than
200 milli ampair with short spikes
produced by the ESP 32 but with a big
capacitor we can reduce these spikes so
what is the highest voltage used by this
project we could say it is 5 volts
because also the audio amplifier would
work at that voltage I decided for a 9
volts supply because I still have a few
of them lying around and I can power the
amplifier with a higher voltage in
addition with this 9 volts input we can
learn on how to dimension a linear
regulator I decided to use one of those
vemos ESP 32 ports because I still have
a few of them from my various tests and
because I anyway need 5 volts for the
keyboard so our drawing looks like that
9 volts in directly connected to the
audio amplifier by the way as long as
you connect oh
grounds you can have as many voltages as
you want in parallel next we need a 5
volts power supply for the keyboard and
the WHMIS here the following question
has to be answered shall we use a linear
or a switching regulator this depends on
the following two questions how much
power has to be dissipated by a linear
regulator and can we live with noise on
the power cables or in the air cable
noise can be heard in audio applications
and air noise can disturb sensors or
radios for example many viewers report
false alarms of PIR or radar sensors
because of proximity of an ESP Wi-Fi
antenna which emits some energy or noise
into the air our application can
comfortably live with a little noise we
do not want to listen to classical music
just to a Morse signal so we have both
choices a linear and a switching
regulator but what about the parrot
dissipation because linear regulators
usually are small parts
I would like to use such a 7805
regulator in ATO 220 case the smaller 78
lo5 with its 150 milli ampere limit
would be too small the dissipated power
is 9 - 5 volts times 0.2 ampere equals
0.8 watts
because the heat is created inside on
the junction of the chip and has to be
transported to the air around the case
we have to find the value for the
thermal resistance from Junction to
ambient it is called theta and measured
in degrees centigrade per watt and also
depends on how the part is cooled if we
do not cool the tio 220 case this factor
is around 60 degrees Celsius per watt so
the silicon chip will heat up 60 times
0.8 watts equals 48 degrees we could
reduce the degrees per what if we
mounted the regulator to a heat
or solder it to a PCP with lots of
copper if you are too lazy for that
calculation you choose the Swiss sky
method power it up with the maximum
expected load and put a finger on the
regulator just make sure you really put
the finger on the regulator otherwise
you might see some magic smoke because
smaller cases have values of more than
100 degrees per watt they heat up faster
this is probably one of the reasons the
78 lo5 in a small tio 92 package only is
rated for 150 milli ampere by the way
all those linear regulators need these
two additional capacitors to run stable
and you get those regulators for
different voltages and even an
adjustable voltage version all have in
common that they have a minimal drop out
voltage this means that the input
voltage has to be higher than the output
Plus dropout voltage we will lay to see
that a low dropout voltage is essential
for battery-powered project for project
connected to mains it is usually not
critical the other important parameter
twice and current is also not relevant
for mains powered projects of course we
could have used a small switching
regulator like this one it is not much
bigger than the tio 220 case of the 7805
has a maximum input voltage of 12 volts
and the maximum current of 2 ampere it
has a tiny trimmer to set the voltage
not convenient and even dangerous
because if unintentionally moved towards
a higher voltage the over voltage
quickly kills your MCU maybe it is good
practice to put some hot glue on the
trimmer to fix the voltage a much better
solution is this port with fixed
voltages you just place a solder blob
where needed and you are sure the
voltage stays correct here is the
promised decision tree and we can see
what we did the highest voltage is 9
volts a linear 7805 can easily dissipate
the power
and we could live with noise in
principle we could use a linear or a
switching power supply because the 7805
is small I decided to go with this one
let's go on with the next possibility
and Arduino project without other
components here we can use a USB power
supply or one of those fixed voltage
ones for seven to 12 volts the five volt
at we knows all have linear 5 volt
regulators and a second one for 3.3
volts the second one is connected to the
5 volts rail and therefore can't be
smaller so they used a similar decision
tree for their decision by the way I use
the word rail this word is commonly used
if you have more than one voltage in a
device each voltage has its own
distribution rail next case the highest
voltage of the ESP development boards is
5 volts because of the usb-to-serial
chip and they also need 3.3 volts for
the es piece so 5 volt is the highest
voltage and they go this route and use a
am s 1 1 1 7 linear regulator for their
3.3 volt rail these sports usually have
no 5 volt regulators and therefore you
would blow up the usb-to-serial chip if
you used more than 5 volts and if you
are out of luck also your PC by the way
switching regulators also can get hot
the calculations for these regulators
are much more complicated and generally
not the chip itself but the inductor
gets hot so put your finger on this part
too if you use the sophisticated Swiss
sky method ever to power supplies in
general for most applications USB power
supplies are more flexible than these
old-fashioned pricks they can be used
for many purposes especially qz rated
supplies are fascinating because we can
make them deliver 9 12 or even more
volts as shown in video number 244 why
not power delivery or PD supplies
because this technology is still hard to
handle
from acres I do not know how to make
them deliver 12 volts for example and
all those USB power supplies are of the
switching type otherwise it would not be
possible to create such small and
powerful devices old-fashioned power
supplies use 50 Hertz transformers to
reduce the voltage use a full bridge
rectifier and PV capacitors to create DC
and then a linear regulator these power
supplies still are the first choice if
you do not want to have noise typical
for high end audio applications for
example but they are big heavy and
expensive and how can you distinguish
between conventional and switching mode
power supplies without opening the case
no you do not need expensive instruments
just lift them then you know summarized
always start with the highest needed
voltage use the decision tree to get to
the right decision on how to power your
projects it shows when to use linear and
when switching power supplies and always
use at least the Swiss guy method to
dimension the regulator or the heatsink
this is all for today please comment if
I should do a similar video about
battery powered devices as always you
find all relevant links in the
description I hope this video was useful
or at least interesting for you if true
please consider supporting the channel
to secure its future existence thank you
bye