Codes P0401,P0402- Faulty DPFE sensor
Known problem,Ford extended the warranty on this to 5 years or 50 k miles...
Known problem,..Heres the TSB on it
Some 2001-2003 F-150, 2004 F-150 Heritage and 2001-2003 E-150/250 vehicles equipped with a 4.2L engine may exhibit the malfunction indicator lamp (MIL) on with diagnostic trouble codes (DTCs) P1131 and/or P1151 (system too lean bank 1 or 2). This condition may be due to leaking isolator bolts/port gaskets in the upper-to-lower intake manifold mounting area. This condition is sometimes intermittent and may not be apparent on a warmed-up engine.
Perform a self test. If DTC P1131 and/or P1151 are the only codes stored in the powertrain control module (PCM) proceed to Step 2. If any additional DTCs are present, follow normal diagnostic procedures found in the PC/ED Manual.
Remove the upper intake and replace only the port gaskets (9H486) and isolator bolt assemblies (9S479). The new isolator bolt assemblies use a rubber material that is green in color, do not install the old isolator bolt assemblies with the black rubber material. Do not replace any other intake parts or gaskets.
While the upper intake manifold is removed, check the exhaust gas recirculation (EGR) orifices that are pressed into each primary port of the lower intake manifold. If any of the orifices are plugged with soot, clean and unplug them with a pick and solvent.
PART NUMBER PART NAME
1L3Z-9H486-AA Port Gasket
3F2Z-9S479-AA Isolator Bolt
Codes P0171,P0174 are due to a vacuum leak somewhere,usually at the intake manifold upper and lower gaskets area...
PCV valve hose elbow
Before addressing these codes,address the others first,these may be due to the others..fix those first ,clear the codes and see if these reset..may not..
They may all be related