Voltage drop in latching circuit, cant figure out why.

Hi guys, I have built myself a latching circuit from transistors to turn off an Arduino automatically.

First of all I would like to explain that I cant use low power mode, because my memory is tapped out, theres no more room for any more code in the sketch. Therefore I have to take an external approach to shutting down the arduino after x amount of time.

So to the problem...
I have built the latching circuit shown here:
https://forum.arduino.cc/index.php?topic=455653.0
![](http://<a href=)Arduino-auto-off2-schem-1">

The circuit is identical in all manner except for the input voltage, which is 5v, and connected directly to the 5v pin on the UNO.

It works perfectly until I connect a small TFT display to the UNO, then the voltage drops to 3v.

The output voltage of the buck converter remains at 5v, so the voltage drop is happeneing somewhere in the latch circuit.

I have measured current draw with the display connected, and its only 60mA, the transistors are rated to 800mA, so I dont think current draw is the issue.

I have added an extra BC327 in parallel to see if it would make a difference, but no change.

I believe it might have something to do with the resistor values in the circuit, but I am not sure how to calculate the correct values for this type of circuit.

I would appreciate any help :slight_smile:

Use a P-Channel as a high side driver you will not get the voltage drop. You will automatically get a 0.7V drop across the transistor when in saturation. Driving it as you are you will get more. Change the lower 10K resistor to something in the 800 ohm range. The 10K emitter base resistor is fine. A rule of thumb in a common emitter circuit is you will have a hard gain of 10. With that in mind you will get about 40 mA which would cause what you describe. I know if you drew the schematic and did the calculations you would have caught that.

Hi, thanks for the reply. As I mentioned, im not sure how to calculate the correct values in this circuit.

Change the lower 10K resistor to something in the 800 ohm range.

Do you mean this one?
![](http://<a href=)Arduino-auto-off2-schem-2">

That BC327 base resistor sets the current that can flow trough the PNP transistor.

Sorry, can you please clairfy?
Do you mean to say that the 10k resistor between the base of the BC327 and the collector of the BC337 controls how much current flows through the collector and emmiter of the BC327? Is yes, do I need more or less resistance there?

Yes.

The smaller the resistor the more base current.

The more base current the more collector current is allowed through the BC327.

Could I remove it completely? Or is that not reccomended?

If you changed the 10k resistor to 0Ω when the BC337 turns ON the base emitter junction on the BC327 would blow up.

Haha ok, understood.

What is the relationship between the base current and the e/c current?
If i allow sa 60mA to flow through the base, does this been 60mA will flow through e/c?

In this case you want to have the BC327 go into saturation, i.e. turn ON all the way when it has base current flowing.

If there is a tiny amount of base current, the BC327 enters into the linear region of operation i.e. the voltage across the BC327 becomes significant and the transistor is out of saturation.

When the BC327 is out of saturation, the transistor starts to dissipate heat and can get too hot.

When out of saturation, there is less voltage for the load.

I guess what I meant to ask is, how does one calculate the required base resistance, or base current?

Suggest you do some experimenting.

Try a 2.2k resistor.

Measure the voltage across the BC327 i.e. Vce.

This should be smaller 0.3v if the transistor is saturated.

I added a 10k in parallel, with 5k VCE is about 0.4v. Unfortunately I dont have any other resistors on hand, Ill have to order some. Maybe I just throw a poti in there and play around untill I find the right value.

Thanks for taking the time to explain this, I really appreciate it. Ill mess around a bit and let you know how I get on.

If you use a potentiometer, be very careful you don’t adjust it too low.

If you do B A N G ;).

For circuit safety, add a series resistor (maybe 470Ω) to the potentiometer.

You might try eliminating the voltage dividers in your circuit, and see if that makes any difference.

Arduino-auto-off2-schem-alt.png

Arduino-auto-off2-schem-alt.png

mickymik:
I guess what I meant to ask is, how does one calculate the required base resistance, or base current?

Basically in BJT, base current * hFE = collector current.
The base current you need is the collector current you want divided by hFE.
Look for the datasheet of the your transistor and check for the hFE value.
However, when using it as like a switch, it uses a base current that is several times larger than the calculated value because it is saturated and used.

And how to calculate the base resistance.
Divide the value obtained by subtracting Vbe(basically 0.7 V) from the voltage applied to the base by the base current.

Find and read the info that explains the basic usage of BJT.

Note:
Please be careful, MOSFETs and BJTs are both transistors, but the two are different mechanism.
BJT is controlled by current, MOSFET is controlled by voltage.

I have given up on using transistors. I am really stuck on this project... Maybe someone can help with a solution.

The project is a 12v compressor I built, which uses an Arduino/2.8 tft lcd display to show pressure and switch a relay according to how much pressure is in the tanks.
There will be a 3.7v lipo included.
If the compressor is not connected to 12v you can push a button and the arduino will power up via the latch circuit for 20 seconds or so to show how much pressure is in the tanks.
If the compressor is connected to 12v then the lipo will charge.

I have the modules set up as follows:
12v -> Buck (5v) -> TP4056 (with protection) -> 3.7 lipo -> Latch -> Step-up (5v) -> Arduino/display.

Tha fact that I still have to press the latch button to power up the arduino when connected to 12v doesnt bother me.

To stop the device turning off with 12v connected I plan to connect a digital pin diectly to the buck, then the latch pin will only be written low if the buck pin is low.

I set everything up and measured how much current the step-up draws, and it seems to draw about 400mA.

I did the math described above and came up with a few different values (there was no specific HFE value in the datasheet, rather min and max values) and I came up with a resister size of approx 1k.

I built the circuit and It works without the display connected, but with the display connected the voltage drops to around 3v still. If I connect the lipo directly to the step-up the voltage stays at 5v.

I changed the resistor value to 500 ohms, current draw rose to about 600mA, the transistor started to get warm, but voltage still dropped to 3.5v with the display connected.

I would like to build a latch using MOSFETs, and I found this plan:

The problem is I searched for this particular MOSFET and it costs 20 euros.

Is there some other kind of MOSFET I can use that isn't super expensive?

And is there any way to simplify this circuit, or are all components needed?

Note:
NDP6020P has Vgs max. of ± of 8V


I have used these:

https://forum.arduino.cc/index.php?action=dlattach;topic=445951.0;attach=373590


BTW NDP6020P on amazon are inexpensive.


An AO4614B has both a P and N channel MOSFET in one package.

I found this, his project only has a current draw of 50mA, but the parts he is using are locally available and very cheap. What are your thoughts?

The problem with the NDP6020P is locally they are expensive, or I can order from over seas but it will take forever to arrive.

Also, which values are important? What do I need to look for in the data sheet to know if it will handle the current I need?

Add a 10k from D7 to GND.

Home work: