The purpose of this paper is to present a real time basis-deviation measurement system based on BB84 module. As BB84
module is the essential module in QKD receiver system, the basis-deviation measurement system can be directly
implanted into the QKD receiver system to detect the polarization of photon current in real time during quantum key
distribution. BB84 module distributes the incident photon current into four photon currents with the polarization of H
(Horizontal), V (Vertical), + (+45°) and - (-45°). Their energies can be detected by four APD photon-detectors.
Basis-deviation compute equation is deduced with the Stocks-vector of the optical devices path in BB84 module. The
energies of the four distributed photon currents are collected in real time and then input to basis-deviation compute
equation to calculate the basis-deviation. There is error bears on the effects produced by the optical elements in the BB84
module, so we built a set of software module to foundation the process of the real time polarization measurement system
working. Thus we can see how all the parameters of the optical elements effects the calculation results. At last, we built a
polarization photon current generator which can produce photon current with continuous changing polarization and a real time basis-deviation measurement system based on BB84 module in laboratory.