This paper presents an all-optical difference engine (AODE) sensor for detecting the defects in printed electronics produced with roll-to-roll processes. The sensor is based on the principle of coherent optical subtraction and is able to achieve high-speed inspection by minimising data post-processing. A self-comparison inspection strategy is introduced to allow defect detection by comparing the printed features and patterns that have the same nominal dimensions. In addition, potential applications of the AODE sensor in an on-the-fly pass-or-reject production control scenario are presented. A prototype AODE sensor using a digital camera is developed and demonstrated by detecting defects on several industrial printed electrical circuitry samples. The camera can be easily replaced by a low-cost photodiode to realise high-speed all-optical information processing and inspection. The developed sensor is capable of inspecting areas of 4 mm width with a resolution of the order of several micrometres, and can be duplicated in parallel to inspect larger areas without significant cost.