Automatically adapting the camera exposure time is crucial for industrial applications where minimum human intervention is usually desirable. However, it is very challenging to realize such a capability for a conventional fringe projection system where only a finite increment of the exposure time is allowed due to its digital fringe generation nature. We study the generation of sinusoidal fringe patterns by properly defocusing binary ones, which permits the use of an arbitrary exposure time. This provides the potential to adapt the exposure time automatically. We present the principle of an automatic exposure technique and show some experimental results.