Professional Documents
Culture Documents
Lab7 Final PDF
Lab7 Final PDF
ALUMNOS: Diego Ortega Sanz, Ángel Salas Navarro y Guillermo de la Obra Pérez
14 DE DICIEMBRE DE 2017
UNIVERSIDAD EUROPEA DE MADRID
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA
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
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.
4. Measure the pot voltage with the oscilloscope (Average Voltage) and (Vpp
Voltage).
2.46 2 0.46
5. Compare the results taking into account the noise present in the circuit and the fact
that oscilloscope is measuring an average value
The goal of this exercise is to move a DC Motor connected to an H bridge using a PWM
signal.
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
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
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
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
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
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.
5. Obtain the following program shown below to obtain the measured values in g.
GRADO EN INGENIERÍA ELECTRÓNICA
INDUSTRIAL Y AUTOMÁTICA
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
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