Connect the VCC pin (pin 8) of the LM358 IC to the positive supply voltage (e.g., 9V).
Connect the GND pin (pin 4) of the LM358 IC to the ground (0V) of the circuit.
Voltage Divider:
Create a voltage divider using two resistors (e.g., 10kΩ and 100kΩ).
Connect one end of the 10kΩ resistor to the positive supply voltage.
Connect the other end of the 10kΩ resistor to the non-inverting input (pin 3) of the LM358.
Connect the junction between the two resistors to the inverting input (pin 2) of the LM358.
Connect the end of the 100kΩ resistor to the ground.
Reed Switch and Magnet:
Connect one end of the reed switch to the inverting input (pin 2) of the LM358.
Connect the other end of the reed switch to the ground.
Place a magnet near the reed switch so that when the door or window is closed, the magnet holds the reed switch in a closed position.
Alarm Output:
Connect the output (pin 1) of the LM358 to the positive terminal of the buzzer or speaker.
Connect the negative terminal of the buzzer or speaker to the ground.
Connect a diode (e.g., 1N4148) in parallel with the buzzer or speaker to protect against voltage spikes.
Working Principle:
The LM358 is configured as a comparator with a voltage divider setting a reference voltage.
When the door or window is closed, the reed switch is in a closed position, and the voltage at the inverting input is higher than the reference voltage.
When the door or window is opened, the reed switch opens, and the voltage at the inverting input drops below the reference voltage.
The LM358 output goes high, triggering the buzzer or speaker, alerting that the door or window has been opened.
Reviews
There are no reviews yet.