Sei sulla pagina 1di 7

Teacher:

Instituto Politcnico
Nacional

Santilln Luna Ral

Escuela Superior de Cmputo


Instrumentation

Students:
Escudero Snchez Juan
Laboratory
Antonio
Pia Nieto Erik Javier
Romero Rubio Gerardo
Daniel

Pulse Counter

Pulse Counter
Objective
Make a counter pulse with an infrared led and a receiver diode
(phototransistor), count a pulse when the voltage is greater than or
equal to 3.3V and reset the count of pulses by pressing a push button.

Introduction
Diode LED
A diode is an electronic device with two electrodes, cathode and anode,
which has the property of being a driver in the sense catodo-anodo, but
not the reverse. (From the English Light EDiode) LED is a diode capable
of emitting light to be polarized in the direct sense. It produces a
monochromatic light, has low power consumption and is widely used as
an element of signaling devices and electronic circuits.
The LED must be always respecting the polarity, otherwise please does
not illuminate.
Since the LED is very small, the anode and cathode are designated by
the length of the legs.
The long leg (A) corresponds to the anode to the pole (+) and the short
leg (C) corresponds to the cathode to the pole (-).
Capsules of LED colors can be: red, yellow or green, and the most
common diameters are 5 and 3 mm.

(IRLED) infrared LED


The IRLED diode (English lnfrared Light Emitting Diode), is an emitter of
infrared rays are electromagnetic radiation in the electromagnetic
spectrum, in the interval ranging from visible light to microwaves.
These diodes differ from the LED by the color of the capsule that
surrounds that is blue or gray. The diameter of this is usually 5 mm.
Infrared rays are characterized by radiant heat carriers. These rays are
produced in greater or lesser intensity in any object above absolute zero
temperature.

Phototransistor
The phototransistor is a photodetector that works like a classic
transistor, but normally does not have connection base.
These transistors in base is replaced by a photosensitive Crystal when it
receives light, producing a current and unlock the transistor.
The phototransistor current flows only in one direction and the blocking
of the transistor depends on the light; the more light there is more leads.
The principle of the phototransistor is apparently the same as that of the
classic transistor. But if we look at the component that only has two legs,
an issuer and a collector, but the base is missing.
The base is in fact replaced by a layer of photosensitive Silicon. If this
layer is illuminated appears at the base a current which grows with the
light, which puts up the transistor.
The phototransistor reacts with visible light and infrared rays are
invisible. To distinguish it from the LED his capsule is transparent.
In the phototransistor, like the led, polarity is given by the length of their
legs, but with one important difference; the phototransistor in the long
leg is the negative (-), unlike in the LED, which is the positive (+).

Development
Circuit Diagram
We made a circuit to connect a infrared LED and other circuit with a
phototransistor for connect both to an arduino and to count a pulse
when the phototransistor receive light of infrared LED. The following
diagram shows the way in which the circuits are connected.

Code
We made the following code for count the pulses, so counts a pulse
when the state infrared is in high and write high in phototransistor but if
the state of push button is in high resets the count.
const int pinSensor = 11;
const int pinLed

= 9;

const int buttonPin = 2;


int estadoSensor = 0;
int buttonState = 0;

int conta = 0;
void setup() {
Serial.begin(9600);
pinMode(pinLed, OUTPUT);
pinMode(buttonPin, INPUT);
pinMode(pinSensor, INPUT);

void loop(){
estadoSensor = digitalRead(pinSensor);
buttonState = digitalRead(buttonPin);
if (estadoSensor == HIGH) {
digitalWrite(pinLed, HIGH);

}
else {
digitalWrite(pinLed, LOW);
conta++;
Serial.println(conta);
delay (1000);

}
if (buttonState == HIGH) {
conta=0;
Serial.println("");
delay(10);
}
}

Performance tests
The following pictures shows a part of performance of the circuits when you put
a barrier between the two circuits (in this case the usb) and when it is
removed, that is when you mark the pulse.

Conclusions

Escudero Snchez Juan Antonio


This practice was helpful for me because I saw how the infrared diodes
and transistors diodes works, in this case we used a LED to count
whenever something interrupted the signal between the diodes and we
used to a push button to restart the count.

Pia Nieto Erik Javier


This practice was so useful because with this kind of implementation we
could do something bigger using infrared diodes like something with our
smartphones that still have infrared but nowadays they arent used
anymore.

Romero Rubio Gerardo Daniel


Working with diodes allows us to interact with different types out there,
for example the (transmitter and receiver) infrared diodes. Working with
the infrared diode could test it and how to react to change of position or
distance. All this with good use of diodes and connection to Arduino.

Silva Ramrez Karen Itzel


I consider that this practice is very illustrative in terms of the use of the
diodes, infrared and phototransistor, these diodes helps us to detect a
signal from wirelessly and activate the behaviour of other electronic
component.

Potrebbero piacerti anche