| ||||||||||||
Microswitch and BuzzerHaving got to grips with the basics, now it is possible to replace the bulb with a buzzer, and perhaps use a microswitch to trigger it. The microswich behaves just like the toggle switch but is merely a different shape. You can mount the board inside a cupboard with bluetack so that the switch is closed when the cupboard is closed. Opening the door will cause the spring on the switch to open (and switch the contacts). Rather than driving a lightbulb, you can connect the buzzer instead so that it sounds when the door opens. This is exactly how some burglar alarms work, so they go off when a door or window opens. Here is the circuit diagram: Note that the circuit diagram does not distinguish between the microswitch and the toggle switch, it just shows the electrical circuit. The picture below shows the buzzer and microswitch being held shut. Note that this kind of buzzer needs to be put in the circuit the right way round or it will not work. The buzzer's red lead needs to be on the positive side of the circuit. Since the microswitch has an extra terminal (it is also a change-over switch like the toggle switch), you can use the extra terminal to show when the the alarm is 'armed'. We could use a bulb for this, but a better choice would be to use a Light Emitting Diode (LED). An LED uses much less current than a light bulb so will drain the battery less if left on for long periods of time. The LED can be connected between the unused terminal on the microswitch and the negative (-ve) wire going back to the battery. Unlike a bulb, an LED must be connected the right-way-round in a circuit. Here is the circuit diagram. The LED is the large arrow symbol. For the LED to work, it must be connected with its positive lead to the +ve side of the circuit and it's negative lead to the -ve side of the circuit. Try it both ways round, it just won't work when connected backwards. The two smaller parallel arrows show that this diode emits light. When connected up to your cupboard alarm, the LED should glow when the alarm is 'ready'. This can be hidden away somewhere so you know what it means but no-one else does. When the door is opened, the buzzer should buzz and the LED will turn off. I leave that one for you to work out. Using a DiodeA diode is like a one-way valve. It lets current flow in one direction and stops it flowing in the other direction. Believe it or not, this is very useful in electronics and you find diodes everywhere. Every phone-charger/console power supply will have diodes in them. They are used to convert the mains electricity (alternating current) into a form suitable for battery equipment (direct current). You have used a diode before - the LED is a kind of diode, just one that is in transparent case that emits light when current flows through it. Try putting together the following circuit: When the switch is one position, the lamp will turn on., When in the other position, it will be off. Note the direction of the diode symbol. The diode arrow points in the direction current will flow - positive to negative. Since it is pointing upwards, it is the wrong way round for current to flow so it acts like a shut door. Now try swapping the battery leads over (so -ve is at the top, +ve is at the bottom). You should see that the lamp will be on in both positions. You may notice the bulb is slightly dimmer when going through the diode as the diode will use some voltage (about 0.6V) as it is in series with the lamp. Diodes are often used like this in battery-powered equipment. By putting a diode in the battery lead, it protects the delicate electronic circuitry from frying in case the batteries are inserted the wrong way round. The diode stops any current flowing so the gadget just wont work unless the batteries are inserted the right way round. Here is a test I did using the LED and diode. In this direction it works. This is the same setup except the wires to the diode have been swapped. In this configuration, the LED does not light because the diode is blocking the current flow | ||||||||||||
| ||||||||||||