Powering Arduino: Switching between battery and DC-plug power


I'm developing a handheld Arduino temperature/datalogging project that I would like to be able to power using 4x AAA batteries connected to the Vin port on the Arduino so that measurements can be made remotely. However, I would also like to be able to power the unit using a switching power supply (9V 1A wall wart) through the DC-jack for longer-term monitoring when AC power is available. Are both of these power options possible in the same unit without removal of the batteries?

I have general electrical/wiring skills, but I do know that these questions are currently at the edge of my "for-sure" knowledge and I'd rather not ruin the Arduino or have a battery meltdown. Can someone describe how I might wire this "dual-power" design so that is works properly?

My understanding (which is quite possibly wrong) is that the Vin is actually connected to the DC-jack and if this is the case I can imagine issues such as reversed current flow when the unit is powered by the 9V wall wart, if the batteries are not isolated. Is this true? If so can you offer recommendations for how to isolate the batteries? Place a diode between the Vin and the batteries? If this is the right route can you recommend how to size the diode?

I may be off base too and would appreciate any help clarifying misconceptions I may have about the issues involved in this design

Thanks for you help,

There is a diode between the DC jack and the Vin pin. Check the schematics for
more details. Adding another diode (schottky preferred) would allow completely
mutually isolated supplies.

4xAAA alkaline would be 6 volts -.7v for the diode, a bit low for vin to work properly.

Thanks for your help. I do realized that the 6V is already bit low for the Vin, but I can't really fit more than 4xAAA in my enclosure. Is a second diode necessary or is it just a more complete design? I do worry that if the voltage drop over an additional diode between the batteries and the Vin pin is -0.7V that I'm looking the 5V pin not truly producing 5V.

I looked at the schematic and it looked like the diode between Vin and the DC jack would prevent current from going from Vin to the DC jack, but I'm a bit more concerned about current going the other way towards the batteries when the DC jack is in use. Is this a realistic worry/concern? If so the diode is probably necessary and the current design needs to be rethought so I can have a greater starting voltage from the batteries.

Thank you,