13
PICAXE-08 ALARM PROJECT
revolution
© copyright 2002 - AXE102 Alarm Student Project Notes Version 1.1
Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk
13
Supported by:
T
RANSISTOR
What is a transistor?
A transistor is a component that controls current flow in a circuit.
A transistor acts as an ‘electronic switch’ so that a small current
can control a large current. This allows low-current devices, like a
microcontroller, to control large current devices (like motors).
Where are transistors used?
Transistors are used in radios and electronic toys and many
other devices such as this electronic stapler.
Using transistors.
A transistor has three legs. These are labelled base,
collector and emitter. The base connection is the leg
that is used to activate the ‘electronic switch’. When a
small current is passed through the base connection, it
allows a much larger current to flow down between the
collector and emitter. This larger current can be used to
switch on devices such as motors, lamps and buzzers.
A common transistor is the BC548B type. This has a
plastic can with a flat edge. The flat edge enables the base,
collector and emitter legs to be correctly identified.
Using motors.
Motors can generate ‘electrical noise’ as they turn.
This is because the magnets and electric coils inside
the motor generate electrical signals as the motor
rotates. These signals (the electronic noise) can
disrupt the operation of the microcontroller. Some
motors, like solar motors, produce very little noise
whilst others can create a lot of noise.
To prevent electrical noise affecting the micro-
controller circuit a 220nF capacitor should always
be soldered across the motor terminals before it is used.
In addition, a diode (e.g. 1N4001 diode) should be connected
alongside the motor. This prevents damage to the transistor as
the motor slows down after the transistor switches off (for a
short period of time (as it slows down and stops) the motor is
acting as a ‘dynamo’ and generating electric current!). When
connecting a diode make sure the ‘band’ is connected the
correct way around. It is also a good idea to connect a 100uF
electrolytic capacitor across the battery supply to help
‘suppress’ the the electrical noise.
0V
Pin
1k
Output
device
BC548B
V+
1N4001
emitter (E)
base (B)
collector (C)
B
C
E
m
+V
0V
m
+V
0V
small
current
into base
large
current
across
collector/
emitter