Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Acquisition Device (DAQ) A DAQ is a cool little device that allows you to interface hardware to a computer. Here is what we will do:  Create a square.

Similar presentations


Presentation on theme: "Data Acquisition Device (DAQ) A DAQ is a cool little device that allows you to interface hardware to a computer. Here is what we will do:  Create a square."— Presentation transcript:

1

2 Data Acquisition Device (DAQ) A DAQ is a cool little device that allows you to interface hardware to a computer. Here is what we will do:  Create a square wave in MATLAB  Send the signal out through the DAQ as a voltage signal applied across a series circuit (OUTPUT a Signal)  Use the DAQ as a voltmeter to measure the voltage across a resistor (INPUT the measurements)  The DAQ will send these measurements back into MATLAB so we can easily plot the voltage vs. time

3 National Instrument myDAQ For this experiment, we will be using one of the Analog OUTPUT channels: Analog Output 0 channel AO0 is the output AGND is the ground This channel will OUTPUT a square wave to the circuit

4 National Instrument myDAQ For this experiment, we will be using one of the Analog INPUT channels: Analog Input 0 channel AI0+ is the positive side AI0- is the negative side This channel is a voltmeter and will be used to measure the voltage across the resistor

5 Square Waves A square wave is a periodic signal that oscillates between two values. The period, T, is the time for one complete cycle (T = 1/f) The frequency, f, is the number of cycles in 1 second (f = 1/T) The duty cycle, tau, is the percentage of time the wave is at the higher value. Period: T = Frequency: f = Duty cycle: tau = Average Value = Period: T = Frequency: f = Duty cycle: tau = Average Value = 0.5 sec 2 Hz (cycles/sec) 50% 0.5 sec 2 Hz 80% 5 V 8 V

6 How to Create Square Waves in MATLAB 1.Create a vector of times, t, typically based on the period of the square wave. 2.Use the square function in MATLAB: square(2*pi*frequency*t, tau) Note: square wave will oscillate between -1 and +1 Example: Here is how the 2 Hz square wave on the previous page with the 80% duty cycle was created. t = 0:0.001:1; y = 5*square(2*pi*2*t,80)+5; % f = 2 Hz and tau = 80% * Multiplying by 5 then adding 5 makes the square wave go from 0 to 10.

7 Pulse Width Modulation Square Waves with varying duty cycles are used in many control and communication applications. One very common application is to control the speed of a DC motor. The duty cycle is increased to increase the speed of the motor and decreased to reduce the motor speed. This type of control is referred to as Pulse Width Modulation (PWM). Our DAQs don’t source enough current to drive a motor so we will use PWM to control the light level of a Light Emitting Diode (LED).

8 Diodes are “one-way” devices that only allow current to flow in one direction. An LED is a diode that emits light when sufficient current is flowing through it. Diodes are used in many, many applications such as: LED flashlights and light bulbs provide very bright light and use significantly less power than incandescent bulbs, last much longer than incandescent bulbs, and stay cool Diodes are used in circuits to convert AC power to DC power (laptop chargers, phone chargers, appliances that run on dc …) LEDs are used in displays, signs, and traffic signals DIODES

9 When the positive side of a voltage source is applied to the anode (+) side of an LED, current will flow through the circuit and the LED will light up. Light Emitting Diode (LED) Anode (+) Cathode (-) When the positive side of a voltage source is applied to the cathode (-) side of an LED, current will not flow through the circuit and the LED will not light up. Current Flows No Current Flows

10 Building the Circuit How to build your circuit using the breadboard: 1.Insert the leads of the resistor, LED, and cables into the holes in the breadboard, but don’t force them! 2.The openings A-E and F-J in each numbered row in the breadboard are electrically connected together, so placing the leads of two components in the same row will connect them 3.The openings in different numbered rows are not electrically connected, so each lead of a component should be in a different row 4.Rows on opposite sides of the middle break are not electrically connected Connected Not Connected

11 Attaching Cables How to attach a cable: 1.Insert the metal part of the cable into the port on the side of the myDAQ – make sure the metal part of the cable is above the metal bar in the port 2.Use the screwdriver to rotate the screw on top of the port clockwise to tighten the connection to the cable 3.Pull GENTLY on the cable to ensure that it is properly connected to the DAQ screwdriver Metal bar Cable end screwdriver Metal bar Cable end Correct Incorrect

12 Circuit


Download ppt "Data Acquisition Device (DAQ) A DAQ is a cool little device that allows you to interface hardware to a computer. Here is what we will do:  Create a square."

Similar presentations


Ads by Google