Current leakage - ATMEGA328 project

Thread Starter

anifort

Joined Jun 8, 2024
2
Hello everyone, I am working on a small project using ATMEGA328 (AM for short)..
I use a voltage regulator to power the AM and then one of the output pins of the AM is connected to an LED+ resistor and Ground.
I power my AM using an L7805 voltage regulator and I noticed that when the ground in my circuit is not connected (but the LED is connected to ground as that is "outside" of my circuit/control) , the LED is bright. I was able to determine that there was a current leakage from the voltage regulator to the output pin and that made some sense since the regulator works without the ground but is not "regulaterd"

I then added a p-channel mosfet to be off if ground is not present and I could not make that work... I discovered that in this setup there was a reverse voltage from the ground of the voltage regulator and the gate of the mosfet... I then applied a diode in both those components and this seemed that solved the issue however I am not sure this is the right approach as when i see arduino schematics or other L7805 schematics they do not use diode at ground..

Few questions:
1) Do i need a 2 diodes, one after the L7805 and one after the mosfet or only one on a joint of this 2 components?
2) Do i need the diodes where i placed them (D1 and D4 in diagrams) or do i need to add a diode to every chip's ground i have on my board (CD4050 , ATMEGA etc..)
3) anything else to consider? any reccomendations to better ceparate the main source/ground with the rest of the circuit?
 

Attachments

Thread Starter

anifort

Joined Jun 8, 2024
2
Thats not a problem, but this is for a critical application and it should not activate the atmega output if the ground cable comes loose or eaten by a mice . There must be a more bulletproof way
 
Top