Maker Pro
Maker Pro

Simple Hall sensor alarm circuit?

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
Without a datasheet or pinout for the BC547, or a schematic, it's hard to say. I can note that it *appears* that you are applying 9 V to a 5 V buzzer.

Also, 100K is a very large value for such a high gain circuit, and enables false tripping due to noise. Reduce to 10K.

Also, when the door is closed and the transistors are off, they might not be off. The right-side transistor (reference designators - !) base is floating when the left side transistor is off, again, an opportunity for radiated noise to cause false circuit action. Add a 10K resistor from the right-side-transistor to GND.

ak
 

Kiwi

Jan 28, 2013
471
Joined
Jan 28, 2013
Messages
471
Will that circuit actually work?
Shouldn't the collector of the left BC547 go to positive through a resistor, instead of the negative side of the buzzer and LED?
Why not just use a single NPN transistor?
 

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
Will that circuit actually work?
Shouldn't the collector of the left BC547 go to positive through a resistor, instead of the negative side of the buzzer and LED?
Why not just use a single NPN transistor?
The two transistors are connected as a Darlington pair for increased gain.

ak
 

Alistair Ballantyne

Nov 16, 2020
33
Joined
Nov 16, 2020
Messages
33
Without a datasheet or pinout for the BC547, or a schematic, it's hard to say. I can note that it *appears* that you are applying 9 V to a 5 V buzzer.

Also, 100K is a very large value for such a high gain circuit, and enables false tripping due to noise. Reduce to 10K.

Also, when the door is closed and the transistors are off, they might not be off. The right-side transistor (reference designators - !) base is floating when the left side transistor is off, again, an opportunity for radiated noise to cause false circuit action. Add a 10K resistor from the right-side-transistor to GND.

ak

Many thanks.
Is this circuit based on a 'Darlington Pair' - collectors connected and emitter of one feeding into base of the other?
What is the capacitor for - converting DC to AC?
Not sure what 'false tripping' means?
 
Last edited by a moderator:

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
Nothing in this circuit converts DC to AC or AC to DC.

Let's call the left transistor Q1 and the right transistor Q2.

When the door is open, the switch is open, and current through the 100K resistor turns on Q1. But that base current is very low. The only impedance at the Q1 base is a 100K resistor. This is a fairly high impedance, and the wires to the switch act as an antenna. Electrical noise in the region can radiate enough energy into the wiring to offset the resistor current and turn off Q1. In this case, the alarm can turn off even though the door is open, a false condition.

When the door is closed, Q1 is off. Now the Q2 base is completely floating, a condition even worse than having a 100 K impedance. Again, radiated noise can inject enough charge into the Q2 base to turn it on at least partially. In this case the alarm can turn on even though the door is closed, a false condition.

ak
 

Alistair Ballantyne

Nov 16, 2020
33
Joined
Nov 16, 2020
Messages
33
Without a datasheet or pinout for the BC547, or a schematic, it's hard to say. I can note that it *appears* that you are applying 9 V to a 5 V buzzer.

Also, 100K is a very large value for such a high gain circuit, and enables false tripping due to noise. Reduce to 10K.

Also, when the door is closed and the transistors are off, they might not be off. The right-side transistor (reference designators - !) base is floating when the left side transistor is off, again, an opportunity for radiated noise to cause false circuit action. Add a 10K resistor from the right-side-transistor to GND.

ak

Nothing in this circuit converts DC to AC or AC to DC.

Let's call the left transistor Q1 and the right transistor Q2.

When the door is open, the switch is open, and current through the 100K resistor turns on Q1. But that base current is very low. The only impedance at the Q1 base is a 100K resistor. This is a fairly high impedance, and the wires to the switch act as an antenna. Electrical noise in the region can radiate enough energy into the wiring to offset the resistor current and turn off Q1. In this case, the alarm can turn off even though the door is open, a false condition.

When the door is closed, Q1 is off. Now the Q2 base is completely floating, a condition even worse than having a 100 K impedance. Again, radiated noise can inject enough charge into the Q2 base to turn it on at least partially. In this case the alarm can turn on even though the door is closed, a false condition.

ak
Excellent, thank you.
I'm still not sure on the purpose of the capacitor in the circuit?
 

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
The capacitor does two things when the door is open. a) it acts as a noise filter, completely undoing my comment about noise susceptibility in this case. oops. b) it adds a short time delay between when the door opens and when the alarm sounds. My guess is that the delay is just a consequence of the noise filter, not a design requirement. If the door opens or closes slowly, there is a chance the reed switch contacts might flutter against each other before being stable. This could cause the buzzer to chirp. The cap prevents this.

When the door is closed, Q2 still is susceptible to noise.

ak
 

Alistair Ballantyne

Nov 16, 2020
33
Joined
Nov 16, 2020
Messages
33
The capacitor does two things when the door is open. a) it acts as a noise filter, completely undoing my comment about noise susceptibility in this case. oops. b) it adds a short time delay between when the door opens and when the alarm sounds. My guess is that the delay is just a consequence of the noise filter, not a design requirement. If the door opens or closes slowly, there is a chance the reed switch contacts might flutter against each other before being stable. This could cause the buzzer to chirp. The cap prevents this.

When the door is closed, Q2 still is susceptible to noise.

ak
Thanks - that makes sense.
Parts arrive in couple of days so will see how it performs!
 

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
The question is how much current does the buzzer draw at 9 V? The answer might eliminate one transistor.

ak
 

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
Here is an updated schematic. Note that the transistor pinout might differ from what you have.

One drawback of the Darlington transistor arrangement is that the "output" transistor (Q2 in your circuit) cannot saturate. The collector-emitter voltage (Vce) will be around 0.8 V when it is "on". By connecting the Q1 collector directly to Vcc, Q2 can fully saturate. This will increase the voltage across the buzzer by over 0.6 V, for a little more loudness.

There is another approach using just one transistor, a small-signal MOSFET.

Photo of the buzzer you intend to use? Any markings on the body?

ak
DoorAlarm-3-c.gif
One drawback of the Darlington transistor arr
 
Last edited:

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
Just for fun, here is the MOSFET-based circuit. We're running out of parts to cut.

Adjusting the input network impedance for a larger resistor reduces the static current draw through R1 when the door is closed. In this circuit it is only 9 microamps, pretty close to the battery's self-discharge current.

ak
DoorAlarm-4-c.gif
 

Alistair Ballantyne

Nov 16, 2020
33
Joined
Nov 16, 2020
Messages
33
Here is an updated schematic. Note that the transistor pinout might differ from what you have.

One drawback of the Darlington transistor arrangement is that the "output" transistor (Q2 in your circuit) cannot saturate. The collector-emitter voltage (Vce) will be around 0.8 V when it is "on". By connecting the Q1 collector directly to Vcc, Q2 can fully saturate. This will increase the voltage across the buzzer by over 0.6 V, for a little more loudness.

There is another approach using just one transistor, a small-signal MOSFET.

Photo of the buzzer you intend to use? Any markings on the body?

ak
View attachment 62958
One drawback of the Darlington transistor arr
Understand that - but couldn't work it out myself!!!
Haven't used a 2N4401 before so will order and build.
If this version drives greater loads then why was it not used in the first place?
Buzzer from Bitsbox - only details below.
1709642496332.png
 

Alistair Ballantyne

Nov 16, 2020
33
Joined
Nov 16, 2020
Messages
33
Just for fun, here is the MOSFET-based circuit. We're running out of parts to cut.

Adjusting the input network impedance for a larger resistor reduces the static current draw through R1 when the door is closed. In this circuit it is only 9 microamps, pretty close to the battery's self-discharge current.

ak
View attachment 62959
Excellent! Have not built a MOSFET based circuit before.
So the high input impedance and high gain of the MOSFET is coupled to the massive 1.0m resistor to achieve this state?
Again will order the parts and look forward building this version!
 

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
Buzzer from Bitsbox - only details below.
View attachment 62977
That is a piezo beeper, not a buzzer. There are two types. One is just the bare piezo element, and requires an AC driving signal. The other has an oscillator circuit built-in, and runs on DC. This is what you have. It is a very low-current beeper, so just about any small-signal transistor, bipolar of MOSFET, can drive it.

ak
 

Alistair Ballantyne

Nov 16, 2020
33
Joined
Nov 16, 2020
Messages
33
Just for fun, here is the MOSFET-based circuit. We're running out of parts to cut.

Adjusting the input network impedance for a larger resistor reduces the static current draw through R1 when the door is closed. In this circuit it is only 9 microamps, pretty close to the battery's self-discharge current.

ak
View attachment 62959

Just for fun, here is the MOSFET-based circuit. We're running out of parts to cut.

Adjusting the input network impedance for a larger resistor reduces the static current draw through R1 when the door is closed. In this circuit it is only 9 microamps, pretty close to the battery's self-discharge current.

ak
View attachment 62959
The original Darlington circuit actually worked very well.
I have followed your schematic for the MOSFET version but cant get it to work.
Power on and the buzzer is constantly on - the switch has no effect.
Have I got my pinout wrong?
 

Attachments

  • IMG_0769.JPG
    IMG_0769.JPG
    296.8 KB · Views: 4
Top