<p>An optical device is disclosed. The optical device includes a first packaging unit and a second packaging unit. The first packaging unit includes a first lead frame and a sensor electrically coupled to the first lead frame. The second packaging unit includes an emitting die and a second lead frame. The emitting die has an optical axis and is operable to emit a light. The second lead frame has a first portion disposed within the second packaging unit and a second portion extending into the first packaging unit so that an angle of about 5-85 degrees is formed between the optical axis of the emitting die and the sensing plane of the sensor.</p>