I too want both supplies (3.3v and 5v) in my circuit and made these schematics:
On 5v supply typical load current is ~8mA.
On 3.3v it is ~30mA.
Regulators are lm1117 in both cases,sot-23 packages and no timing issues Which one is better?
Depending on your input voltage, but at that low current, it makes no real difference. You would simply be changing which one gets the bigger energy wastage (in watts).
The LM1117 shown in your picture has a 5mA quiescent current, a minimum load current of 1.7mA, and typically up to 800mA regardless of the package. 15v Max input. You are using 9v, through a diode.
This is simple Ohm's Law calculations for Power (P = I * V)
Since they are Linear regulators, Current in is Current Out. For the first schematic, that means
For the second schematic, its almost the same. 3.3v drop for the 5v regulator, but 8.3v - 3.3v = 5v drop for the 3.3v regulator. Since the 5v regulator doesn't carry the 3.3v's load, it's just
In any case, the 0.218W in heat is nothing to be concern about. The regulators won't even get warm, let alone hot enough for a heatsink.
The first circuit requires the 5 V regulator to dissipate more power than the second does, because its current load is much higher.
The second circuit requires the 3.3 V regulator to dissipate more power than the first does, because its voltage drop is much higher.
If you can replace one of your regulators with a smaller/cheaper part by using one or the other version, that should drive your decision.
For example, in the second circuit you might be able to use a tiny SOT-23 regulator for the 5 V.
Or in the first circuit you might be able to use a smaller package or avoid using a heat sink on the 3.3 V regulator.
Which is better? is a too broad question. Better in what sense? Current source capability? Voltage drop? You need to provide the judgement factor. The second one has follow advantages over first:
The specified LM1117 "dropout voltage" is 1.2V max at low current so the 3V3 regulator with 5-3.3 = 1.7V "headroom" will be OK.
The 1st circuit does not allow 3V3 out with 5V off. This may or may not matter in your case.
The 1st circuit has potentially better power input noise rejection due to having two regulators in series BUT construction has to be done with due care to achieve this in reality.
At the power levels mentioned max dissipations are small and either arrangement is OK heat wise in almost any situation. At higher power levels the 1st circuit limits the amount of power you can get at 3V3 due to heating of the 5V regulator by the 3V3 current. Not an issue here.