Hi Jiggy-Ninja and everyone else reading,
I've been experimenting around for days now and I can't seem to get what I want.
The closest I've gotten is to use 100 Ohm and 75 Ohm on that divider and the MOSFET works AND the current consumption of my project is around 9.5mA.
When I use higher value resistors in the divider, the current consumption increases to around 16mA or more.
HOWEVER - you are quite correct and these are not ideal values that I'm using - in fact my MOSFET switching circuit I believe is bordering on unstable. There appears to be a VERY fine line between the MOSFET being on, off or not coming on at all.
My circuit is currently like this:-
- My 12V Battery Powers a DC Converter which is giving out 4V.
- The 4V from the DC Converter goes to an AMS1117 3V3 Regulator and the MOSFET Source Pin
- The AMS1117 3V3 power goes to just the Atmega.
Using that circuit, I have been experimenting with various combinations of input voltages (3.7 - 5V) as well as different resistor values in the divider in an attempt to get a good balance between a solid switching circuit and low power consumption but I am failing miserably.
At one point, I got everything to run nice and stable and I thought I'd cracked the problem but apparently not.
Using the circuit above with 100 and 75 Ohm divider resistors, I was providing 4.02V from the DC Converter and from that I was getting around 4V at the MOSFET Source Pin. At the Gate Pin I was getting around 3.5V and on the Drain Pin I was getting around 0.3V
This combo was working very well for ages on breadboard so I decided to mill out a quick prototype PCB of the circuit so far. I built that PCB up and it worked but I began to notice it wasn't as stable as the breadboard prototype.
I began to observe strange behavior from the MOSFET on my scope. I have Probe connected to the MOSFET Gate at the Resistor Voltage Divider and one Probe connected to the MOSFET Drain Pin.
What happens is the MOSFET appears to turn on but at only 2.5V at the DRAIN then turns off again and then comes back on again at 3.99V at the DRAIN Pin and it runs fine. So I made the assumption it must be something in my code with the pin states or something.
Convinced it was a code issue - rather than attempt to hunt it down, I thought I'd mill out a second identical prototype and build that up so I had a spare to experiment with and this is where the problem with the my MOSFET circuit became more apparent.
This PCB and it's MOSFET behave really badly. It is exactly the same as the first PCB. Nothing has changed - it uses the same value components etc and yet it is wildly more unstable.
For a start it doesn't like being fed the same voltage as the first PCB. It wont turn on.
If I increase the Voltage to say 4.2V then I get around 2.5V sat on the Drain Pin and the MOSFET wont work. If I decrease the Voltage to say 3.8 - 3.9V then I get a very strange thing happen with the MOSFETs Drain Pin.. it fluctuates between 1 - 2.5V and instead of a flat line on my scope, it becomes more of a Saw Tooth and it's very erratic.
I believe at this point, I'm somewhere between the MOSFET being ON and OFF and it's too fine of a line so it's on, off, on off. Unstable basically.
So If I drop the Voltage further to something like 3.7V, the MOSFET turns off. I get MAX Voltage on the Source Pin and Nothing on the Drain pin except perhaps a few mV flickering in and out. But the MOSFET wont come on.
So what I am trying to actually achieve is a low powered Arduino circuit controlling a MOSFET to turn devices on and off while consuming as little current as possible in standby.
I've been over and over and over Nick Gammon's stuff (who recommends turning off devices using a MOSFET to save power while asleep), I've read about MOSFETs until my eyes are sore and stinging and I've burnt every candle in the house at both ends for days but I'll be the son of a gun if I can get anything stable or anywhere near the uA range. I'm struggling to get below 10mA.
I've tried writing unused pins in various states, I've tried writing used pins in various states when asleep. I'm using Low Power Sleep routines in my code to shut down the Atmega as much as possible for 8 secs at a time. I'm running the Atmega at 3V3 (or very near to it) using the 8Mhz internal clock.
I don't know what more I can do to save any more power and have a stable MOSFET switching circuit that works....
Don't get me wrong, 10mA is an impressive improvement over my previous design which consumed some 40mA at standby but I'm driven by the overwhelming urge to get it lower. But first I need to work out how to get this MOSFET stable at the power I'm looking for.
Now I know I originally started out experimenting around with a transmitter for a fox hunt device but I have now become consumed by the urge to consume less. It's an itch that just isn't being scratched lol.
Funny how you start a project with one goal but then something comes along that just niggles away at you until you crack it. I'm not going to be happy until I've gotten a stable power switch and a circuit that uses very little power in standby...
What I've done now is to take the second PCB I milled (the most unstable one) and I have de-soldered the resistors from the MOSFETs voltage divider. In place of them I have soldered in some single female header pins so now I can experiment with different value resistors at will without destroying my prototype PCB.
All of the MOSFETs I ordered are in place on these two prototype PCBs along with the Transmitters so I'd like to salvage these PCB prototypes if I can and make them work.
Onwards and Upwards........