Abstract-The advent of the Internet of Things (IoT) has led to a major change in the way we interact with increasingly ubiquitous connected devices such as smart objects and cyberphysical systems. It has also led to an exponential increase in the number of such Internet-connected devices over the last few years. Conducting extensive functional and performance testing is critical to assess the robustness and efficiency of IoT systems in order to validate them before their deployment in real life. However, creating an IoT test environment is a difficult and expensive task, usually requiring a significant amount of physical hardware and human effort to build it. This paper proposes a method to emulate an IoT environment using the Network Emulator for Mobile Universes (NEMU), itself built on the popular QEMU system emulator, in order to construct a testbed of inter-connected, emulated Raspberry Pi devices.Additionally, we experimentally demonstrate how our method can be successfully applied to IoT by showing how such an emulated environment can be used to detect anomalies in an IoT system.