I've had my D5100 for a few months and recently purchased the Nikon AF-S DX 35/1.8G lens for it, however I'm having some real problems with the autofocus. I took it with me on a trip without testing it out much beforehand and it probably ruined a few dozen good shots before I realised that it did not reliably autofocus using the viewfinder, only when using the LCD. Even when using single-point autofocus without recomposing the shot it was consistently off, usually with the focus ending up on the hair near the back of the subject's head instead of the eyes and face. Had to make do with the LCD for the rest of the trip which was often a pain due to the slow AF, battery use and glare in sunny weather.
Here is a test I did with it at f1.8, subject distance just over 1m, focusing on the number '2016' near the barcode on the side of the box.
This first image was using the viewfinder, single-point AF: http://postimage.org/image/hxmped8qd As you can see the focus seems to be somewhere around the end of the barcode some 4cm further away.
What is the problem here, is the camera faulty, or is it a bad lens? Or are the results expected due to the shallow depth of field? I tried to do some further testing at higher f-numbers and comparing to the 18-55 kit lens and I think it still doesn't focus correctly but it's much harder to see without the shallow depth of field.
#1. "RE: D5100 + Nikon AF-S 35/1.8G autofocus problems" In response to Reply # 0
I have such a lens and it has a manual focus override ring. If you have the time you sometimes need to hold the shutter button half way down to make autofocus work the manually adjust outside ring.
But another issue may the eye piece diopter adjustment you hold camera up to eye Glasses off (or own). and move the adjustment up or down until what you see is in sharpest focus. (I use Glasses off). (Doesn't necessarily have to be in focus. Just the sharpest focus.)
#3. "RE: D5100 + Nikon AF-S 35/1.8G autofocus problems" In response to Reply # 2
Thank you for the replies. However it is not accidental shifting of the focus ring that is the problem. I have made sure not to touch anything and to use the correct focus point, and the AF will still consistently set the focus slightly behind the subject when not using live view, only occasionally getting it right.
#4. "RE: D5100 + Nikon AF-S 35/1.8G autofocus problems" In response to Reply # 3
Welcome to Nikonians! Sorry to hear of your problem. The issue could be the lens and not the body. Go to your local Nikon Dealer and try another copy of the 35mm f/1.8G AF-S on your camera. If the problem continues with another lens, the issue is likely in the body. If another copy of the lens works correctly exchange it for a new one (assuming you are still within the exchange period) or send the lens to Nikon Service for adjustment. Good Luck and Enjoy your Nikons!