Aperture priority mode producing underexposed photos?
It's a nikon d40 and for some reason when I try to switch to Auto ISO it tells me it can't be used with the current settings, though I know it can. Trying to shoot outside in natural overcast sunlight so I set the ISO to 400 but no matter whether I try a small or large aperture the photos keep coming out nearly pitch black.
I guess the first thing you need to do is learn and fully understand the fundamentals of photography.
Using auto ISO is rarely a good idea in any case. The ISO you choose is going to be based upon how much light there's and if you are willing to accept some noise caused by using high ISO settings.
When shooting in natural overcast days, your main concern needs to be the white balance you use. In this case, pick "cloudy" in the D40 white balance menu
You really have to use the cameras lightmeter to assure that you are NOT grossly underexposing the image (black)
At this point you seem to be making arbitrary changes in the cameras shutter speed, lens aperture, ISO, etc, without a clear idea of how to get a good exposure.
Here is a link that should help you learn how to balance ISO, shutter speed and lens aperture.
There's a slight chance that you have accidentally moved the exposure compensation control to automatically underexpose All your images. Look on page 47 on your user manual for more detail
Not to totally insult your intelligence, but you do have the lens cap off of the camera right? Sorry, but I had to ask just to get the obvious out of the way.
One thing that isn't so obvious is the exposure compensation. You could have the exposure compensation set to something like -3 which would cause this to happen.
If you're in aperture priority, then camera should automatically adjust the shutter speed as you change the aperture. Therefore, the brightness of the image should stay the same as you change the aperture setting.
You don't mention the lighting conditions or what exposure mode you were in, or provide examples or links to examples of these shots. All would be very helpful in determining what's going on.
Check that Exposure Compensation is at zero.
Some random thoughts:
Does it work OK on shutter priority and program mode? If it doesn't then the shutter may have failed.
Sure you have set the mode dial correctly? Haven't set it to M in error? Is the dial's registration correct? In other words when the dial points at A is the camera in aperture priority mode or is it out of sync and set to M or S? Do all the other settings do what you expect?
In Aperture priority mode take multiple photos of the same outdoor daylight scene at ISO 200 and apertures f/5.6, F/11 and F/22 then set the ISO to 800 and apertures f/5.6, f/11 and f/22. Does the shutter speed sound different as you make the changes? Look in the EXIF data of the photos you have taken. Has the shutter speed varied at all as you have adjusted aperture and ISO? Is the shutter speed fixed at somewhere around 1/200th? Does it think you have deployed a flash?
Go indoors by a brightly lit window. Take the lens off. Set to aperture priority mode, look into the throat and fire the shutter - does everything move as expected? Mirror flips? Shutter fires? Now set to M mode and a shutter speed of 1 second - does the shutter stay open long enough for you to see the sensor? If it doesn't, your shutter has failed.
As others have said - check your exposure compensation setting.
Look down the lens so you can see the aperture blades - fire the camera at f/22 and f/5.6 - is there an obvious difference in the size of the aperture? Is it really snappy? Should close down to the set aperture really sharply and open fully in the same way at the end of the shot.
Is the view finder clear and bright? Lens no permanently stopped down?
Put the camera on auto and see how the photos turn out. Set the ISO to 100 for sunny day outdoor photos.
It's an old camera, it may have something wrong with it.