An injection device includes a cartridge configured to hold a volume of fluid, the cartridge having a proximal end and a distal end through which the fluid is dispensed; a stopper disposed in the cartridge and configured to move from the proximal end toward the distal end to cause the fluid to be dispensed through the distal end of the cartridge; and an electronic device disposed at the distal end of the cartridge, the electronic device including an emitter configured to transmit a signal toward the stopper, a receiver configured to receive reflections of the signal from the stopper, and a controller configured to wirelessly transmit data related to a position of the stopper in the cartridge.