Lab 4 - Data Acquisition Using Arduino
Lab 4 - Data Acquisition Using Arduino
College of Engineering
ECE 2113
Section 005
Henry Gallagher
TUid#: 915945042
The purpose of this lab is to learn about how to use an Arduino UNO microprocessor to analyze
the sensor readings with circuit elements on the ELVIS. In this lab, an ultrasonic sensor will be
used to measure distance. This procedure is commonly applied in the field of robotics.
II. Procedure
Part I.
1. Connect the Arduino UNO via USB to the computer via the Arduino application
2. Add the Microsoft data streamer to an Excel spreadsheet
3. Assemble the circuit shown with the 10k potentiometer; middle pin connected to A0
on the Arduino
4. Type or paste the code into the Arduino application interface
5. Click the right-most button on the Arduino IDE menu bar
6. Rotate the potentiometer and observe the voltage on the Arduino program
Part II.
1. Open Excel with the data streamer add-in, and click on ‘Connect Device’
2. Choose ‘Arduino COM3’
3. Click record, and rotate the potentiometer so that the voltage changes from 0V to +5V
and vice versa
4. Save the data in the column as it’s own file
5. Plot potentiometer voltage over time
Part III.
1. Assemble the circuit shown and connect the LED anode to digital pin 2
2. Put the code in the Arduino program to define pin 2 as an LED
3. To see the pulse train, connect the oscilloscope pins, A0, to pin 2 on the Arduino and
the ground
4. Vary the time delay and observe the change in blinking
Part IV.
1. Assemble the circuit shown with the Arduino IDE and connect the power source to the
5V source on the Arduino
2. Add code for pin designations, the serial monitor, and a loop that sends out a pulse
and detects its echo to calculate distance
3. Look at the Arduino output graph for the reading of the ultrasonic distance sensor
4. Add the codes/commands for controlling the LED through the distance sensor
III. Results
Part I
1) Suppose you want to measure a signal that varies from 0 to 10V. Discuss how you
would setup the data acquisition system using Arduino. Give circuit diagram as
appropriate.
Part II
1s interval
6
0
58000 60000 62000 64000 66000 68000 70000
1-second interval
No interval
6
0
821500 822000 822500 823000 823500 824000 824500 825000 825500
No interval
2. One could cut the wait time at the end of the code in half.
Parts III & IV were unable to be completed in the experiment due to errors with the software and
the computer.
Conclusion
In the first parts of the lab, the data collected only had two data points, so no conclusions can be
made. In the second, thi