Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
45 views18 pages

DCCST Unit5

LabVIEW is a software platform developed by National Instruments for data acquisition and control, utilizing a graphical programming language called 'G'. The document outlines LabVIEW's features, its environment, and its role in data acquisition systems, particularly with the NI myRIO-1900 device. It also describes various sensors and their interfacing with myRIO, detailing the conversion processes for analog, digital, and serial sensors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
45 views18 pages

DCCST Unit5

LabVIEW is a software platform developed by National Instruments for data acquisition and control, utilizing a graphical programming language called 'G'. The document outlines LabVIEW's features, its environment, and its role in data acquisition systems, particularly with the NI myRIO-1900 device. It also describes various sensors and their interfacing with myRIO, detailing the conversion processes for analog, digital, and serial sensors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 18
UNIT-V: Hardware/Software Platforms What is LabVIEW? LabVIEW (Laboratory Virtual Instrumentation Engineering Workbench) is a powerful software platform commonly used for data acquisition, instrument control, and industrial automation, Developed by National Instruments, LabVIEW was originally released for the Apple Macintosh in 1986. Its most distinctive feature is the graphical programming language called "G" that allows users to create logic visually instead of writing traditional code with complex syntax Key Features of LabVIEW Feature Description Graphical Programming | Uses °G" language with visual blocks instead of text-based code Single Platform Supports various applications from simple data acquisition to complex control systems Ease of Development | Reduces difficulties when designing complicated systems Virtual Instruments Code files with “vi" extension that simulate physical instruments Integration Seamlessly interfaces with hardware like NI myRIO for data acquisition Real-Time Capabilities | Supports real-time analysis and control applications The LabVIEW Environment When starting LabVIEW, users typically select File -> New VI to begin a project. A Virtual Instrument (VI) consists of two main components: 1. Front Panel * This is where the User Interface or Human-Machine Interface (HMI) is created * Contains controls (inputs) and indicators (outputs) * Uses the Controls Palette with elements like: * Numeric controls and indicators * Boolean switches and LEDs © Graphs and charts © Text inputs and displays 2. Block Diagram * This is where the graphical code is developed © Uses the Functions Palette which includes: * Structures (While Loops, For Loops, Case Structures) * Numeric functions * Boolean operations Timing functions File /O operations Show Image Both the Front Panel and Block Diagram are stored together in a single "wi" file. The Tools Palette provides various tools for operating and modifying objects on both the front panel and block diagram LabVIEW’s Role in Data Acqui jon Systems Data acquisition (DAQ) is the process of measuring electrical or physical phenomena such as voltage, current, temperature, pressure, or sound. A complete DAQ system typically consists of: 1, Sensors - Convert physical parameters to electrical signals 2, DAQ measurement hardware - Digitizes incoming analog signals 3, Computer with programmable software - Processes, visualizes, and stores data Show Image LabVIEW serves as the essential programmable software component in a DAQ system. It enables users to: * Configure the DAQ hardware * Monitor the collected data in real-time ‘* Analyze and process the acquired data ‘* Create custom user interfaces for data visualization ‘* Implement control algorithms based on the acquired data * Save data for future analysis or reporting Using LabVIEW's graphical programming approach simplifies the process of configuring DAQ hardware, acquiring data from sensors, processing that data, and presenting or acting upon the results. Data Acquisition System: Hardware Overview of myRIO What is the NI myRIO- 19007 The National Instruments myRIO-1900 is a portable reconfigurable /O (RIO) device designed for hands- on learning and rapid prototyping. I's particularly useful for designing control systems, robotics applications, and embedded systems. Architecture and Key Components Show Image The NI myRIO-1900 architecture includes several key components: 1, Processor. * Dual-core ARM Cortex-A9 processor running at 667 MHz * Provides computing power for real-time applications 2. FPGA (Field-Programmable Gate Array): * Xilinx FPGA for hardware-timed operations * Allows for custom digital logic implementation * Enables faster processing speeds compared to standard microcontrollers * Suitable for applications requiring quick response times 3, Memory: * Provides storage for programs and data 4. 1/0 Capabilities: * Analog Input (Al) Analog Output (AO) Digital Input/Output (DIO) Audio input and output © Power output Connectivity Options The myRIO connects to a host computer via: * USB connection * Wireless 802.11b,g,n (built-in WiFi shield) Physical Ports and Connectors Show Image The myRIO features a total of 34 pins with different functionalities, organized into several connector types: 1. MXP (myRIO eXpansion Port) Connectors A and B: * Provide primary and secondary signals * DIO lines with internal pull-up resistors * Located on the sides of the device 2. MSP (miniSystem Port) Connector C: * Provides primary and secondary signals * DIO lines have internal pull-down resistors 3. Additional Connectors: * Audio input/output jacks * USB host port * Power connection * PC connection point 4. Onboard LEDs: * Status indicators for various operations The device supports different programming languages including C, C++, and graphical language (FPGA), with LabVIEW being the most common environment for programming the myRIO. Converting Raw Data Values to a Voltage The process of converting raw sensor data to meaningful voltage measurements depends on the type of sensor being used with the NI myRIO. Here's how this conversion works for different sensor types: 1. Analog Sensors Analog sensors produce a voltage that varies with the physical phenomenon being measured, Examples include: * Potentiometers * Thermistors in voltage divider circuits * Photocells | IRrange finders * Piezoelectric sensors Conversion Process: 1. The analog voltage from the sensor is connected to one of myRIO's Analog Input channels 2. The myRIO's internal Analog -to-Digital Converters (ADCs) convert this voltage to a digital value 3. In LabVIEW, the Analog Input Express VI acquires this digital value 4. The conversion from raw ADC count to voltage follows this formula: Where: * Raw Value = Digital data read from the ADC * ADC_Bits = Resolution of the ADC (typically 10-12 bits) * Reference Voltage = Voltage range the ADC measures across (typically 5V) Show Image Example: For a 10-bit ADC with a 5V reference voltage, if the raw value read is 512: 2. Digital Sensors Digital sensors produce binary output states (HIGH or LOW). Examples include: # Hall-effect latches Pushbuttons DIP switches # Rotary encoders * Photointerrupters Conversion Process: 1. Digital outputs are connected to myRIO's Digital Input (DIO) channels 2. The voltage levels (typically OV for LOW, 3.3V or SV for HIGH) are read directly 3. LabVIEW's Digital Input Express VI or Digital Input Low-Level Vis read these as Boolean values (TRUE or FALSE) 4, No additional conversion is needed as the voltage levels directly represent the states 3. Serial Sensors Serial sensors communicate using digital protocols like SPI, I2C, or UART. Examples include: © Ambient light sensors (SPI) * Accelerometers (I2C) ‘© Temperature sensors (I2C) © RFID readers (UART) Conversion Process: 1. These sensors send data as digital packets over dedicated serial lines 2. LabVIEW uses specific Vis for each protocol (SPI Express VI, I2C Express VI, UART Express VI) 3, The received bytes or integers represent measured values, often already calibrated 4, Conversion to physical units is done according to the sensor's datasheet specifications 5. Voltage conversion isn't typically needed as these sensors communicate digitally Sensors Interfacing with myRIO Thermistor Interfacing Working Principle of a Thermistor A thermistor is a temperature-sensitive resistor whose resistance changes with temperature. The name combines "thermal" and “resistor.” Most thermistors are Negative Temperature Coefficient (NTC) type, meaning their resistance decreases as temperature increases. Show Image The relationship between temperature and resistance follows the Steinhart-Hart equation: ‘Where: © T= Temperature in Kelvin © R = Resistance in ohms * A,B, C = Steinhart-Hart coefficients specific to the thermistor Interfacing Circuit for Thermistor To interface a thermistor with the NI myRIO, a voltage divider circuit is typically used Show Image Components Required: * Thermistor, 10 kA (e.g, EPCOS BS7164K103)) © Fixed resistor, 10 kQ © 0.1 uF ceramic disk capacitor * Breadboard © Jumper wires Connections to NI myRIO MXP Connector B: 1. 5-volt power supply + B/+5V (pin 1) 2. Ground — B/GND (pin 6) 3. Temperature measurement ~+ B/A\0 (pin 3) 4, Supply voltage measurement ~ B/AI1 (pin 5) How It Works: 1. The thermistor and fixed resistor form a voltage divider 2. As temperature changes, the thermistor’s resistance changes 3. This changes the voltage at the midpoint of the divider 4, The myRIO's analog input reads this voltage 5. LabVIEW converts the voltage to resistance using the voltage divider formula 6. The resistance is then converted to temperature using the Steinhart-Hart equation Example: If the fixed resistor is 10 kO, the supply voltage is SV, and the measured voltage is 2.5V: This would indicate a temperature of approximately 25°C (77°F) for a typical 10 kO NTC thermistor. Photocell Interfacing Working Principle of a Photocel A photocell (also called a photoresistor or light-dependent resistor) is a light-sensitive resistor made from cadmium sulfide (CdS). Its resistance varies inversely with illumination in the visible spectrum (400 to 700 nm). In darkness, its resistance can exceed 10 MO, while in bright light it can drop below 100 © Show Image Interfacing Circuit for Photocell The interface circuit for a photocell with the NI myRIO is similar to that of a thermistor, using a voltage divider configuration: Show Image Components Required: * Photocell (e.g, API PDV-P9203) * Fixed resistor, 10 kO * Breadboard + Jumper wires, M-F (3x) Connections to NI myRIO MXP Connector B: 1. 5-volt power supply + B/+5V (pin 1) 2. Ground + B/GND (pin 6) 3. Photocell measurement — B/AIO (pin 3) How It Works: 1. The photocell and fixed resistor form a voltage divider 2. As light intensity changes, the photocell’ resistance changes 3. This changes the voltage at the midpoint of the divider 4, The myRIO's analog input reads this voltage 5. LabVIEW converts the voltage to resistance using the voltage divider formula: 6. The resistance value can be used to determine relative light levels Applications: * Light-based motor control *# Line-following robots ‘Laser pointer breakbeam sensors © Weather stations Hall Effect Sensor Interfacing Working Principle of Hall Effect Sensor The Hall effect is the production of a voltage difference across an electrical conductor when a magnetic field is applied perpendicular to the current flow. Hall effect sensors leverage this principle to detect magnetic fields. Show Image When a current-carrying conductor is placed in a magnetic field, the charge carriers experience a force perpendicular to both the current direction and the magnetic field. This creates a measurable voltage difference across the conductor. Hall effect sensors can provide either digital output (on/off) or analog output (proportional to field strength). The US1881 Hall-effect sensor mentioned in the text is a latching type that changes state when exposed to alternating magnetic poles. Interfacing Circuit for Hall Effect Sensor Show Image Components Required: US1881 Hall-effect latch 0.1 pF ceramic disk capacitor Breadboard © Jumper wires, M-F (3x) Connections to NI myRIO MXP Connector B: 1. 5-volt power supply ~ B/+5V (pin 1) 2. Ground — B/GND (pin 6) 3. Hall-effect sensor output -+ B/DIOO (pin 11) How It Works: 1. The US1881 has an open-drain output suitable for digital inputs 2. The myRIO's digital inputs on MXP Connectors have internal pull-up resistors 3. When a magnetic field is detected, the output changes state 4, For a latching type like the US1881, the output state changes only when a magnetic field of the opposite pole is applied 5. The digital input on myRIO reads this state change 6. LabVIEW uses Digital Input Vis to process these state changes Applications: * Proximity sensing * Position sensing * Speed sensing * Flowmeters * Liquid-tevel sensing * Brushless DC motor commutation IR Range Finder Interfacing Working Principle of IR Range Finder An IR range finder uses a beam of reflected infrared light to determine the distance to a reflective target. It emits an infrared pulse which bounces off an object and returns to a detector. The sensor's output voltage varies inversely with the distance to the object Show Image The principle involves geometric calculations using similar triangles to determine distance based on the angle of the reflected light. As an object gets closer, the angle increases, and so does the output voltage. Interfacing Circuit for IR Range Finder Show Image Components Required: IR range finder (e.g,, SHARP GP2YOA21YKOF) ‘© Jumper wires, M-F (3x) Connections to NI myRIO MXP Connector B: 1. 5-volt power supply — B/+SV (pin 1) 2. Ground = B/GND (pin 6) 3, Output signal ~ B/AIO (pin 3) How It Works: 1. The IR range finder emits infrared light and detects its reflection 2. The sensor produces an analog voltage inversely proportional to the distance 3. This voltage is connected to an analog input on the myRIO 4, LabVIEW reads this voltage and converts it to distance using calibration formulas Example Cal distance can be approximated by: ration: For the SHARP GP2YOA21YKOF sensor, the relationship between voltage and Applications: * Robot navigation * Proximity sensing ‘* Touchless switches * Object detection * Collision avoidance systems Bluetooth Module Interfacing Working Principle of Bluetooth Module Bluetooth module such as the Roving Networks RN42 on the Digilent PmodBT2 provides short-range wireless data communication. It serves as a wireless alternative to a UART-style data cable, allowing the myRIO to communicate with other Bluetooth-enabled devices. Show Image By default, the RN42 module operates in "slave" mode and offers the Serial Port Profile (SPP) service. This means that when connected to a myRIO via UART, it appears as a virtual COM port on a Bluetooth- capable computer, and to the myRIO it appears as a physical COM port. Interfacing Circuit for Bluetooth Module Show Image Components Required: * Bluetooth module (PmodBT2) © Jumper wires, F-F (8x) * ABluetooth-capable laptop or desktop computer Connections to NI myRIO MXP Connector B: 1. +3.3-volt power supply (VCC3V3) + B/+3.3V (pin 33) 2. Ground (GND) = B/GND (pin 30) 3. TX (transi data) + B/UART.RX (pin 10) 4. RX (receive data) + B/UART.TX (pin 14) 5. STATUS (output) -+ 8/D100 (pin 11) 6. RTS (output) — B/DI01 (pin 13) 7. CTS (input) + B/DIO2 (pin 15) 8. RESET (input) — B/DIO3 (pin 17) Configuration and Operation: 1. Power on the myRIO and connect the Bluetooth module 2. Reset the module; the green status LED should blink at medium speed 3. Pair the module with your computer using the default pairing code "1234" 4, Note the virtual COM port number created on your computer 5, Run a LabVIEW VI on myRIO that accesses its UART 6. Open the virtual COM port on your computer using a terminal emulator 7. When connected, the PmodBT2's green status LED goes dark, and the VI shows active status Applications: © Wireless sensor networks ‘© Remote data acquisition © Wireless control systems ‘Replacement for serial cables * Mobile device integration ‘Temperature Sensor (PmodTMP3) Interfacing Working Principle of PmodTMP3 ‘The PmodTMP3 is a temperature sensor based on the Microchip TCN75A that communicates via the I2C serial interface. U analog temperature sensors like thermistors, this is a digital sensor that provides temperature data through a digital communication protocol, Show Image The sensor contains an internal temperature-sensing element and an Analog-to-Digital Converter (ADC). It digitizes the temperature reading and makes it available through its [2C interface in two 8-bit registers. Interfacing Circuit for PmodTMP3 Show Image Components Required: ‘+ Temperature sensor (PmodTMP3) © Jumper wires, F-F (5x) Connections to NI myRIO MXP Connector B: 1, +3.3-volt supply -+ B/+3.3V (pin 33) 2. Ground = B/GND (pin 30) 3, Serial data (SDA) + B/I2CSDA (pin 34) 4, Serial clock (SCL) + B/I2C.SCL (pin 32) 5. All PmodTMP3 jumpers must be set as shown in the demonstration setup How It Works: 1. The myRIO communicates with the PmodTMP3 via the I2C bus 2. LabVIEW uses I2C VIs to send commands and read data from the sensor 3, The sensor measures temperature and stores it in two 8-bit registers 4, LabVIEW reads these registers and converts the data to temperature in degrees Celsius 5, Additional calculations can be added to convert to other units like Fahrenheit Example LabVIEW Logic: 1. Initialize 12C communication with the sensor's address 2. Send a command to read temperature registers 3, Read the two bytes containing temperature data 4, Combine these bytes into a 16-bit value 5. Apply appropriate scaling to convert to degrees Celsius 6. Display or log the temperature value Comparative Analysis of Sensors Interface | Signal | myRIO Sensor Type | Principle of Operation Applications Method | Type _| Connection Temperature measurement, Resistance varies with | Voltage ‘Analog Input Thermistor Analog thermostats, weather temperature (NTC) divider «@) stations Resistance varies with | Voltage Analog Input | Light sensing, line following, Photocell Analog illumination divider Oy breakbeam detection Direct IR Range Reflected IR light angle Analog Input | Distance measurement, voltage Analog Finder changes with distance ) obstacle detection, robotics output Voltage difference in Magnetic field detection, Hall Effect Digital Digital Input conductor when in Digital position sensing, speed Sensor output state (010) magnetic field measurement Wireless communication, Bluetooth _| Short-range wireless data | UART Digital | UART RX/TX remote monitoring, cable Module communication interface | Serial pins replacement Digital temperature l2Cserial | Digital | 2c SDAVSCL | Precise temperature sensing, PmodTMP3 | ~~ i. ° m ° measurement protocol | Serial | pins environmental monitoring Building a Simple Data Acquisition System Temperature Measurement System Here's a practical example of designing a simple temperature data acquisition system using the NI myRIO: Show Image Components: © Ni myRIO-1900 + PmodTMP3 temperature sensor or thermistor * Necessary connection wires and breadboard Implementation Steps: 1. Hardware Setup: * Connect the sensor to myRIO following the appropriate interface circuit design * For PmodTMP3: Connect to 12 pins * For thermistor: Create voltage divider and connect to analog input 2. LabVIEW Programming: * Create a new VI with Front Panel (user interface) and Block Diagram (code) For PmodTMP3: Use I2C Express VI to communicate with the sensor * Read the temperature bytes from the sensor's registers * Convert to temperature in Celsius For thermistor: * Use Analog Input Express VI to read voltage * Convert voltage to resistance using voltage divider formula © Convert resistance to temperature using Steinhart-Hart equation ‘Add display elements on the Front Panel Optionally add data logging capabilities 3, User Interface Desig © Create a temperature display (numeric and/or gauge) * Add graphs for visualizing temperature over time * Include controls for sampling rate and logging options 4, Testing and Calibrati * Compare readings with a known reference thermometer # Adjust calculations if necessary for accuracy * Test in different temperature conditions This system can be expanded to include additional features such as: © Multiple temperature sensors * Alarm thresholds for high/low temperatures * Data storage to file ‘* Network connectivity for remote monitoring ‘* Integration with other environmental sensors (humidity, pressure, etc.) Summary and Key Takeaways 1. LabVIEW provides a graphical programming environment that simplifies the development of data acquisition and control systems. 2. NI myRIO js a versatile hardware platform with multiple I/O capabilities including analog inputs/outputs, digital /O, and serial communication interfaces. 3. Converting raw data to voltage involves understanding how analog and digital sensors interface with the myRIO and how LabVIEW processes these signals. 4, Sensor interfacing requires appropriate circuits and connections depending on the sensor type: * Analog sensors (thermistor, photocell, IR range finder) typically use voltage dividers * Digital sensors (Hall effect) connect directly to digital inputs * Serial sensors (PmodTMP3, Bluetooth) use specific communication protocols 5, Data acquisition systems can be built by combining appropriate sensors with myRIO hardware and LabVIEW software to measure, process, and display physical parameters Understanding these concepts enables the development of sophisticated monitoring and control systems for a wide range of applications in engineering, research, and industry.

You might also like