Help protecting components when connecting microcontroller to USB

Hi,

When connecting my microcontroller to the PC from this FTDI port with an FTDI to TTL, the PC will provide +5V to the microcontrollers VCC pin. Will this cause current to flow from the VCC pin into the LED through the LDO? What do I do here?

I added a Schottky to prevent high voltage to enter the PC when the battery is connected (just in case), but what happens when the battery isn’t connected?

Not a schematic problem but a general electronics design question so moved to projects.

Hi @mangekyo

I should comment, before answering your question, that this forum is really about the use of Kicad.

Maybe, eventually, if the Reg. destructs.

Is your L7805 a LDO regulator or a 78L05? If only a 78L05, make sure there is headroom from the battery (battery produces enough volts for regulator to regulate).

Regulators generally don’t like their output voltage being higher than their input voltage so, if you disconnect the battery with the PC operating, chances are, you will destroy the regulator.
In this case you need to protect the regulator from the PC supply destroying the reg. if the battery is low or disconnected.
You can protect the reg. with a diode in series with the output, however this will drop the voltage to your processor. If the processor will run at 5V minus the diode voltage drop, good. If not, you will need a reg. with an output of 5V plus the voltage drop.

Most data sheets suggest a diode from pin 3 back to pin 1 of the reg to prevent this problem, but, as you have a battery connected, I don’t think this solution is a great idea.

My intention is to leave the post in place for a short period in case somebody has a quick comment or pointers to more information so that some benefit can be obtained but to close it after a short period to forestall any follow-ups.

My naive solution would be to simply add a diode after the regulator in the intended current flow direction and if necessary adjust the regulator (or its voltage) to account for the added voltage drop. For example if your diode drops 0.4V, use a 5.4V regulator instead of a 5V one. (or use an adjustable voltage one and adjust the voltage accordingly. You can also build a very low voltage drop diode using mosfets.

1 Like

Generally yes, but…
There will be voltage drop from 7805 OUT pin to IN pin.
Not sure how big - let us assume 1.5V.
If battery voltage is for example 9V (i guess) and LED is Red (about 1.8V drop) then you have about (9-1.8)/1k = 7.2mA LED current when battery is connected and about 5V-0.4V-1.5V-1.8V=1.3V/1k=1.3mA - much dimmer LED.
The reverse current through 7805 is danger for it provided it has enough high value. 1mA will not be a problem.
The problem is when 5V is connected to FTDI socket and capacitor connected to 7805 IN pin is loaded through 7805 reverse current (completely discharged battery could also be a problem). 100nF is not a problem. The 100uF capacitors in this place could be a problem for 7805.
From schematic we are not sure if there is anything else connected to +BATT net.

If you power anything from 2 sources the simplest solution is to use 2 diodes in place of connecting these sources.

I would never used LDO shortcut for 7805. For me LDO means Low-Drop, and 7805 is classic regulator with drop voltage over 1.5V (LDOs can have 100…300mV).

Try to find such one :slight_smile:
You can add diode in series with 7805 GND pin. The drop at that diode will make the GND pin voltage rise and the output voltage will rise respectively.

Here? And if they’re too rare/expensive, just use an adjustable one (or adjust the value yourself as you suggested).

I was sure there are no such regulators (never searched for 5.4V) I am really surprised they exists.
But only first 4 positions are on stock and all of them are small - low power dissipation allowed.
One of them has input voltage max of 6.5V. Certainly too low. Two have 10V - I will be afraid using such if there is 9V battery. We have no info about battery voltage - may be it is 12V. Only one allows up to 25V, but minimum is 8.4V (can be not acceptable).
Using untypical elements is something I avoid like fire - that is the reason I have never considered 5.4V regulators. But in single, prototype construction untypical element is not a problem.

Hi @mangekyo

This is probably the easiest way to protect the Regulator and still get 5V to the processor.

The voltage drop across D3 = the voltage gain across D1

ksnip_20221105-224335

Any comments accepted :slightly_smiling_face:

1 Like

What is the function of D2?

Probably not really needed in this case as D3 is present.
It is to protect the regulator from load feedback. It is something I have always used when using a pot. to adjust an output voltage. Usually have another diode from pin 3 back to pin 1 also.

Thanks for the replies. I didn’t know the forum is generally about the use of KiCad. I thought its also for help with creating circuits. Could you point me to a forum where my post would be appropriate?

This is the design for Arduino Nano. They did not include any diodes on the output of the LDO. How do they protect the circuit?

Try eevblog, they have a beginner section.