Indeed there seems to be a tiny battery on the logic board as Gabe says above.
Ok, went ahead and desoldered this tiny "battery" from the Macbook Aluminum 5,1 logic board, it can be seen here:
As it was not obvious what the heck it really is as it has metal soldering tabs attached to its body and I had to remove them to see its enscripted part number data. Before the "operation" I measured 2.8V on it and it is too low for the usual and similarly looking lithium button battery so I had to check it on my quest to solve my random unexpected shutdown problems.
So..... [Drum Roll] it is this one: XH414HG and you can see in the SII data sheet that it is not a battery but a 80 000microFarad / 3.3 Volts Super Capacitor!
SO, DEFINETELY NO PRAM BATTERY - it is a SUPER CAPACITOR in the Macbook 5,1 model for sure!
BEWARE: With the capacitor detached the macbook does not power up with the AC adaptor only - it needs to have its removable main battery inserted!
(I believe that is the reason they removed this PRAM capacitor on the next 13inch "Pro" aluminum 5,3 model since it has a non user removable battery that always powers the PRAM continuously).
More electronic info:
The voltage the Logic Board feeds to this super capacitor is 2,82 volts. I put a 47microFarad capacitor in its place and measured ca. 4 microAmperes flowing from the capacitor towards the logic board upon main battery and AC disconnection.
Using this data, according to the Capacitor data sheet, if we say that the minimum holding voltage for the PRAM is 1.5Volts then the capacitor feeds the PRAM for more than 5 hours after main battery and AC disconnection if no power button is pressed - sorry, forgot to check/verify if the PRAM capacitor is depleted upon power button depressed while no main battery and AC connected...
(Just FYI: Me, trying to remove it I had the wider solder pad broken away from the PCB - no problem, it is just the common ground connection for the battery eeeeh capacitor - IF I decide to put another one back there, I'll just connect the (-) of the capacitor at another common ground point on the PCB - for the time being I'll stay capacitor less, since I never remove the main battery, and see how it goes...)
P.S. Oh, forgot to mention the capacitor must be the IV01E subtype (soldering tabs geometry differs per subtype).
I am not 100% sure but IT SEEMS I SOLVED MY UNEXPECTED SHUTDOWN PROBLEMS: I've been using as usual my Macbook Aluminum 5,1 and I have not had a single random unexpected shutdown since the removal of the PRAM battery/capacitor. No software changes/updates to explain this change for the better.
I AM NOT SUGGESTING THAT ANYONE WITH UNEXPECTED SHUTDOWNS GO REMOVE THE PRAM CAPACITOR FROM THE LOGIC BOARD but it seems it works for me wiping the frustration from my face, at last! So I'll keep it that way.
I only had a couple of battery related shutdowns at charge levels under 15% since my macbook does not want to recalibrate its (not genuine) battery charge gauge. This is not out of the ordinary since I bought the battery 4-5 months ago. It has nothing to do with 100% charged whether on AC power or not with the OEM battery or not sudden unexplained shutdowns frustrating me for the last 2 years. Thank god they were not happening often or the macbook would have flown out the window...
Why it now runs OK? Well, I have a theory: The latest 10.7/10.8 operating systems are resource hogs so power consumption is much higher than it was when this machine was designed. Spikes of extra power drawn when intensive tasks like Flash are launched could push the voltage of the main logic board feed point momentarily lower than the voltage of the PRAM capacitor/battery by, say 0.1 or 0.2 volts or more. This could cause an erratic SMC reaction that causes the system shutdown. Without schematics and/or extensive logging of course this is just a theory. I 'll stay how I am and if I get other unexpected shutdowns, I'll post here again.
Well, almost a month later of heavy use, the past two days I had a couple of the dreaded unexpected shutdowns, one on 50-60% battery and one on AC power. Two more during the past month were attributed to battery charge under 15% so I was ready to post that removing the PRAM capacitor fixed at last my unexpected shutdown problem but now I am at loss again- only difference is the mildly higher temperatures of Springtime over here....
DO NOT REMOVE THE PRAM CAPACITOR TO FIX RANDOM UNEXPECTED SHUTDOWN ON MACBOKK ALUMINUM 5.1 ==== Well, the dreaded shutdowns have been happening the last few days as random and as rare as before the removal. The removal of the PRAM capacitor I performed a month ago must have coincided with a Flash update that had to do with the problem diving ou of view for a month until I installed the latest Flash update which brought it back, almost as I was ready to cry out "Success, Eureka!!", me stupid :-(
From what I have seen so far it must have to do with the GPU (not CPU) temperature/load spiking and the problem showed up along Flash becoming more and more a resource hog over the years. At least, this is what me expert believes... Sometime I'll look into dismantling the Macbook and placing some thermal paste in there and we'll see - hmm, I'll turn off Flash from Youtube next time I encounter a shutdown - it seems that it usually happens when some video is palying in some tab or so...
A couple of months after the new 10.9 OSX Mavericks was installed, the shutdowns continue appearing but seemingly quite a bit less often - or it could be the cool winter time... Problem continues to be intermittent but is rare enough to keep the machine on the working desk and not out-the-window... I conclude this report by saying it seems a bit more stable under 10.9 - still capacitorless.
Well, I report that unexpected shutdowns continue happening on unrelated basis to heat/load/time/weather/mood/whatever reason... Sometimes they happen 2-3 times a day for 3-4 days in a row on light/moderate/heavy load/heat and then disappear for more than a week on various load/heat combinations... No difference with the PRAM capacitor removed. I have got accustomed to the idea that I will get rid of them when I ditch this particular Macbook maybe for something cheaper next time...
Now on Yosemite, 250HD+500HD (replaced DVD,both not SSDs) the same behavior continues: Stable for days or having 2-3 blackouts out of the blue in hours. However, now with a not original battery, 8GB constantly full RAM and driving an extra 2048x1152 monitor, I see signs that the extra current load of the 2nd HD puts extra strain on the PSU circuit - if it crashes with battery remaining 30-40% it refuses to power-up on the battery alone as the 2 HDs draw too much current on spin-up. I have seen some ever-so-slight instant brownouts on the backlight on heavy load occasions. So I guess that Apple screwed up on the power supply design and some rare combination of load (current) spikes puts some IC in there in shutdown condition causing the blackouts.
However, my Macbook is now in its 6th year of life (heavy use during the past 4 years) so I am calling it a day on this, even so it has provided me full value for its $$.
If only Apple said "oups, we screwed up here, sorry" I would be 100% ok with the situation.
PROBLEM SOLVED!!! BUT REALLY!?!?!?!?
A couple of weeks ago, just for fun I swapped the mains adaptor of my all-too-often-shutdowing Macbook 5,1 Aluminum with the mains adaptor of my even older White Polycarbonate Macbook 2,1 which runs for years at home as a file server (despite suffering under the rooftop hot Summer and cold Winter days temperatures)
=== Guess what !!!====
The old Macbook Aluminum now runs rock steady with the older and seemingly similar PSU of the old white Macbook! The very old white Macbook also runs rock steady as it always did with the newer alu’s PSU… ***AAARGH!*** It was that simple! I now guess the Alu Macbook power demand spikes every now and then and its own mains adapter/PSU cannot keep up with the power surge. It seems the Macbook does not take any extra power from the battery when power demand spikes and instead shuts down! It seems that the older white Macbook’s adaptor/PSU can provide more power than the newer adaptor/PSU so the Macbook Alu does not shutdown out-of-the-blue anymore when running from mains power. Side by side both mains adaptors look the same, the older one being yellowish instead of white after running for many hot summers now…
So IF YOU EXPERIENCE UNEXPLAINED SHUTDOWNS ON YOUR MACBOOK ALUMINUM 5,1, SWAP THE MAINS ADAPTOR and this could be the fix! (If I see anything wrong I’ll report back but 2 weeks now my Macbook Alu runs 100% ok!).