Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: USB DAQ with the Teensy

  1. #1

    USB DAQ with the Teensy

    Working with a senior instrumentation specialist, we have implemented a USB DAQ module using the Teensy 3.2, with analog circuits designed around the electrical characteristics of the Teensy ADCs and DAC. There is also a precision current amplifier that we designed to pair with the board, and the system with software, provides measurement into the pA and pF ranges. The control software is written in Python and provides a GUI and CLI.

    I have been using the system to characterize OLEDS and measure detailed electrical effects of surface contamination. In these studies I routinely clock the two ADCs and DAC together, at 200 kHz without data loss.

    If anyone is interested, please let me know. I am planning to make some extra copies of the boards.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	IMG_7161.small.JPG 
Views:	67 
Size:	217.7 KB 
ID:	14254  
    Last edited by DrM; 07-22-2018 at 03:13 PM.

  2. #2
    I want to add that the noise performance for the Teensy DAQ board is better than 0.1 mV.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    I think it'd be really interesting to see more details, especially on the control software, even just screenshots and a little info about what it does with the data.

    We get questions about doing this sort of project pretty regularly. Sometimes the questions are about pushing the USB limits. I believe quite a few people would be really interested to know more about how you did this, if you're willing to share.

  4. #4
    I am indeed willing to share. This is a screen shot of the python GUI that we use for testing our solid state lighting devices. You'll notice that it is pretty quiet, even though I just now ran it with the unshielded board sitting on my desk with open inputs except for the wire patching the DAC output to the input labeled Voltage.

    Click image for larger version. 

Name:	Screenshot from 2018-10-07 18-42-02.png 
Views:	16 
Size:	51.6 KB 
ID:	14908

    The data is output as floating point or binary values to a column formatted ASCII file.

    The gui runs alongside a console CLI, so that you can enter commands or click buttons and see the interaction between the program and the Teensy DAQ. There is also a stand-alone CLI program.

    There is a help command that lists and briefly explains the complete command set for the firmware along with commands recognized in the CLI.

    The CLI (no graphic) and the GUI programs, can take commands from stdin and write to stdout, and provide syntax to string commands together, sleep, wait, and pipe or tee to a file. I have automated a lot of my data acquisition procedures using bash to feed commands into the CLI or GUI.

    Some of the important DAQ features include
    • a ramp control for the DAC output (this is very impprtant when the test article is capacitive).
    • scanning the DAC while reading the analog inputs
    • generate a tone and save the analog inputs
    • scanning frequency with the tone finction
    • stream data
    • single read and write for analog input and output
    • set and read digital i/o pins

    Here is the Analog input control dialogue. Notice that it has settings for labels, scale, and differential or single ended input (this is controlled by a digital i/o pin). The number of channels is set in CLI or cfg file. There are four input circuits on the TDAQ board, and I have external boards that add more channels,

    Click image for larger version. 

Name:	Screenshot from 2018-10-07 19-15-15.png 
Views:	12 
Size:	7.1 KB 
ID:	14910

    And here is the Analog/DAC output control dialogue. Notice that it has settings for rate and an external gain. The output OP-AMP provides up to 40 mA, and when needed, I also have an external power OP-AMP that works as a fast, voltage controlled power supply or amplifier.

    Name:  Screenshot from 2018-10-07 19-14-51.png
Views: 64
Size:  6.0 KB
    Last edited by DrM; 10-08-2018 at 12:36 AM.

  5. #5
    Here is a capacitance measurement, it was made by measuring amplitudes as a function of frequency. The parallel resistance refers to leakage current.

    In addition to the conventiional DAQ functions (read voltage, set voltage, set/read pin, etc) the firmware also has tone and frequency sweep functions that can use the two ADC's together.

    In this instance, the frequency sweep was run at a clock rate of 200 kS/s per ADC, at 16 bits, and with a command switch that causes it to return an amplitude for each of the two channels at each tone frequency. The firmware uses a Goertzel to extract amplitude and phase.

    Click image for larger version. 

Name:	C10PF.png 
Views:	11 
Size:	8.7 KB 
ID:	14906

    And here is a measurement for a solid state lighting device that we are studying. It has a large capacitance and more leakage current.

    Click image for larger version. 

Name:	MN-0115-3B.png 
Views:	8 
Size:	9.2 KB 
ID:	14907

  6. #6

    USB DAQ with Teensy - Noise measurements

    Here are signal and noise measurement for the four inputs in 16 bit mode, with the first three channels unconnected, and the output from the DAC set at 1.0 V and connected to Ain3. Notice that the bare inputs have noise below 0.1 mV and the DAC output has noise below 1mV.

    Chan Avg Stdev
    Ain0 3.26E-06 5.6E-E05
    Ain1 6.8E-06 7.1E-05
    Ain2 9.3E-06 8.0E-05
    Ain3 1.0 0.00067

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts