Apple Hardware Test (AHT) and Apple Diagnostics (AD) Codes

Use SMC Sensor Codes to interpret Apple Software Diagnostics(ASD) output. ASD is available only as a bootable DMG images which should be burned on 
Apple Diagnostics(AD) replaces built-in Apple Hardware Test(AHT) for devices manufactured after 2013. Some older devices will also load AD instead of AHT if you update the OS or use Option+D to download it online. Many older devices lose AHT after upgrading your OS, since it wipes it from the hard drive and its not available online. 
AHT Codes are more complex and give more information on the issue. 
The first part is a device name: 
*4ETH: Ethernet controller
*4IRP: Main Logic board
*4MLB: Logic board controller
*4PRC: Processor
*4HDD: Hard disk
*4MHD: External disk
*4YDC: Video card
*4SNS: System sensor
*4MOT: Fan motor
*4MEM: Memory module
*4AIR: AirPort wireless card
Most of them pretty straight-forward except 4SNS which will be follower by either V (Voltage or Current sensor) or T for thermal sensor. 
*A: Ambient Air Sensor
*B: Battery
*C: Central Processors (CPU)
*D: DC (Direct Current)
*e: PCI-Express Slot
*F: FireWire Port
*G: Graphics Processor (GPU)
*H: Hard Disk
*h: Heat Sink (or Heat Pipe)
*L: LCD display
*M: Memory (or Memory Riser Boards)
*m: Miscellaneous (Peripherals such as a Battery Charger)
*N: North Bridge (Logic Board Controller)
*O: Optical Drives
*P: Power Bus
*p: Power Supply
*s: Trackpad
*W: Airport Wi-Fi Card
For example: 4SNS/1/40000000: TA00 means Ambient thermal sensor. 
If your device is newer than 2013 or you booting it online from some older devices, there's AD which is much less reliable and kind of helps you to book an appointment in Genius Bar instead of showing the real issue. Use Apple MRI to gather more information. 
AD Codes
Code 	Explanation 	Actual Board problem
ADP000 	No issues found 	
CNW001…06	Wifi not detected 	
NDC001…6 	Camera not detected 	
NDD001 	USB Overcurrent 	
NDK001 	Keyboard problem 	
NDL001 	Bluetooth 	
NDR001 	Trackpad not detected 	
NDR003 	 	
NDR004 	 	
NDT001 	Thunderbolt issue 	
NDT002 	Thunderbolt issue 	
NDT003 	Thunderbolt issue 	
NDT004 	Thunderbolt issue 	
NDT005 	Thunderbolt issue 	
NDT006 	Thunderbolt issue 	
NNN001 	A serial number was not detected. 	Don't forget to correct SN/CRC/CleanME
PFM001 	There may be an issue with the System Management Controller (SMC).
Almost always means that there is a short or a missing communications line (data and/or clock) between a component and the SMC. 
Often means thermal or current sensor failure. 
Most common problem after water damage.	
PFM002 	There may be an issue with the System Management Controller (SMC).
Almost always means that there is a short or a missing communications line (data and/or clock) between a component and the SMC. 
Often means thermal or current sensor failure. 
Most common problem after water damage.	
PFM003 	There may be an issue with the System Management Controller (SMC).
Almost always means that there is a short or a missing communications line (data and/or clock) between a component and the SMC. 
Often means thermal or current sensor failure. 
Most common problem after water damage.	
PFM004 	There may be an issue with the System Management Controller (SMC).
Almost always means that there is a short or a missing communications line (data and/or clock) between a component and the SMC. 
Often means thermal or current sensor failure. 
Most common problem after water damage.	
PFM005 	There may be an issue with the System Management Controller (SMC).
Almost always means that there is a short or a missing communications line (data and/or clock) between a component and the SMC. 
Often means thermal or current sensor failure. 
Most common problem after water damage.	
PFM006 	There may be an issue with the System Management Controller (SMC).
Almost always means that there is a short or a missing communications line (data and/or clock) between a component and the SMC. 
Often means thermal or current sensor failure. 
Most common problem after water damage.	Trackpad on 820-00165
Battery on 820-01958
PFM007 	There may be an issue with the System Management Controller (SMC).
Almost always means that there is a short or a missing communications line (data and/or clock) between a component and the SMC. 
Often means thermal or current sensor failure. 
Most common problem after water damage.	
PFR001 	There may be an issue with the computer's firmware. 	
PPF001 	There may be an issue with the fan. 	
PPF003 	There may be an issue with the fan. 	
PPF004 	There may be an issue with the fan. 	
PPM001 	There may be an issue with a memory module. 	
PPM002 	There may be an issue with the onboard memory. 	
PPM003 	There may be an issue with the onboard memory. 	
PPM004 	There may be an issue with the onboard memory. 	
PPM005 	There may be an issue with the onboard memory. 	
PPM006 	There may be an issue with the onboard memory. 	
PPM007 	There may be an issue with the onboard memory. 	
PPM008 	There may be an issue with the onboard memory. 	
PPM009 	There may be an issue with the onboard memory. 	
PPM010 	There may be an issue with the onboard memory. 	
PPM011 	There may be an issue with the onboard memory. 	
PPM012 	There may be an issue with the onboard memory. 	
PPM013 	There may be an issue with the onboard memory. 	
PPM014 	There may be an issue with the onboard memory. 	
PPM015 	There may be an issue with the onboard memory. 	
PPP001 	There may be an issue with the power adapter. 	
PPP002 	There may be an issue with the power adapter. 	
PPP003 	There may be an issue with the power adapter. 	
PPR001 	There may be an issue with the processor. 	
PPT001 	The battery was not detected. 	
PPT002 	The battery will need to be replaced soon. It is functioning normally, but holds less charge than it did when it was new. 	
PPT003 	The battery will need to be replaced soon. It is functioning normally, but holds less charge than it did when it was new. 	
PPT004 	The battery requires service. The battery is not functioning normally, though you may not notice a change in its behavior or the amount of charge it holds. You can continue to use your battery before it’s checked without harming your computer. 	
PPT005 	The battery is not installed properly. Shut down and discontinue use. The computer requires service. 	Check battery communication cable on 2015 and later models.
PPT006 	The battery requires service. The battery is not functioning normally, though you may not notice a change in its behavior or the amount of charge it holds. You can continue to use your battery before it’s checked without harming your computer.	
PPT007 	The battery needs to be replaced. The battery is functioning normally but holds significantly less charge than it did when it was new. You can continue to use the battery until you replace it, without harming your computer. 	
VDC001 	There may be an issue with the SD card reader. 	
VDC003 	There may be an issue with the SD card reader. 	
VDC004 	There may be an issue with the SD card reader. 	
VDC005 	There may be an issue with the SD card reader. 	
VDC006 	There may be an issue with the SD card reader. 	
VDC007 	There may be an issue with the SD card reader. 	
VDH002 	There may be an issue with a storage device. 	
VDH004 	There may be an issue with a storage device. 	
VDH005 	Unable to start OS X Recovery. 	
VFD001 	There may be an issue with the display. 	
VFD002 	There may be an issue with the display. 	
VFD003 	There may be an issue with the display. 	
VFD004 	There may be an issue with the display. 	
VFD005 	There may be an issue with the display. 	
VFD007 	There may be an issue with the display. 	
VFD006 	There may be an issue with the graphics processor. 	
VFF001 	There may be an issue with the audio hardware.