Do all autofocus cameras need motors to drive the lens? I would have thought today's modern electronics rendered motors obsolete.
There are several good answers and relevant comments already.
I'll address a possibly ambiguous point.
You said - "Do all autofocus cameras need motors to drive the lens?"
Others have explained that a "Light field" or Plenoptic camera (Wikipedia) does not need to move the lens at all to alter focus, so does not need focus motors as nothing moves.
However, you also said " ... I would have thought today's modern electronics rendered motors obsolete."
You may have meant that perhaps some thing other than a motor may be used to move the lens elements in some modern cameras.
Loosely speaking, anything that provides mechanical movement can be regarded as being a motor. By that definition, if anything moves mechanically then a motor must be involved.
However, there are various means by which movement can be achieved with a "motor" that is different or very different from traditional ones. Not all of these are (yet) used in camera lenses.
A common motor which is included inside lenses is the SSM or USM = Supersonic Motor or Ultrasonic motor.This Wikipedia article gives a good description. An ultrasonic motor is often a subset of piezoelectric motors which use electrical constriction or expansion of a crystal ti impart movement. Wikipedia noites -
An ultrasonic motor is a type of electric motor powered by the ultrasonic vibration of a component, the stator, placed against another component, the rotor or slider depending on the scheme of operation (rotation or linear translation).
Ultrasonic motors differ from piezoelectric actuators in several ways, though both typically use some form of piezoelectric material, most often lead zirconate titanate and occasionally lithium niobate or other single-crystal materials.
The most obvious difference is the use of resonance to amplify the vibration of the stator in contact with the rotor in ultrasonic motors. Ultrasonic motors also offer arbitrarily large rotation or sliding distances, while piezoelectric actuators are limited by the static strain that may be induced in the piezoelectric element.
It is not essential to use piezoelectric action to produce an SSM / USM but this is usual.
Superb short flash animations of piezo actuators in action
This is the Minolta CCD antishake piezo actuator system at work rather than focus drive but demoinstrates the basic principals superbly.
Traditionally lens elements must be moved in order to change the focus, as you must alter the path light takes through the lens, thus a motor is required to move the glass. However this will not always be the case.
Lytro recently produced the worlds first commercial light field camera. The idea is that this camera captures not only the intensity of the incoming light but a measure of the incident angle of different rays. This allows the effect of different focus settings to be calculated mathematically enabling you to "refocus" an image long after it was captured, using a computer. No motors or moving parts are necessary.
Other than Light Field cameras, movement for autofocus is needed. Some cameras have motors but many do not. The smaller Nikon, like D3100 do not have a motor for example. Instead, there is a motor in each lens. The bigger Nikon, like D4, have motor but also work with lenses having a motor.
So, it is not absolutely needed but is normally needed either in the camera or in the lens. The Light Field camera I have never seen but read that it is very restricted and actually has a focus motor because there is a limit to the possible focus change from Light Field.
You always need some means to move the lens, but it may not be a motor in a traditional sense. For example, you can reshape a liquid lens by applying a voltage across it, with no moving parts except the liquid.
It is also possible that some micro cameras like those on cellphones or integrated webcams use electromagnetic focusing. This is the method used to focus some CD/DVD drive lenses, where part of the elements are mounted in such way that different voltage applied to a number of coils cause movement of the focusing element.
I Have seen this mechanism in action and in some cases they have a wide motion range compared to the size of the elements. The size of a typical CD optic pickup is rather bigger than the lenses found in cellphones.
From an electric design point of view, these mechanisms are more similar to a solenoid than to a motor.