A Versatile Labtool

User Manual

jithinbp.in/vLabtool

Videos, sample code

e-mail e-mail
vLabTool logo vLabTool logo

Introduction

A cost effective, multi-pronged data acquisition and control instrument to turn your computer into a workbench for science and electronics experiments .

vLabtool box with a little experiment vLabtool box with a little experiment

Plug and Play multitool with Experiment Oriented Apps.

Ubuntu logo Ubuntu logo
Version 12.04 or Greater

Python logo Python logo
Version 2.7 or Greater

Table of Contents

Introduction

Plug and Play multitool with Experiment Oriented Apps.

Feature Summary

Installing the software

System Requirements

Installating dependencies

List of Installed Software

Testing : Oscilloscope Application

Control widgets in the Analog Signals section

Control widgets in the Peripherals section

Control widgets in the Digital section

Testing : Wireless Units Demo

Connecting a new wireless node carrying some sensor

Logging Data from a sensor

Changing sensor parameters

Testing : Data logger Application Demo

Choosing a command and starting the logger

Additional Functionality Accessible through menus

Pin Definitions and Functions

Analog Inputs - Measure Voltages with 12-bit resolution

Analog Outputs

Digital Inputs - Measure Logic Levels with 15nS resolution

Digital Outputs

Data Buses - I2C , SPI, UART

A Few Definitions For The Expansion slot

Additional Nomenclature

Wireless Nodes

On-board Transceiver : 2-way radio link

Wireless Subunits : 3-Byte addresses

Feature Summary

Calibrated Against Professional equipment for high accuracy

Feature

Description

Socket Labels

Range

Analog Inputs

Up to 10 analog inputs with various voltage ranges.

Programmable gain and offset control.

12-bit voltage measurement. Up-to 1MSPS sampling.

5ppm , 3.3V Voltage Reference

CH1, CH2

CH3,

CH4 - CH7

SEN

I2V

±16Volts

±3.3Volts

0 − 3.3V

0 − 3.3V

±3.3mA

Analog Outputs

Programmable Voltage Sources (12-bit)

Programmable Constant Current Source

PVS1

PVS2

PVS3

PCS

±5V

±3.3V

0 − 3.3V

0 − 3.3mA

Digital Inputs

4 × TTL compatible digital Inputs.

Logic Analyzer

Frequency Counter (0-30MHz),

time measurement routines

±2.5ppm, 12M Hz Reference oscillator

ID1 - ID4

0-5 V

Waveform

Generators

  1. 1. Sine/triangle wave.

    Programmable frequency : 28-bit resolution

    Manual Amplitude Control

  2. 2. Sine wave

    Fixed Frequency

    Fixed Amplitude

  3. 3. 4 × Phase Correlated Square Waves

    Frequency

    Phase difference maximum resolution

    Duty Cycle maximum resolution

    Also functions as simple state selectable output

Wavegen

SINE

SQ1 - SQ4

5Hz - 2MHz

0-4 Volts

14 k Hz

±4Volts

0 − 5Volts

10Hz- 1 6MHz

15nS

15nS

Wireless Nodes

Battery Powered add-on units.

Power Source

Acts as a wireless bridge for various sensors

Multiple Nodes can be used together

Can also control relays and read voltages

Cell/Adapter

3.7-4.2 V

Data Buses

I2C : Master

Commonly Used by numerous sensor ICs

SPI : Master

Chip Select pins

UART

SCL,SDA

SCK,SDI,SDO

CS1 , CS2

Expansion Slot

20 - pin Socket designed to accommodate

add-on modules.

Selection includes SPI,I2C,Analog IO,Digital IO,

16MHz TTL output, and a DC Sine Wave.

Installing the software

.

The device has been tested on Debian based distributions: Ubuntu 12.04 and above, and Raspbian Wheezy. Windows support pending.

System Requirements

Processor

Entry level PCs as well as Netbooks running Intel Atom processors are

supported .  No special hardware required. Tested with the Raspberry Pi 2..

Display

Graphical Utilities are scalable down to 800x600 without scrollbars entering

into the picture.

Accelerated Graphics are only required if responsive 3D plots are being used

Installating dependencies

Run the following commands on a terminal (CTRL-ALT-T) :

  1. 1. sudo apt-get install python-qt4 python-opengl python-qt4-gl python-scipy

    python-numpy ipython-qtconsole python-setuptools python-sip

  2. 2. sudo easy_install pyqtgraph

  3. 3. sudo easy_install vLabtool

List of Installed Software

The Following is an incomplete list of graphical applications that have been installed along with the Python module, and can be run from a terminal

  1. 1. vLabtool-scope , 2-channel Oscilloscope, 4-chan Logic Analyzer, Peripheral control and curve fitting abilities.

  2. 2. vLabtool-stream , Designed to continuously plot values from any function from the vLabtool Python module that returns an integer/decimal.

  3. 3. vLabtool-sensorDemo , Auto-Detects sensors connected to the I2C expansion slot, and allows plotting their readings in real time., This requires the sensor class to be installed, and several are supported by default.

  4. 4. vLabtool-console , Launches an iPython console with the initialization functions already carried out., A plotting window is also incorporated, and can used with a single function call.

  5. 5. vLabtool-wirelessDemo , Auto Detects wireless nodes in the vicinity, and lists their addresses and connected sensors, It plots data from multiple sensors in real time.

  6. 6. vLabtool-bodePlots , Uses the programmable sine wave generator and analog inputs to obtain the frequency and phase response of filters.

  7. 7. vLabtool-diodeIV , Plots the Current-Voltage characteristics of a diode. Also forms a surface plot of multiple curves to study the temperature dependence

Testing : Oscilloscope Application

Copy the following command and run it on a terminal: vLabtool-scope

Screenshot: see the caption Screenshot: see the caption
Screenshot of the oscilloscope utility plotting a sine waves generated by the waveform generators.

The data has also been fitted, and the results displayed in the bottom section.

Control widgets in the Analog Signals section

CH1 : Channel 1 of the oscilloscope

Remappable

Not restricted to ’CH1’ input socket. This is a very flexible acquisition channel, and can be mapped to any of the analog inputs via a drop down menu located at the top corner, It also Features 12-bit offset control via a slider.

CH2 : Channel 2 of the oscilloscope

Fixed

This channel can only record the signals input to the socket labeled CH2.

TRIGGER : Allows selecting the channel to trigger the oscilloscope

Level

The rotary dial sets the trigger level, and this is also reflected in a marker

located on the plot.

Channel

The drop down menu allows selecting the trigger channel , If CH1 is selected,

the trigger signal will be obtained from the channel it has been mapped to.

Time Gap : Specify the time scale of the oscilloscope

Dial

Set the delay(in µs) between each successive data point.

Sine Fit :Uses Scipy to fit the data against a sine function

Menu 1

Select input data channel for fitting , Uses Scipy.optimize and obtains frequency, amplitude, phase and offset values.

Menu 2

Select a second input data channel for fitting.

checkbox

Overlay the fitted results.

Results

The fitted values: Amplitude, Freq, Phase, Offset are displayed in the message window at the bottom of the screen.

Lissajous : XY Plots

Menu 1

Select input data channel for X-axis.

Menu 2

Select input data channel for Y-axis.

show

Enable/Disable Lissajous overlay.

Animate

Pause data acquisition and animate the formation of the X-Y plot.

Control widgets in the Peripherals section

Screenshot: see the caption Screenshot: see the caption
Screenshot of the oscilloscope utility showing the peripherals section. The Lissajous plot has been enabled in the Analog section.

PVS1

Range : ±5V , Set the output voltage on PVS1 socket., Max Current 5mA.

PVS2

Range : ±3.3V , Set the output voltage on PVS2 socket., Max Current 5mA.

PVS3

Range : 0 − 3V , Set the output voltage on PVS3 socket., Max Current 5mA.

PCS

Range : 0 − 3.3mA, Set the output current on PCS socket. Current subject to load resistance, PCS and PVS3 are linked, and only one can be used at a time.

Wavegen

Range : 0 − 2M Hz, Set the output frequency of the waveform generator., Max resolution 0.04Hz., Amplitude control(±1mV − ±4V ) via physical knob located on the device.

Phase Correlated Square Waves (SQ1,SQ2,SQ3,SQ4)

Frequency

Range : 0 − 8M Hz, Set the output frequency of all four square waves.,

Resolution:15nS.

Output

Select the Output socket to configure.

Phase Duty

Set the phase difference (0 − 100%) , between the selected waveform and SQ1.

Cycle

Set the Duty Cycle (0 − 100%) , of the selected waveform.

Control widgets in the Digital section

Screenshot: see the caption Screenshot: see the caption
Screenshot of the digital signals section in the four channel logic analyzer mode. Four PWM signals from SQ1 - SQ4 have been connected to Digital inputs ID1-ID4. CH3 has been set to record only rising edges, while CH4 records only falling edges

Active Channels

Number of inputs to digitize . Single channel and two channel modes can record

up to 60 seconds delay between consecutive level changes with a resolution of

15nS. Three and Four channel modes can only record up to 1 ms delay between

consecutive level changes.

Acquisition time

Time to sample inputs before fetching results . The LA continuously refreshes

data at this interval..

Single Channel Options

Channel

The input to record . Select from ID1,ID2,ID3,ID4.

Edges

Types of Level changes to record. Select from options such as Falling edges only,

rising edges only, all edges.

Trigger

Channel

Enable level change trigger on selected channel.

Edges

Type of level change to use as the trigger.

3/4 channel modes

CH1-CH4

Set the type of level changes to record for each channel when the logic

analyzer is in either the 3 channel, or the 4 channel mode.

Measure Time Intervals > Important! Freeze logic analyzer before using this.

Edge 1

Select input channel and edge type that will start the timer.

Edge 2

Select input channel and edge type that will stop the timer.

Go

Run the measurement.

Results

Results will be displayed here in seconds units.

Testing : Wireless Units Demo

Copy the following command and run it on a terminal: vLabtool-wirelessDemo

Connecting a new wireless node carrying some sensor

Screenshot: see the caption Screenshot: see the caption
Screenshot of the wirelessDemo application
  1. 1. Plug in a sensor on to a wireless node by matching the pins labeled Vdd, GND, SCL, SDA . These pins appear in the same order on most sensor modules, and no extra wires should be needed.

  2. 2. Make sure that the option Register New Nodes on the Application is selected.

  3. 3. Plug In the Battery onto the wireless node.

  4. 4. Observe that the software has auto detected your wireless node as well as found out the address of the sensor you connected.

  5. 5. Unselect Register New Nodes .

    If you wish, you may move the cursor over a sensor’s address and the software will guess it’s model number/type.

  6. 6. Click on , Refresh Node List , This loads a few controls for each wireless node, and also a drop down selection of the connected sensors.

Logging Data from a sensor

  1. 1. After Following the steps in the previous section, Select the appropriate sensor and click on Go, The software will continuously plot values fetched from the sensor.

Changing sensor parameters

  1. 1. Open the auto-generated menu at the bottom left corner, and change parameters. A few examples include gain, sampling rates, and data-type selection.

Testing : Data logger Application Demo

This application plots the return values from any of the functions defined in the Python Module as long as they return integers or decimals.

Copy the following command and run it on a terminal: vLabtool-stream

Choosing a command and starting the logger

  1. 1. Refer to the programmer’s manual for a list of valid commands , and pick the function you would like to monitor, The manual can be opened from the help menu.

  2. 2. Paste the command name with correct arguments into the application . And now click on Monitor. The app includes a few common commands and appropriate arguments packed into a drop down menu linked to the command entry box.

Additional Functionality Accessible through menus

Voltmeter

Load Widgets that perform a single voltage measurement per click.

Amplifiers

Load a widget to set the gain on the voltage input channels.

Wavegen

Load a slider that allows setting the frequency of the sine wave output.

IV sources

Load widgets that , enable setting programmable voltage and current.

Timing

Load time measurement widgets , These include duty cycle and frequency.

Console

Insert an iPython Console with init commands preloaded.

help

Help menu that allows access to the programmer’s manual as well as experiment specific HTML files.

Pin Definitions and Functions

Analog Inputs - Measure Voltages with 12-bit resolution

CH1

Range: ± 16 V , Gain: up to 32×, Separate AC coupled input.

CH2

Range: ± 16 V , Gain: up to 32×, Separate AC coupled input.

CH3

Range: ± 3.3V , Gain: up to 32×, 12-bit Offset control.

*manual gain control by grounding R g via resistor R. g = 1 + 10 K R g

CH4

Range: 0 – 3.3V , Gain: up to 32×, 12-bit Offset control.

CH5

Range: 0 – 3.3V , Gain: up to 32×, 12-bit Offset control.

CH6

Range: 0 – 3.3V , Gain: up to 32×, 12-bit Offset control.

CH7

Range: 0 – 3.3V , Gain: up to 32×, 12-bit Offset control.

SEN

Range: 0 – 3.3V , Internally Pulled up to 3.3V via 5.1KOhm resistor.

AN2

Range: 0 – 3.3V , Available on the expansion slot.

AN3

Range: 0 – 3.3V , Available on the expansion slot.

Internally Monitored

5 V

The supply voltage , Measures the power supply voltage of the USB port.

V+

Measures the output voltage.

Monitor this to verify if external loads are affecting it

Analog Outputs

Waveform Generators

WG1

0-2MHz Sine/ Triangle Waveform Generator , Range: ±4V. Manual Amplitude Control via dial located on the side.

28- bit (0.04Hz) resolution

SINE

Fixed 14KHz Sine Waveform Generator , Range: ±4V.

Programmable Voltage and Current Sources (12-bit)

PVS1

Range : ±5V , Up to 10mA.

PVS2

Range : ±3.3V , Up to 10mA.

PVS3

Range : 0 − 3.3V , Up to 10mA.

PCS

Range : 0 − 3.3mA.

Subject to Load resistance. Up to 3.3V voltage drop

Digital Inputs - Measure Logic Levels with 15nS resolution

Logic Analyzer, Frequency Counter, Timing Functions

ID1

Range :  0 − 5V,  0-32MHz.

ID2

Range :  0 − 5V,  0-32MHz.

ID3

Range :  0 − 5V,  0-32MHz.

ID4

Range :  0 − 5V,  0-32MHz.

Digital Outputs

4 × PWM output with 15nS frequency, phase, and DCycle control

SQ1

Range :  0 − 5V.

SQ2

Range :  0 − 5V.

SQ3

Range :  0 − 5V.

SQ4

Range :  0 − 5V.

Data Buses - I2C , SPI, UART

I2C (Inter-Integrated Circuit) Master: Up to 4MHz Clock speed

Application

Tested With Various sensors , MPU6050, MLX90614, HMC5883L, BMP180,

TSL2561, SHT21 etc.

These measure angular velocity, acceleration, temperature, humidity, luminosity, pressure, and magnetic fields.

Vdd

3.3V Power output.

GND

Power return path.

SCL

I2C Clock Output.

SDA

I2C Data Line.

SPI(Serial-Peripheral Interface) Master: Available on the 20-pin Expansion Slot. Supports all four modes of operation.

SCK

SPI Clock Output, Tested Up To 16MHz.

SDO

SPI Data Output (MOSI).

SDI

SPI Data Input (MISO).

O1

Chip Select 1.

O2

Chip Select 2.

A Few Definitions For The Expansion slot

DDS

16MHz , 0-3.3V TTL output. This is also the reference clock for the 0-2MHz sine/triangle wave generator, and can be used to create phase correlated wavegen add-ons.

AN2

Analog Input , Range: 0 − 3.3V.

AN3

Analog Input , Range: 0 − 3.3V.

Additional Nomenclature

GND

Short for GROUND . This is the reference voltage, and is taken as 0 volts. It is also connected to the ground level of the power source (laptop/tablet/RPi etc.)

V+/V-

Power Outputs , ±9V . Current limit 20mA per channel.

Wireless Nodes

Screenshot: see the caption Screenshot: see the caption

On-board Transceiver : 2-way radio link

Capable of communicating with multiple wireless nodes to control and receive sensor data payloads

Wireless Subunits : 3-Byte addresses

A wireless subunit A wireless subunit

I2C

Data bus for Interfacing with commonly available sensors . Measure physical parameters with minimal mechanical interference.

SPI

Another data bus used by some devices. Of interest to the vLabtool are precise waveform generators, and high resolution analog instruments.

RGBout

Control WS2812B arrays , Daisy chained RGB LEDs with 16 million shades each.