You are on page 1of 5

Computerized Control

M.C. Carlos R. Santilln Rodrguez




Practice #2: Analog-Digital Converter












Eduardo Armando Chavarra Gonzlez A00756347
Oscar Concha Rodrguez A00756979






February 18, 2014

Abstract:
In this practice the team establishes a serial communication with a microcontroller that
allows the read of the temperature throw a LM35. It will be possible to see how the
circuit converts a physical value (analog signal) into voltage. Then, with a mathematical
analysis traduce that signal into centigrades.
Objective:
The objective of this practice is to create a communication between the computer and
the LM35 to obtain the temperature of our environment and know how the ADC works.
Introduction:
Signals in the real world are analog: light, sound, temperature and others. So, real world
signals must be converted into digital, using a circuit called ADC (Analog-to-Digital
Converter), before they can be manipulated by digital equipment.
There are some basic reasons to use digital signals instead of analog, noise being the
number one. Another advantage of digital system against analog is the data compression
capability and the facility to control a signal.
Equipment:
Amount Material
1 150 pF Ceramic Capacitor
2 0.1 uF Ceramic Capacitors
1 Switch
1 10 uF Electrolytic Capacitor
1 10K ohms resistance

Activities:
1. Connect the USB enter to the computer.
2. The output of RS232 will be connected to the MAX232 ports.
3. Then connect the PIC16F877 to the ADCs bits ports.
4. Connect the LM35 Vout to the ADCs in.
5. Feed the circuit with 5V.
6. Make the communication between the PIC and the computer.
7. Read the data with the R bottom.
8. Measure Vout of LM35.
9. Divide the Vout by 10.
10. Observe the value obtained from the Docklight.
With these activities we allow the circuit to read the signal that the LM35 gets from the
environment (temperature) and then sent it to the ADC so it can transform that signal
into digital and sent it to the microcontroller. This way the pic will be able to work with
it. To see this information in the computer a serial communication has been established.
Note:
The communication baudage should be at least 5600



X = 184C
Flow diagram:

Image 1.1 ADC connections

Image 1.2 LM35 and PIC Connections

Image 1.3 PIC-MAX232 and ADC connections

Code used:
char temp;
void main() {
Uart1_Init(56000);
Delay_ms(100);
TRISB=0xFF;
while (1) {
if (Uart1_Data_Ready()) {
if(Uart1_read()==114){
temp=PORTB;
Uart1_Write(temp);
}
}
}
}
Conclusions:
Oscar Concha: In this practice I could understand how the ADC works because this is
the first time that I work with it in practice, in previous courses I only learned the theory
of the component. Another thing that I could appreciate is that sometimes the ADC
shows errors in the computer because the circuit doesnt function correctly and you
must to reboot the device for proper operation. With this practice I could establish a
communication with the LM35 and the computer, with the code that was downloading
to the PIC we could read the information of the LM35 and check the temperature
Eduardo Chavarra: This practice was very helpful to understand how a signal its get
from the environment and converted into a digital one. We can see how the ADC works
when you put on it an analog signal, in this case temperature, and then digitalized it so
you can work with it. In this case we didnt manipulate the signal, but it was possible to
see the response of the system in the computer and estimate the temperature that the
LM35 obtained. There was a problem with the protoboard but it was solved by just
changing it.
References
http://www.hardwaresecrets.com/article/How-Analog-to-Digital-Converter-ADC-
Works/317/2
http://www.mikroe.com/chapters/view/87/libro-de-la-programacion-de-los-
microcontroladores-pic-en-basic-capitulo-4-ejemplos/#c4v14

You might also like