In situ observation of dust grains from various origins is routinely performed by space missions equipped with radio instruments. These measurements consist in observations of voltage pulses or their spectral signature. It has for long been proposed that one of the mechanisms able to produce these pulses is the collection by the spacecraft of electric charges generated by impact ionization. Here for the first time, a complete theoretical model of how pulses are generated by charge collection is proposed. In the solar wind at 1 AU, the pulses are shown to be shaped by local plasma and photoelectron parameters. However, the situation can be different in hotter or denser plasma environments. We use the data provided by the STEREO/WAVES (S/WAVES) radio instrument onboard the twin STEREO spacecraft to validate our model. We find that the observations indeed strongly support the theory. The proposed model is an important step forward, since it makes it possible to reproduce the shape, timescales, and amplitudes of pulses generated by dust impacts in various space environments. Such a model can be used to infer the dust detection abilities of radio instruments onboard different spacecraft and can help the design of dust detection optimized radio instruments for future missions.