TechTip: Raspberry Pi Data Acquisition using Universal Library for Linux

The Raspberry Pi® is a single-board computer that runs the Linux® kernel-based operating system and provides easy connections to peripheral devices, including a monitor, mouse, keyboard, and MCC data acquisition devices. With a cost of less than $40, the Raspberry Pi provides a cost-effective way to perform data acquisition. You can acquire data from most Measurement Computing USB DAQ devices using the Raspberry Pi and UL for Linux.

Acquire data from an MCC DAQ device using a test application installed on a Raspberry Pi computer.
This document provides information about how to perform the following tasks:

  • Format an SD card
  • Install an operating system onto the Raspberry Pi
  • Configure Raspberry Pi options
  • Install Universal Library for Linux drivers and build the library
  • Run an MCC Linux test app

Intended Audience
This document is intended for application developers familiar with MCC DAQ devices who are interested in acquiring data on a Linux platform using a Raspberry Pi.

The following equipment is needed to perform the exercises:

  • Raspberry Pi single-board computer – For this example, Raspberry Pi 3 model b is used, but you can use any Raspberry Pi model
  • SD card (8 GB or higher)
  • PC or Mac® with internet access
  • Ethernet® cable or wireless adapter (The Pi model used here has built in WiFi)
  • Monitor or television + HDMI cable
  • Power supply
  • Mouse or trackball
  • Keyboard
  • MCC DAQ device – I'm using a USB-1808X to perform data acquisition tasks

Click here for a listing of MCC DAQ devices supported under Linux® and compatible with Raspberry Pi.

The image below shows the Raspberry Pi configuration used to perform these exercises.

Raspberry Pi

Using an SD to Install the Operating System
You must install an operating system onto the Raspberry Pi before it can be used. This example uses Raspbian, which is a free operating system based on Debian, optimized for the Raspberry Pi hardware. NOOBS (New Out Of the Box Software) is an operating system install manager for the Raspberry Pi, and is used to install Raspbian in this example.

You use an SD card to transfer NOOBS onto the Raspberry Pi. The SD card must be formatted to remove all previous information. The following procedures show you how to perform these steps.

Watch the Video! Go to to see a video showing how to format the SD card, download NOOBS, and install the Raspbian OS onto the Raspberry Pi.

Format the SD card
Perform the following steps to format the SD card:

  1. Go to and click SD Memory Card Formatter button.
  2. Scroll to the page bottom and select the SD formatter for Windows or Mac, follow the on-screen prompts, and then save the download on the computer.
  3. Install the SD card into your PC or Mac and run the SD_CardFormatter0500SetupEN.exe (SD formatter executable).

Install the Operating System onto the Raspberry Pi
Perform the following steps to download NOOBS and install the OS onto the Raspberry Pi:

  1. Go to and click Downloads.
    Under the NOOBS section click Download Zip and save the file to your PC or Mac.
  2. Expand the zip file and copy all files to the SD Card.
  3. Remove the SD card from your PC or Mac, and install it into the Raspberry Pi.
  4. Connect the monitor, keyboard, mouse, and power.
    Connecting power will boot the Raspberry Pi.
    The Raspberry Pi Logo displays, followed by a NOOBS dialog box which shows a list of operating systems to install.
  5. Check the Raspbian checkbox and click Install, then select Yes on the Confirm dialog box to install Raspbian.
    A dialog box notifies you when installation is complete.
  6. Click OK; the Raspberry Pi starts loading Raspbian.
    If this is the first time booting Raspbian, a Setup Options menu appears. Use the keyboard arrow keys to navigate the menu.
  7. Set the configuration options, such as the language and regional settings to match your location.
  8. Tap <Finish> and press <Enter> when done setting configuration options.
    The command prompt displays pi@raspberrypi~$

Congratulations! You have now installed the Raspberry Pi operating system.

Logging In
Each time you boot up the Raspberry Pi you are prompted for the following login information:
   raspberrypi login: pi
   password: raspberry
The command prompt displays pi@raspberrypi~$

Verify Internet Access
Before downloading UL for Linux, verify that the Raspberry Pi can access the internet. You can connect an Ethernet cable or connect a USB WiFi adapter to connect with a wireless network. This example uses the Pi’s built in WiFi adapter.

  1. Double-click the WiFi Config icon on the desktop to start the wireless configuration program. The Adapter: field lists the name of the USB wireless adapter (for example wlan0); the Network: field is empty.
  2. Click Scan to list the available wireless networks.
  3. Double click on the service set identifier (SSID) network name to which you want to connect.
  4. Verify the Authentication and Encryption fields on the connection window, and enter the password in the PSK (pre-shared key) field.
  5. Click Add.
    The configuration program automatically connects to the newly configured network.
  6. Cycle the device power to reboot the Raspberry Pi and enter the login information above.

After logging in, the command prompt displays pi@raspberrypi~$.

Update the Raspberry Pi Package List
To ensure that you have the latest Raspberry Pi software versions for each package installed, enter the following code from the terminal window to update the Raspberry Pi package list.
      $ sudo apt-get update

UL for Linux
To build and install the latest version of the library, refer to the instructions on GitHub at:

MCC example apps are developed on Linux and are available for Linux supported MCC devices in C and Python. The example apps perform all the device functions such as acquire analog, counter, and digital data (as supported), test device functionality, and display device information.

Refer to, click on the link for ULHELP and select Index.html for the names of each test/example app. Pick an appropriate test app for your device.

Running Examples
Example apps are located in the examples folder. Run the following commands to execute the analog input example:

  1. C:

  2. Python:
    $ ./

There are example apps for each feature of supported devices, for example:

Function C Examples Python Examples
Analog In Ain
Analog Out AOut
Digital IO Din
Counter In CIn
Timer Out TmrPulseOut tmr_pulse_out


Each example performs a specific function of a supported device and is well commented for your review. Additional prompts appear if more information is needed, such as a channel number or frequency value. The examples run and the results displayed on the monitor.

More Information
Contact Measurement Computing Corporation if you have questions about acquiring data with the Raspberry Pi:

For more information about the Raspberry Pi, go to

Measurement Computing Corporation and the Measurement Computing logo are either trademarks or registered trademarks of Measurement Computing Corporation.
Raspberry Pi is a trademark of the Raspberry Pi Foundation.
All other trademarks are the property of their respective holders.
