Вы находитесь на странице: 1из 16

INFORME DE LABORATORIO

PRACTICA 7: ANALOG INPUTS AND PWM OUTPUTS.

ALUMNOS: Diego Ortega Sanz, Ángel Salas Navarro y Guillermo de la Obra Pérez

ASIGNATURA: Electrónica Digital y de Microprocesadores

PROFESOR: Víctor Manuel Padrón Nápoles

14 DE DICIEMBRE DE 2017
UNIVERSIDAD EUROPEA DE MADRID
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

LAB EXCERSICE 7. USING SENSORS AND ACTUATORS.

READING A POTENTIOMETER VOLTAGE


1. Connect the potentiometer POT X of board DISEN-EXP to Analog Input 1 in the
Arduino board and the GND signals of both boards.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

2. Modify the Example File – AnalogReadSerial to read the pot voltage and print its
value in Volts on the Serial Monitor. Consider Vref = 5 Volts. Remember the
general formula is:
𝑉𝑟𝑒𝑓
𝐴𝐷𝐶𝑉𝑜𝑙𝑡𝑠 = 𝐴𝐷𝐶𝑅𝑒𝑎𝑑 ∙ 𝑛𝑏𝑖𝑡𝑠𝐴𝐷𝐶
2
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

3. What is the resolution of this ADC? What is the falue of 1 LSB voltaje step=
Explain with your words what the meaning of resolution is.

𝑉𝑟𝑒𝑓 𝑉𝑟𝑒𝑓𝑝 − 𝑉𝑟𝑒𝑓𝑛


1𝐿𝑆𝐵 =∙ 𝑛𝑏𝑖𝑡𝑠𝐴𝐷𝐶
=
2 2𝑛𝑏𝑖𝑡𝑠𝐴𝐷𝐶

Vref (difference between both successive numbers) defines the


resolution in volts or mínimum voltaje we can distinguish with the
converter.

4. Measure the pot voltage with the oscilloscope (Average Voltage) and (Vpp
Voltage).

Arduino Measurement Oscilloscope Error


Measurement

2.46 2 0.46

4.23 3.73 0.5

4.89 4.04 0.85

1.19 0.703 0.49


GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

5. Compare the results taking into account the noise present in the circuit and the fact
that oscilloscope is measuring an average value

USING PWM TO MOVE A DC MOTOR.

The goal of this exercise is to move a DC Motor connected to an H bridge using a PWM
signal.

1. An H bridge and the L293D motor driver.


GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

2. Connect the driver inputs DER to Arduino digital output PWM11. Connect ON
to VCC, and, IZQ to GND in the same connector. Do not forget connect GND
signals of both boards.

3. Modify the Example File – AnalogInOutSerial to read the pot voltage and spin
the motor to a speed proportional to that value.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

4. Measure with oscilloscope the average voltage for different values of PWM of the
active PWM signal.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

5. Disconnect IZQ from GND and connect it to digital output PWM10. Modify again
the program to change the sense of the motor rotation, if the pot voltage is bigger
than 2.5 Volts motor should spin clockwise, otherwise it should spin
counterclockwise.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

USING PWM TO MOVE A DC MOTOR.

The goal of this exercise is to learn to use a move a 3 axis MEMS accelerometer.
Accelerometers are used during navigation to measure acceleration and integrate twice
in order to obtain current velocity and position.

1. The pin-out of the ADXL335 3-axis accelerometer and its test code is shown
below. PAY ATTENTION to the fact that accelerometer has to be connected to 3.3
V power supply. Connect the X, Y and Z outputs to Analog inputs 0, 1 and 2
respectively.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

2. Modify the program to obtain the Reading in volts using the general formula:
𝑉𝑟𝑒𝑓
𝐴𝐷𝐶𝑉𝑜𝑙𝑡𝑠 = 𝐴𝐷𝐶𝑅𝑒𝑎𝑑 ∙ 𝑛𝑏𝑖𝑡𝑠𝐴𝐷𝐶
2

3. For each axis, orient the accelerometer in order to make the effect of gravity force
(normal forcé) on the axis to be zero. Read the corresponding value and compare the
actual value with Bias Level in datasheet. Fill in the obtained values in the table below.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

4. Orient each axis again to obtain the máximum and mínimum effect of gravity (Normal
forcé) on the axis. Fill in the obtained in the table below and calculate DeltaV = V1g – Vbias,
which corresponds with the actual sensitivity for each axis. Compare them with sensititvity
values for each axis in the datasheet.

Axis Bias or 0 G 1G -1 G Actual Datasheet


sensitivity sensitivity
Volts value Volts value Volts value
(deltaV/deltaG)

X 1.62 1.93 1.29 0.32 0.1

Y 1.62 1.97 1.26 0.355 0.1

Z 1.64 1.92 1.27 0.325 0.3


GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

5. Obtain the following program shown below to obtain the measured values in g.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

6. Hold firmly the accelerometer jointly with arduino board and move them applying
some forcé, notice how the measured acceleration changes.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

7. Using the accelerometer as inclinometer. Modify the program to detect when the
inclinometer is in vertical position sending a message through the serial port and
lighting the LED connected to pin 13 of arduino board. Try to avoid oscillations.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA

ASIGNATURA: ELECTRÓNICA DIGITAL Y MICROPROCESADORES


NOMBRE: GUILLERMO APELLIDOS: DE LA OBRA PÉREZ

Вам также может понравиться