What is the 555 timer?
Timer 555 is an 8-terminal integrated circuit that is used for generating time slots. Although it is mainly used as a timer to activate or deactivate some circuits or electronic components, we can also use it as a pulse generator, multivibrator, alarm, digital switch, among other more specific applications.

Timer 555
555 timer terminals
GND: The earth is placed in this terminal.
Trip: It is used to activate the integrated circuit.
Output: Here the component or circuit that we want to activate is connected.
Reset: It is used to reset the circuit, if we do not use it we must connect it to the positive pole.
Voltage control: It is used to modify the Vref of the comparators in order to modify the threshold and trip voltage and this can be used to modify the shape of the output wave. If this terminal is not used, a 10nf capacitor is placed to avoid interference.
Threshold: It is a comparator that establishes the timing time.
Discharge: It is used to generate the low-level time or 0, while the capacitor discharges, the output is at a low level.
Supply voltage: Used to supply each of the internal parts of the timer.
Parts 555
555 Settings
This circuit is characterized by having the ability to be configured in different ways, whether it works with cycles that repeat over and over again with a single pulse (Astable) or a single cycle per pulse or better known as a monostable timer.

Timer 555 Astable
This type is characterized by having an output that is repeated over and over, thus taking a square waveform. This signal has two states, one low and one high, each of which has different operating times, that is, one for the activation signal known as T1 and another for the low T2.

The duration times depend on the values of the resistors: R1 and R2 and the capacitor C1.

T1 = 0.693 (R1 + R2) C1

T2 = 0.693 x R2 x C1 (in seconds)

The frequency with which the output signal oscillates is given by the formula:

f = 1 / T

and the period is simply

T = 1 / f

555 astable
Timer 555 Monostable
In this case, the timer needs a pulse at the trigger terminal to generate an active output for the programmed time. Once the cycle ends, it can be restarted as many times as necessary, it is only a matter of generating a pulse at the trigger terminal.

The connection diagram and the input and output waveforms are shown in the following image. We can see that the high-level time of the output depends on the resistance R1 and the capacitor C1.

555 monostable
The formula to calculate the duration time (time that the output is at a high level) is:

T = 1.1 x R1 x C1 (in seconds)

555 Timer Metal Detector