Air pollution is a contributor to approximately one in every nine deaths annually. To counteract health issues resulting from air pollution, air quality monitoring is being carried out extensively in urban environments. Currently, however, city air quality monitoring stations are expensive to maintain, resulting in sparse coverage. In this paper, we introduce the design and development of the MegaSense Cyber-Physical System (CPS) for spatially distributed IoT-based monitoring of urban air quality. MegaSense is able to produce aggregated, privacyaware maps and history graphs of collected pollution data. It provides a feedback loop in the form of personal outdoor and indoor air pollution exposure information, allowing citizens to take measures to avoid future exposure. We present a batterypowered, portable low-cost air quality sensor design for sampling PM2.5 and air pollutant gases in different micro-environments. We validate the approach with a use case in Helsinki, deploying MegaSense with citizens carrying low-maintenance portable sensors, and using smart phone exposure apps. We demonstrate daily air pollution exposure profiles and the air pollution hotspot profile of a district. Our contributions have applications in policy intervention management mechanisms and design of clean air routing and healthier navigation applications to reduce pollution exposure.