I'm trying to make a AA battery replacement battery for a vintage computer because its actual battery has gone bad. Its of the NiMH type and I'm pretty sure those are charged with a constant current. I want to make sure that my alkaline batteries don't get accidentally charged if the AC adapter were to be plugged in. Would a diode prevent the constant current charger from charging my AA batteries?
It would (for all intents and purposes - there is always some leakage). However, a more significant issue is the fact that it will also drop almost half of you AA battery voltage - and thus waste half of the energy inside the battery. There are two options to mitigate this:
Battery protection circuits with some form of switch, such as a mosfet: These exist and use a circuit that will open a mosfet when power is applied from the output.
Alternatively, you could just use a NiMH battery and allow the system to charge it.
The voltage must be the same ( within 20% est.) and the current is likely to be less than a few mA which will not create significant damage.
I recently repaired an old le Croy DSO that someone had replaced a 2.4V 2S NiCd pack with a Lithium 3.6V primary CR2 cell. It failed to work due to a faulty plated thru hole. I fixed that then the RTC worked, but then it started to fail booting until I examined the schematics to see it was used in areas with 3.3V logic and 3.6V could be latchup problem. SO I inserted an LED to measure current by intensity. It was barely visible (<1mA) and the 1.6V drop to 2V was too much for the RTC to function, but it booted. So then I replaced the series LED with a Si diode in series with the 3.6V battery to get 3V and then it worked for RTC and booted successfully.
Moral of the story.
Don't change backup battery voltage and chemistry unless you know the implications.