Example: stock market

NI myRIO Project Essentials Guide

Ed DoeringEd DoeringNI myRIO Project Essentials GuideNI myRIO Project Essentials GuideEd DoeringElectrical and Computer Engineering DepartmentRose-Hulman Institute of TechnologyivPrinted April 23, 2014. Download the latest version 2013 National Technology and Science rights reserved. Neither this book, nor any portion of it, may be copied or reproduced in any formor by any means without written permission of the Press respects the intellectual property of others, and we ask our readers to do the same. This bookis protected by copyright and other intellectual property laws. Where the software referred to in this bookmay be used to reproduce software or other materials belonging to others, you should use such softwareonly to reproduce materials that you may reproduce in accordance with the terms of any applicable licenseor other legal and National Instruments are trademarks of National other trademarks or product names are the property of their respective Disclaimers:The reader assumes all risk of use of this book and of all information, theories,and programs contained or described in it.

project-guide-vis.zip if you have not done so previously and unpack the contents to a convenientlocation, Open the project Discrete LED demo.lvproj contained in the subfolder Discrete LED demo, Expand the hierarchy button (a plus sign) for the myRIO item and then open Main.vi by double-clicking, Confirm that NI myRIO is connected to your ...

Tags:

  Guide, Project, Myrio, Myrio project

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of NI myRIO Project Essentials Guide

1 Ed DoeringEd DoeringNI myRIO Project Essentials GuideNI myRIO Project Essentials GuideEd DoeringElectrical and Computer Engineering DepartmentRose-Hulman Institute of TechnologyivPrinted April 23, 2014. Download the latest version 2013 National Technology and Science rights reserved. Neither this book, nor any portion of it, may be copied or reproduced in any formor by any means without written permission of the Press respects the intellectual property of others, and we ask our readers to do the same. This bookis protected by copyright and other intellectual property laws. Where the software referred to in this bookmay be used to reproduce software or other materials belonging to others, you should use such softwareonly to reproduce materials that you may reproduce in accordance with the terms of any applicable licenseor other legal and National Instruments are trademarks of National other trademarks or product names are the property of their respective Disclaimers:The reader assumes all risk of use of this book and of all information, theories,and programs contained or described in it.

2 This book may contain technical inaccuracies, typographicalerrors, other errors and omissions, and out-of-date information. Neither the author nor the publisherassumes any responsibility or liability for any errors or omissions of any kind, to update any information,or for any infringement of any patent or other intellectual property the author nor the publisher makes any warranties of any kind, including without limitationany warranty as to the sufficiency of the book or of any information, theories, or programs contained ordescribed in it, and any warranty that use of any information, theories, or programs contained or describedin the book will not infringe any patent or other intellectual property right. THIS BOOK IS PROVIDED ASIS. ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,ANYAND ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,AND NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, ARE right or license is granted by publisher or author under any patent or other intellectual property right,expressly, or by implication or NO EVENT SHALL THE PUBLISHER OR THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,SPECIAL, INCIDENTAL, COVER, ECONOMIC, OR CONSEQUENTIAL DAMAGES ARISING OUT OFTHIS BOOK OR ANY INFORMATION, THEORIES, OR PROGRAMS CONTAINED OR DESCRIBEDIN IT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, AND EVEN IF CAUSEDOR CONTRIBUTED TO BY THE NEGLIGENCE OF THE PUBLISHER, THE AUTHOR, OR law may not allow the exclusion or limitation of incidental or consequential damages.

3 So theabove limitation or exclusion may not apply to Introduction1I NI myRIO Starter Kit32 Discrete LED53 Seven-Segment LED Display94 Pushbutton Switch135 DIP Switches176 Relay217 Potentiometer278 Thermistor319 Photocell3510 Electret Microphone3911 Buzzer/Speaker4312 Motor4713 Rotary Encoder5114 Photointerrupter5515 Hall-Effect Sensor59viCONTENTS16 Piezoelectric-Effect Sensor63II NI myRIO Mechatronics Kit6717 Servo6918 H-Bridge and Geared Motor7519 IR Range Finder8120 Sonic Range Finder8521 Accelerometer8922 Gyroscope9523 Compass10124 Ambient Light Sensor107 III NI myRIO Embedded Systems Kit11125 Keypad11326 LCD Character Display UART Interface11727 LCD Character Display SPI Interface12128 LCD Character Display I2C-bus Interface12529 LED Matrix12930 Serial EEPROM13531 Bluetooth Module14132 Digital Potentiometer14733 Temperature Sensor15134 MEMS Microphone157 CONTENTSviiIV Additional Devices16335 USB Flash Drive16536 Webcam16937 GPS Receiver17338 RFID Reader177V Integrated Project Ideas18339 Handheld Meter18540 Wireless Sensor18741 Data Logger18942 NTP Clock19143 Steer By Wire19344 Digital Thermometer19545 3-D Color Controller19746 QR Code Scanner19947 RPN Calculator20148 Hotel Room Safe Controller20349 Tachometer20550 Scanning Sensor20751 On-Off Control System20952 Security Camera21153 Compass with Tilt Correction21354 Guitar Tuner215viiiCONTENTS55 Music Maker21756 Digital Bubble Level21957 Weather Station22158 EEPROM Programmer223VI Appendices225A MXP and MSP Connector Diagrams227B Build a Stand-Alone Application229C NI myRIO Starter Kit Data Sheets231D Video Tutorial Links2331 IntroductionWelcome to theNI myRIO Project EssentialsGuide, and welcome to the exciting world ofNI myRIO !

4 This book serves as your Guide tointerfacing your NI myRIO to the wide variety ofsensors, actuators, and displays that you will needfor your projects. Each chapter concentrates on aspecific component or device using a mixture of textand video to Guide you through the learning processnecessary to successfully integrate the componentor device into your example, consider the photocell of Chapter 9on page 35, one of the many parts included with theNI myRIO Starter Kit. You ll get immediate hands-on experience with the photocell as you build asimple demonstration circuit, connect it to one of theNI myRIO expansion ports, and run a provided Lab-VIEW program to confirm that the photocell worksproperly. After that, study a video tutorial that ex-plains photocell operating principles and learn howto design a suitable interface circuit. Next, try yourhand with the suggested modifications to the demon-stration LabVIEW code to deepen your understand-ing of the photocell behavior and LabVIEW program-ming techniques.

5 At last you will be ready to tacklethe suggested systems integration Project in whichyou combine the photocell with other book is intended for students at the junioror senior year, especially those students engagedin capstone projects or research. A background inelectrical and computer engineering is ideal, butstudents pursuing other disciplines will find thelevel of tutorial detail to be more than document is fully hyperlinked for sectionand figure references, and all video links are livehyperlinks. Open the PDF version of this documentfor the most efficient way to access all of the links;click a video hyperlink to automatically launchthe video in your browser. Within the PDF, useALT+leftarrowto navigate back to a book is organized into six major parts: Parts I through III detail the components and devices included in the NI myRIO Starter Kit, Mechatronics Kit, and Embedded Systems Kit; Part IV includes additional chapters (USB flash drive, webcam, GPS receiver, and RFID reader); Part V provides numerous ideas for complete projects that integrate two or more devices and components; and Part VI (Appendices) includes NI myRIO connector diagrams, a tutorial on building a stand-alone application (power-on your NI myRIO and the application runs immediately), collected data sheet links, and links to all video attempt has been made to ensure that the components shown in Chapters 1 through 35 match the components found in the NI myRIO component kits to which they are referenced.

6 Occasionally, components may vary slightly. Where these variations occur, details about changes and links to updated data sheets can be found here: AcknowledgementsThis book represents the contributions of many, and I gratefully acknowledge the support of these individuals at National Instruments: Gretchen Edel-mon for her technical support and encouragement regarding the book s content and organization; Margaret Barrett for inviting me to participate in the NI myRIO Beta Program; Sam Kristoff for timely advice regarding LabVIEW programming techniques; Charles Yarbrough for discussions of myRIO hardware design; and Andrew Watchorn for his ongoing support of university academic programs. I am also grateful to Tom Robbins at NTS Press for his editorial support on this DoeringDepartment of Electrical and Computer EngineeringRose-Hulman Institute of TechnologyTerre Haute, IN INI myRIO Starter Kit2 Discrete LEDLEDs, or light-emitting diodes, provide simpleyet essential visual indicators for system status anderror conditions.

7 Figure shows some typicalLEDs; the clear LEDs on the right are included inthe NI myRIO Starter : Typical LEDs including standard red andgreen, high-efficiency in various colors, and Objectives:After completing the activitiesin this chapter you will be able the essential concepts related to LEDs:(a)An LED is a diode that permits only one-waycurrent,(b) The LED forward-bias voltage drop varieswith color (wavelength),(c) The interface circuit design depends onknowledge of the DIO output resistance andsource voltage,(d) LEDs may be direct-connected to the DIOunder some circumstances, and2. Select a suitable current-limiting resistor (or noresistor) based on the LED Component DemonstrationFollow these steps to demonstrate correct operationof the discrete LED these parts from the NI myRIO Starter Kit: Two 100 resistors connected in series or two470 resistors connected in parallel Two-terminal LED Breadboard Jumper wires, M-F (2 )Build the interface circuit:Refer to the schematic di-agram and recommended breadboard layout shownin Figure on the following page.

8 The discreteLED interface circuit requires two connections toNI myRIO MXP Connector B (see Figure onpage 227):1. Anode B/+ (pin 33)2. LED control B/DIO0(pin 11)62. DISCRETE LEDF igure : Demonstration circuit for discrete LED: schematic diagram, recommended breadboard layout,and connection to NI myRIO MXP Connector the demonstration VI: you have not doneso previously and unpack the contents to aconvenient location, OpentheprojectDiscrete in the subfolderDiscrete LED demo, Expand the hierarchy button (a plus sign) forthemyRIOitem and then , Confirm that NI myRIO is connected to yourcomputer, and Run the VI either by clicking theRunbutton onthe toolbar or by pressing Ctrl+ DISCRETE LED7 Expect to see a Deployment Process windowshowing how the Project compiles and deploys(downloads) to NI myRIO before the VI : You may wish to select the Close onsuccessful completion option to make the VI results:The schematic diagram indicatesa single 220 current-limiting resistor; you mayinstead use two series-connected 100 resistorsor two parallel-connected 470 resistors from theNI myRIO Starter Kit.

9 Also, all of the LEDs in theStarter Kit have clear plastic lenses with a widevariety of colors. You may wish to try multipleLEDs to investigate your color discrete LED should be blinking on and offin synchronism with the front-panel indicatordigitaloutput state. Click theenable blinkerfront-panelbutton to disable blinking and to enable thedigitallevelbutton; click this button to manually set thedigital output state either high or low. Because thisinterface circuit is thesinking currentform (explainedin the next section), the LED is active when thedigital output is in thelowstate, , this is anactive-low LED interface theStopbutton or press the escape key tostop the VI and to reset NI myRIO ; a myRIO resetcauses all of the digital I/O pins to revert to tips:Not seeing the expectedresults? Confirm the following points: Glowing power indicator LED on NI myRIO , BlackRunbutton on the toolbar signifying thatthe VI is in run mode, Correct LED orientation the diode conductscurrent in one direction only; remove the LEDand reinsert it in the opposite direction, and Correct resistor value use an ohmmeter toverify that the resistance is near 220 Interface TheoryInterface circuit:Study the videoDiscrete LEDI nterfacing Theory( , 6:55)to learn the basics of LEDs and the two typesof interface circuits (current-sinking and current-sourcing).

10 Also studyLED Current Management( , 15:06) to learn aboutthe voltage-current characteristics of the varioustypes of diodes included in the NI myRIO StarterKit (standard, superbright, and RGB), to learnprinciples of operation of the LED interface circuitincluding the current-sinking and current-sourcingforms, and to learn how to choose the size of thecurrent-limiting programming:Study the videoDigitalOutput Express VI( , 2:21)to learn how to access all of the available digitaloutputs with the NI myRIO Digital Output ExpressVI, including single output, multiple outputs, andconnector Basic ModificationsStudy the videoLED Demo Walk-Through( , 2:03) to learn the designprinciples ofDiscrete LED demo, and then trymaking these modifications to the interface circuitand :1. Add a front-panel control to adjust the blinkfrequency specified in Hertz; at what frequencydoes the blinking become imperceptible?2. Blink two adjacent LEDs to simulate a railroadcrossing Blink the green and blue LEDs of the RGBLED using the same LabVIEW code as therailroad crossing signal; refer to Figure on thefollowing page for the RGB LED pinout the current-sourcing interface DISCRETE LED4.


Related search queries