# Electronics

## Touch Sensor

This circuit makes use of the fact that the human body acts as a resistor to the flow of electricity. When touching both the base and the battery with one finger at the same time, our body acts as a resistor connecting the gate to the battery. Our body causes a significant voltage drop, however, it is enough to activate the base, thus the transistor allows the current flow between the emitter and collector, which turns the LED on. We may notice that the LED light is faint in a well lit room, but in the dark it is clearly visible.

## Dark Sensor

The LDR (Light Dependent Resistor) is a kind iof resistor that is sensitive to light. When the light intensity increases, the LDR's resistance decreases and vice versa. This makes the LDR very useful in light sensing circuits. In the following circuit the LDR is used to sense the light to turn on an LED, and turn it off when no light is present. For this purpose a transistor has been used, the transistor's base is subjected to the output voltage from a voltage divider circuit, consisting of the LDR and a variable resistor.

Here is the equation the govern the relationship between the output voltage and resistance: Vout= (Rs/Rs + Rl)*Vin, where Rs is the variable resistance value, and Rl is the LDR's Value. According to this relation, when light falls on LDR, its resistance decrease. Considering that the equation's denominator (Rs+Rl) is inversly proportional with Vout, then Vout will increase, activating the transistor and switching on the LED.

## Inverse LDR

This circuit performs inverse the function of the previous one, when light is present, the LED turns off and when it's dark, LED turns on. This can be accomplished by switching the position of the LDR with the variable resistor. The voltage divider's output voltage in this case will be:  Vout= (Rl/Rs + Rl)*Vin, where Rl is the LDR's resistance and Rs is the variable resistance. When light is presented on the LDR, its resistance Rl drops, and the Vout decreases proportionally. In this case, the LED stays off because there isn't enough voltage to activate the transistor. When it gets darker, Rl increase, and the Vout decreases proportionally activating the transistor and turning the LED on.

## Timer

The 555 timer circuit works by charging the capacitor from the voltage source through the 1K resistors, once the voltage on the capacitor reaches 2/3 of the voltage supply (which is continously checked at pin 2 by an internal comparator circuit until it reaches that point), a high voltage signal activates the base of an internal transistor, allowing current flow from the voltage source to the LED through pin 3. Afterwards, the capacitor discharges, the voltage at pin 2 drops below 2/3 of the voltage supply, and the internal transistor is deactivated and the LED turns off. This cycle will repeat over and over, turning the LED on and off continously.