An automatic focusing mechanism (100) is suitable for a digital camera in
a portable electronic device. A preferred embodiment of automatic
focusing mechanism includes a barrel (1), a holder (2), an optical module
(3), and an image sensor structure (4). The barrel receives at least one
lens (10) therein. The holder receives the barrel and the image sensor
structure therein, and the thickness of the optical module can be changed
for focusing. The optical module is located between the barrel and the
image sensor structure. As the thickness of the optical module can be
changed for achieving the purpose of focusing, the thickness and weight
of the digital camera can be decreased.