Recently, I am playing with alarm I/O and requires something that is common but unfamiliar to me - Electrical circuit wiring.
1. Breadboard - A breadboard (protoboard) is a construction base for prototyping of electronics. See http://tymkrs.tumblr.com/post/6386624174/how-to-use-a-breadboard on how to use a breadboard
2. 3V LED light - Need to display alarm output (see setup picture below)
3. Some electrical wires
4. Open Switch.(see setup picture below)
5. Resistor - We are using 5V input for a 3V LED light. We need a resistor to control the current flow to prevent providing too much current for the LED light (May result in blowing the LED light).
The following picture provided a setup for 2 circuits - Alarm input circuit and alarm output circuit.
Alarm Input Circuit
Alarm input are usually used to provide a trigger signal to the attached system. In the above setup, I am connecting a 5V circuit for the alarm input and I used a open switch as a trigger device. If I press the switch button, it will complete the 5V circuit and the alarm system will capture a change in voltage and respond accordingly.
Alarm Output Circuit
Alarm output are usually used to connect external device to provide visual/audio alert. In the above setup, I am using a 3V LED light as the visual output alert with an NO (normally open) circuit.
Normally, there are 3 type alarm output port provided by an alarm system. The port interfaces are C, NO, NC
C - This is a Common port for alarm circuit. Either NO or NC will use Common port to complete the alarm circuit
NO - Normally Open port for alarm circuit. Normally Open means the circuit is opened and will be closed if and only if the alarm system detect an alarm event. For example, if I connect a LED light to NO circuit, the LED light will only light up if there is an alarm event.
NC - Normally Close port for alarm circuit. Normally Close means the circuit is closed and will be opened if and only if the alarm system detects an alarm event. For example, if I connect a LED light to NC circuit, the LED light will be lighted up and it will only be turned off if there is an alarm event.
Now, let's talk a bit about voltage and resistor. If you look at the breadboard, the alarm output circuit is using a 5V input for lighting up a 3V LED light. This implies that the alarm system is providing more voltage (5V) to the LED light (3V) than the LED light required. The extra 2V will eventually blow the LED light. To prevent that, we need a resistor to reduce the voltage flow across the LED light.
Below is a common setup for a circuit. So for us
Supply Voltage: 5V
Current: 20 milliampere (3V LED usually used 20 milliamp current)
Forward voltage: 3V (Voltage needed to light up the LED light)
Resistance: To be calculate
So, to calculate resistance, we need to use Ohm Law
I = Expected Current through the conductor in ampere
V = Potential difference measure across the conductor in volt
R = Resistance in conductor in ohm
Therefore, to calculate resistance, use R = V / I
V = difference of supply voltage - forward voltage of LED = 5V - 3V = 2V
I = expected current of LED = 20 milliamp = 0.02 amp
Therefore R = 2V / 0.02 amp = 100Ohm
Thus, we need a resistor of 100Ohm to complete the circuit (shown in the picture)
You can use http://www.hebeiltd.com.cn/?p=zz.led.resistor.calculator to calculate your required resistor value
In addition, resistor has color code. You can use http://www.electronics2000.co.uk/calc/resistor-code-calculator.php to compute your resistor color code before going to electrical shop to purchase your resistor. For example, 100 Ohm resistor has a color code of brown black brown gold
The above had described the completed circuit setup for alarm input and output. Please take note that you have to setup your alarm system to relay alarm input to alarm output. Different alarm system has different setting.
For me, after I had linked up the alarm system relay setting and pressed the open switch at alarm input, the LED light will light up as external alarm.