The paper describes a new biological sensor which represents a resonator based on a segment of a rectangular waveguide of 8 GHz band with shear dimensions of 28.5 × 12.6 mm2. On one side, the resonator is bounded by a metallic short-circuited wall; on the other side, it is bounded by a lithium niobate plate with a porous polystyrene film. This film, applied by centrifugation and modified in high-frequency discharge plasma in argon, was used to immobilize cells of Escherichia coli K-12. This resonator was connected through a coaxial-waveguide adapter to the S parameter meter, by means of which the reflection coefficient S11 in the plane of the lithium niobate plate was measured. The addition of an aqueous solution of ampicillin at 4-50 μg/ml to immobilized cells led to a significant change in the reflection coefficient of S11 from - 10.15 dB to - 15.09 dB. At the same time, the resonance frequency changed insignificantly within the range 8.06-8.068 GHz. The optimal time for modifying the polystyrene film for obtaining the required porosity and the optimal time for the immobilization of the bacterial cells were determined. The immobilized cells retained their activity for 4 months at a temperature of 4 °C. The study showed the promise of such a biosensor to determine β-lactam antibiotics in aqueous solutions by using ampicillin as an example. The limit of detection of the developed biosensor with respect to ampicillin was established (4 μg/ml).