We are going to build a burglar alarm, for that we need to use sensor that sense presence or something as input device and we also need output device as a alarm the people here we are using buzzer. first we need to choose the sensor, I selected Hall effect sensor because it's very simple and easy to use, it's working based on the proximity of magnet, so we can measure the magnetic field based on the output voltage and if we can put the sensor and magnet between our door and we can program it to alarm when the magnetic field is low. and it's very low power and smaller footprint, so let's get start to make.
here Iam using A1302-Linear Hall-Effect Sensor (datasheet), and you can use any Hall-effect sensor for this project.
Sensor - A1302 - Continuous-Time Ratiometric Linear Hall-Effect SensorFeatures
- Low-noise output
- Fast power-on time
- Ratiometric rail-to-rail output
- 4.5 to 6.0 V operation
- Solid-state reliability
- Factory-programmed at end-of-line for optimum performance
- Robust ESD performance
Piezo buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Piezo buzzer is based on the inverse principle of piezo electricity discovered in 1880 by Jacques and Pierre Curie. It is the phenomena of generating electricity when mechanical pressure is applied to certain materials and the vice versa is also true. Such materials are called piezo electric materials. Piezo electric materials are either naturally available or man made. Piezo-ceramic is class of man made material, which poses piezo electric effect and is widely used to make disc, the heart of piezo buzzer.
When subjected to an alternating electric field they stretch or compress, in accordance with the frequency of the signal thereby producing sound.
A piezoelectric disk generates a voltage when deformed (change in shape is greatly exaggerated).
Sensor TestingFirst we arr testing the hall-effect sensor and Buzzer with using arduino after that we are going to design custom pcb and make it next level.
now we can confirm sensor and code are working fine, next we are going to make mill a custom pcb using CNC milling machine.
Circuit DesignI used Eagle to design the circuit.
and routed and completed the PCB designing
I exported board file as Monochrome PNG image file and milled with Modela MDX CNC machine.
for milling I used Flame Resist grade PCB, and milling completed perfectly.
- ATtiny45/85 x 1
- Buzzer x 1
- Hall-effect sensor x 1
- 0.1 uF Cap x 1
- Coil cell battery x 1
- Coil cell battery Holder x 1
- ISP header x 1
soldered components successfully,
void setup()
{
pinMode(2, INPUT_PULLUP);
pinMode(3, OUTPUT);
}
void loop()
{
int data = analogRead(2);
if (data >= 500 ) {
digitalWrite(3, HIGH);
}
else{
digitalWrite(3, LOW);
}
}
I Uploaded code using a ISP, you can also use a Arduino as ISP to upload program.
Demonstrationthe same alarm we can use it in multiple places.
Thank you!
Comments