Circuits / Sensors
Obstacle alarm with an FC-51 module
The nearer the object, the more infrared comes back and the lower AO; past Vref OUT goes low and the PNP lets the active buzzer's current through. The trimmer sets the distance: about 4 cm at 25 %, 9 cm at 50 % and 28 cm at 90 % (white paper, in the model; a real module varies).

Tap a part to see its voltages and currents. It is a model, not a measurement.
What do you need?
- Sensor module (LM393) FC-51AliExpress Amazon
- Resistor 1 kΩAliExpress Amazon
- Bipolar transistor S8550AliExpress Amazon
- Buzzer TMB12A05AliExpress Amazon
- Jumper wires × 6AliExpress Amazon
- BreadboardAliExpress Amazon
The AliExpress links are affiliate links: if you buy through them ohmio.dev gets a commission, at no extra cost to you. Affiliate links
This page is a guide: the numbers come from a simulation, and real parts vary. Check your parts before you power the circuit. Safety and responsibility
How does an infrared sensor sound a buzzer when something is near?
The FC-51 module sends infrared light and watches how much comes back. The nearer an object, the more returns, and past the trimmer's setting its OUT pin goes low. With a white object and the trimmer in the middle that happens between 9 and 8 cm in the model; at 25 % it is about 4 cm and at 90 % about 28 cm. A 30 mA buzzer is more than the module's output should carry, so an S8550 PNP transistor switches it. When OUT drops to 0.41 V, about 3.8 mA leaves the base through R1 (1 kΩ) and 29.8 mA flows through the active buzzer, which sounds on plain DC. A PNP is used because OUT is low when something is detected. With nothing near, OUT sits at 5 V and no current flows. Real distances change with the unit, the surface and the room light, so test with your own object and move the trimmer.
Values from the Protoboard ISO simulation: a model, not a bench measurement.
Hear about the next circuit
One email when a new circuit is out, about twice a month. Nothing else.