1 / 14

Arduino Week 3 Lab

Arduino Week 3 Lab. ECE 1020 Prof. Ahmadi. Objective.

Download Presentation

Arduino Week 3 Lab

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Arduino Week 3 Lab ECE 1020 Prof. Ahmadi

  2. Objective Data acquisition (DAQ) is the process of measuring an electrical or physical phenomenon such as voltage, current, temperature, pressure, or sound with a computer. A DAQ system consists of sensors, DAQ measurement hardware, and a computer with programmable software1.

  3. What Is a DAQ Device? DAQ hardware acts as the interface between a computer and signals from the outside world. It primarily functions as a device that digitizes incoming analog signals so that a computer can interpret them. The three key components of a DAQ device used for measuring a signal are the signal conditioning circuitry, analog-to-digital converter (ADC), and computer bus. Many DAQ devices include other functions for automating measurement systems and processes. For example, digital-to-analog converters (DACs) output analog signals, digital I/O lines input and output digital signals, and counter/timers count and generate digital pulses.

  4. Schematic of a DAQ System http://www.ni.com/data-acquisition/what-is/

  5. In Today Lab: • We are going to connect the light sensor to Arduino UNO board to capture data • Transfer the captured data to a computer • Analyze and plot the data on computer using MATLAB

  6. DAQ components must be able to communicate For each and every two systems to communicate, they must speak the same language (protocols). For example in today’s lab experiment, • Arduino board must communicate with MATLAB on the computer through a known setup protocol • We upload a program on Arduino (adioes) ,which tells the Arduino board to listen for communication coming from MATLAB under defined terms and conditions • MATLAB is programed with a code (arduino) , which know how to communicate with adioes on the Arduino board • Once the connection is established data can be transferred from Arduino to MATLAB, analyzed, and visualized.

  7. Light Sensor Connect the light sensor to the Arduino UNO board as depicted in the

  8. How to read a light sensor[How to connect it?] • The sensor is connected in series with a resistor • Both of which are between the +5V terminal of the Arduino and the Ground terminal • They form a Voltage Ladder • The data we want comes from the voltage at the point of connection between the sensor and resistor [This is what will change in response to light]

  9. Layout

  10. 2. Program the Arduino • Program the Arduino with the adioes.pde in the …/pde directory. • Make sure you have chosen the right COM port and Arduino board (Arduino UNO). • If programmed successfully, close the Arduino IDE software.

  11. 3. MATLAB • Open MATLAB • Select the …/Arduino_Lab_3 as your working directory • Open the arduino_lab_3.m code file • Replace the ‘COM3’with the port your Arduino is connected to on line 11 of the code • Replace 4on line 14, val(i,1)=OBJ.analogRead(4) with the input port your light sensor in connected to • Run the Script!

  12. Sample Output Plot

  13. Other Input Signals You can use any other input signal with amplitude in the range 6~20 Volts ( 7~12 Recommended) like, • Light Sensor • Sonar Sensor • Signals generated using a Fucntion Generator • Etc.

  14. Reference • What Is Data Acquisition? - National Instruments www.ni.com/data-acquisition/what-is/

More Related