Interfacing Arduino With Linx
Interfacing Arduino With Linx
Ahmed Okasha
okasha1st@gmail.com
LAB Goals:
Understanding:
• How Labview can be interfaced with Arduino
• Making Digital Write
• Understanding Pulse Width Modulation
• Making Analog read
Overview on measurement system
https://labviewhacker.com/doku.php?id=learn:libr
aries:linx:getting_started
Getting started with LINX Library
In LabVIEW click Tools » LabVIEW Hacker » LINX »
Firmware Wizard
Choose the Device Family
Choose the Device Type
Choose the Firmware Program Interface
Most LINX devices use a serial interface.
Click Next
Configure the Firmware Program Interface
For serial devices simply choose the COM Port associated with the device.
Click Next
Choose the Firmware Version
Click Next
Wait while the firmware is uploaded to the device.
Click Launch Example
LED Toggle Example
LED Toggle Example
Blink
Modify the previous program to make the LED
automatically blinks and repeats.
Pulse Width Modulation
Pulse Width Modulation, or PWM, is a technique for
getting analog results with digital means.
Digital control is used to create a square wave, a signal
switched between on and off.
This on-off pattern can simulate voltages in between full
on (5 Volts) and off (0 Volts) by changing the portion of
the time the signal spends on versus the time that the
signal spends off.
The duration of "on time" is called the pulse width.
If you repeat this on-off pattern fast enough with an LED
for example, the result is as if the signal is a steady voltage
between 0 and 5v controlling the brightness of the LED.
Pulse Width Modulation
Arduino's PWM
frequency at about
500Hz (Period: 2 ms)
Pulse Width Modulation
Ex: To create a 3V signal given a digital source that can be
either high (on) at 5V or low (off) at 0V, you can use
PWM with a duty cycle of 60% which outputs 5V 60% of
the time.
Selecting a duty cycle of 80% would yield 4V, 20% would
yield 1V, and so on.
UNO PWM Pins:
Exercise:
It is required to interface a potentiometer, read its analog
value (0-5v), use this value after the proper conversion as
the duty cycle to control the fading (level of illumination)
of a LED.
LED and Pot interface