Sie sind auf Seite 1von 10

Experiment No.

1
Interfacing NI LabView to Arduino
Couse: ECE 502 – Digital Communications Section: EC51FA1
Group Members: Date Performed:
Balanag, John Arthur P. Gonato, Donne Michael Date Submitted:
Catama, Kevin John A Gaanan, Carlo Instructor: Nelor Jane Laguna - Agustin
Contaoe, Marcses G.
Statement of the Problem
Data acquisition without the use of microcontrollers is often a problem in creating projects as it leads to
inaccuracy. Furthermore, the integration of electronic components without the knowledge on the medium
itself – such as programming – results to a malfunctioning system, in which yields to errors and defects.
Objectives:
1. To illustrate the connection NI Labview to Arduino for interfacing
2. To describe the program, LabVIEW, and microcontroller, Arduino Uno; and the interconnection of
the two
3. To acquire knowledge in different techniques in interfacing of Arduino Uno and LabVIEW
programming
Discussion:
Arduino is an open-source computer hardware used to develop interactive objects, taking contributions
from a variety of projects with integration of switches or sensors, and control of variety of electronic
components, engines, and other physical parameters. Moreover, Arduino is a single-board microcontroller
to make using electronics in multidisciplinary projects more accessible

Arduino projects contains software consists of a standard programming language compiler and a boot
loader that executes on the microcontroller. The sheets can be assembled by hand or purchased
preassembled; the open-source IDE can be downloaded for free.
LabVIEW is a graphical programming language that uses icons instead of lines of text to create
applications. In contrast to text-based programming languages, where instructions determine program
execution, LabVIEW uses dataflow programming, where the flow of data determines execution.

Materials
Arduino Uno
NI LabVIEW
LINX Add-on (for LabVIEW)
VI Package Manager
Procedure:
A. Interface Arduino with LabVIEW using LINX Add-on

1. Attach the Arduino Uno to your desktop PC or notebook using a USB cable.

2. Launch LabVIEW software.

3. Click Tools>> MakerHub>>LINX>> Firmware Wizard.

4. Select the COM Port associated with your device and click Next.

5. Select the Firmware Version (start with the Serial/USB firmware) and click Next.

Note: The TX (transmit) and RX(receive) LEDs on your Arduino Uno should be on for a few seconds
while the firmware is being installed
B. Interface Arduino with LabVIEW using NI VISA
1. Install the software NI VISA for LabVIEW.

2. Install the VI Package Manager - for installation/removal of add-ons to the NI LabVIEW

3. Install the LabVIEW Interface for Arduino.

4. Connect your Arduino to your PC.

5. Load the LabVIEW Interface for Arduino Firmware onto your Arduino.
C. Program LabVIEW with Arduino
1. Start the LabVIEW.
2. Create Blank VI as in Tutorial 1.
3. Go to “Block Diagram” Panel
4. Right Click on white space. Go to “Arduino” and select “init

5. First input is “VISA resource”. It is the serial port you are using for interfacing of Adruino.
You can find it in “device manager” of your computer under “ports (COM & LPT”

6. Bring cursor on first input of “Init” until it shows “VISA resource”. Right click on it. Go to
“create” and select “constant”. As it will be a constant value of Port which will be always
used for serial communication

7. Click on arrow it will show available option. Select appropriate one after checking from
device manger as mentioned above otherwise it won’t work.

8. Second input is “Baud Rate”. Create it as constant as done for “VISA resource”. Right click
on “Baud Rate” then “create” and then “constant”.

9. Third input is “Board Type”, fourth is “Bytes per packet” and fifth is “Connection type” make
them also constant
10. Click on white space on “Block Diagram” and follow “Arduino → Low Level → and select
Set Digital Pin”

11. Place “Set Digital Pin” on “Block Diagram” and join “Arduino resource” of both blocks. Create
“digital I/O pin” as constant. And write 13 in it. It will be pin we will control. Make second
input “Pin Mode” as constant and select output from drop down. It means pin will work as
output pin. Join “error in” with “error out” of other block. If any error occurs in previous block,
it will travel to next block. We will elaborate its purpose at end of article.

12. Click on white space on “Block Diagram” and follow “Arduino → Low Level → and select
Digital Write”. Place “Digital Writ ” on “Block Diagram”

13. Click on white space on “Block Diagram” and follow “Structure → select While loop”.

14. Draw a rectangle on “Block Diagram” and click on red color round icon “loop condition”

15. Create a constant by right clicking on it. I will show a “STOP” icon on diagram.

16. Bring “Arduino Resources, Error Out and Pin 13” on rectangle.

17. Connect “Resources with Resource”, “Error with Error” and “Digital IO with Pin13”.
18. For creating “value” input go to Front Panel. Right click “silver → Boolean → Push Button”
and Place it in Front Panel. It will also be shown in “Block Diagram” automatically.

19. Bring the Boolean in while loop and find “Boolean to (0,1)”.

20. Place “Boolean to (0, 1)” in “Block Diagram” and connect as shown.

21. Find “Close Block”

22. Connect Close Block.

23. Now Start Ardunio IDE.

24. Click “File” then “Open” and Follow as shown. Go through all these folders from “Computer”
onward and open LIFA_BASE Arduino file.

25. Upload the program opened using Arrow button on top of Arduino IDE.

26. Once uploading done close the Arduino IDE. It’s very important to close it because both
LabVIEW and Arduino are using COM4. If not closed LabVIEW will not be able to
communicate and it will crash.
27. Now go to Front Panel in LabVIEW and run the program.

28. Once both the Tx and Rx lights are ON; on Arduino board press Boolean button on Front
Panel. You will observe LED on board connected with pin 13 is ON when we press push
button on LabVIEW once. Pressing Again send 0 so LED will be OFF.

VI. Questions

1. How does Arduino related to data acquisition for measuring, controlling, and monitoring of
different devices and sensors?

2. What will happen if other microcontrollers are used for interfacing of LabVIEW?

3. What are the techniques used for integration of Arduino Uno and LabVIEW programming? What
is the most user-friendly from the techniques mentioned?
Part IV
RESULTS AND DISCUSSIONS
4.1 Results on Experiment 1: Interfacing NI LabView to Arduino

The experiment shows the control of prototypes using LabVIEW and Arduino Uno interface. In this case,
since the microcontroller used is an open source, the experimenters have chosen the project in this paper as
a testing prototype. The LabVIEW with Arduino and soil moisture sensor - as shown - is implemented
successfully in the system.

Das könnte Ihnen auch gefallen