We describe an autonomous, fully functional implementation of the BB84 quantum key distribution protocol using open source hardware microcontrollers for the synchronization, communication, key sifting and real-time key generation diagnostics. The quantum bits are prepared in the polarization of weak optical pulses generated with light emitting diodes, and detected using a sole single-photon counter and a temporally multiplexed scheme. The system generates a shared cryptographic key at a rate of 365 bps, with a raw quantum bit error rate of 2.7%. A detailed description of the peripheral electronics for control, driving and communication between stages is released as supplementary material. The device can be built using simple and reliable hardware and it is presented as an alternative for a practical realization of sophisticated, yet accessible quantum key distribution systems.Received: 11 Novembre 2015, Accepted: 7 January 2016; Edited by: O. Martínez; DOI: http://dx.doi.org/10.4279/PIP.080002Cite as: I H López Grande, C T Schmiegelow, M A Larotonda, Papers in Physics 8, 080002 (2016)This paper, by I H López Grande, C T Schmiegelow, M A Larotonda, is licensed under the Creative Commons Attribution License 3.0.