QEMU is an open source machine emulator and virtualizer that can emulate various CPU architectures like x86, PowerPC, ARM, MIPS and SPARC. This document discusses extending QEMU to add support for a new I2C accelerometer hardware and simulating it in QEMU. It describes registering a new device type in QEMU to represent the accelerometer, implementing read/write callbacks to emulate the device behavior, and testing it works with a simple application both in QEMU and on a real Raspberry Pi board.