Saturday, December 6, 2008

Motorcycle Alarm / Anti-Theft Alarms - Built It Yourself!

This is a pretty cool motorcycle alarm that uses just a few components to protect your bike. It operates through detecting motion in your bike, or more specifically, when it's lifted off it's stand into the upright position i.e. ready to go revving off! Movement in the bike is accomplished through use of a mercury switch.

The circuit can be be powered directly from the motorcycle's battery source, since it draws a very low current while in stand-by mode. In fact, this good low current-drain design makes it ideal for use in a lot of different of different scenarios.

The motorcycle alarm circuit uses under 20 electronic components. Three of those are transistors (2 x BC547 [NPN] and 1 x BC557 [PNP]), one is the alarm-switching relay, and two are the control / alarm trigger switched (of which one is the mercury switch).

Not only is this motorcycle alarm a very good idea, but there is ample information about the circuit provided. Even a newbie electronics nerd could build this. There's even a design for the PCB (Print Circuit Board) of the motorcycle alarm and instruction on how to wire it to your motorcycle battery.


When one of the normally-open switches is closed - two things happen.
Firstly - the negative side of the relay coil is connected to ground through D1.
This causes the relay to energize.
And the relay in turn sounds the siren.

Secondly - the emitter-base junction of Q1 is forward-biased.
The transistor switches on - and current through R3 and Q1 charges C1.
C1 is part of the latching circuit that keeps the relay energized after the trigger-switch has been re-opened.

When the switch is re-opened - and Q1 switches off - the charge stored in C1 keeps Q2 switched on.
Q2 in turn keeps Q3 switched on.
Q3 connects the negative side of the relay coil to ground.
So the relay remains energized and the siren continues to sound.

It will continue to sound until C1 discharges through the base-emitter junctions of Q2 and Q3.

The length of time the relay remains energized depends on the value of C1 - and the input impedance (resistance) of Q2 and Q3.
A single transistor has a relatively low input impedance - so C1 would discharge quickly.
But Q2 and Q3 are connected to form a modified Darlington Pair.
The input impedance of a Darlington Pair is very high.
Roughly that of the single transistor - squared. And R4 increases it even further.
So C1 discharges relatively slowly through the two base-emitter junctions.
The precise time it takes depends on the characteristics of the actual components used - particularly the gain (hfe) of the transistors.

As C1 discharges - the current through R4 and Q2 falls.
So the base current through Q3 falls also.
This causes the Q3 collector-emitter voltage to rise.
As it does so - the voltage across the relay coil falls.
When the voltage across the relay coil falls to a sufficiently low level - the relay drops out and the alarm resets.

However - although they can no longer keep the relay energized - Q2 & Q3 would continue to conduct to some degree.
This would waste energy - and lead to an increased standby current.
To prevent this from happening - the base of Q2 is connected to the normally-closed contact of the relay.
When the relay drops out - the base of Q2 is taken to ground.
This completes the discharge of C1 - and turns Q2 & Q3 firmly off.
In this condition the standby current is virtually zero.

R1 connects the base of the pnp transistor to the positive line. This keeps Q1 switched off in standby mode.
If R1 had a very high value - moisture on the trigger-switches might tend to turn Q1 on.
And current through the transistor would flow to ground through the normally-closed relay contacts.
This would cause a substantial increase in standby current.
The value of 1k was chosen for R1 - in order to keep Q1 switched firmly off.

When charged - the voltage across C1 is about 1v2 to 1v4.
This limit is set by the base-emitter junctions of Q2 and Q3.
If R2 were not present then the collector-base junction of Q1 would hold C1 at 0v6 to 0v7.
This would prevent the capacitor from reaching a high enough potential to switch Q2 and Q3 on.
The value of R2 is not very critical.
I choose 4k7 - but any value that turns Q1 on and holds its base above about 2-volts will do.
R3 limits the surge current through Q1 as C1 charges.

The only transistor with any real work to do is Q3.
If the relay has a coil resistance of at least 270 ohms - then the maximum current passing through Q3 will be 12 ÷ 270 = 45mA.
The BC547 has an Ic(max) of 100mA.

Relay coils and some sounders produce high reverse-voltage spikes that will destroy sensitive electronic components.
D2 and D3 are there to short-circuit the spikes before they can do any damage.
Although there is nothing in the alarm circuit itself that's likely to be damaged - I have no idea what other electronic equipment might be connected to the same supply.
So I included the two diodes as a precaution.

If the alarm switches are fitted properly - the circuit should reset a minute of two after the bike has been returned to its centre-stand or kick-stand.
If it's not returned to one of its stands - and at least one of the trigger-switches remains closed - D1 will continue to connect the negative side of the relay to ground.
So the relay will remain energized and the siren will continue to sound.


Without D1 - when the alarm is activated - Q3 would connect R2 to ground.
This would turn Q1 permanently on - so the circuit would never reset.
By making the path one-way - D1 prevents this from happening.
You might get away with a 1N4148 in this position.
But I felt that - for the sake of reliability - the more robust 1N4001 should be used.

No comments: