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

Thread: USB Host Hardware for data logger use

  1. #1
    Senior Member
    Join Date
    Nov 2012
    Location
    Salt Lake City, UT, USA
    Posts
    259

    USB Host Hardware for data logger use

    Hi everyone, it's been a while since I have posted.

    So that you understand the issues, here is some background on this need. I have a need to do long-term (maybe months) unattended triggered data logging, with access to mains power but no Ethernet or WiFi (cellular modem is possible but not so scalable, and LoRa might work for messages but not data transfer). Right away we need to log one location. Ideally we'd like to log six or more, so at that level, cost and scaling become issues. We need to trigger the acquisition, keep at least two or three 60-Hz cycles (16.7 msec period) of pre-trigger data, and log a few more post-trigger 60 Hz cycles, for a total record of up to 10 cycles (170 msec). We'd like to sample at 100 KHz or better. I am looking into how to build an affordable data logger quickly, with no custom hardware. One option is plugging USB DSOs or similar into a PC, I'd prefer a Linux PC in hopes it would be more reliable. I have two Digilent AD2 and plan to deploy them first since it's the best COTS solution I can find right now. The AD2 can do this with its 16384 repeat mode capture at 100 ksps. These inputs will be sampling signals usually in the 12-volt range but will trigger anytime we see something like 20 V or more. The inputs could see 250 V for some tens of msec. We're looking for destructive voltage spikes (not due to lightning). Lightning hits are very brief (under a msec I am told) and the events which are happening destroy the lightning SPDs presumably because the events are so long in duration. We are trying to capture such events and track down the source. It's a thorny problem. The large, destructive events only happen at most a few times a year, on no predictable schedule. We hope to find lower-level, non-destructive events happening much more frequently. So we want to get some logging going ASAP to see if we are even on the right track. It's not a data streaming need, it's capturing 100-200 msec or so of data, at least 16K 16 bit samples per channel, and at least four channels. On the AD2 that's a .csv file of under a MB per event for two channels. So 1 GB of storage can log 500 or more events with 4 channels. Feasible on a $500 notebook PC such as ThinkPad 13.

    There are stand-alone loggers for USD$4000 and up but they are usually low bandwidth. And really, the only different between the under $500 USB DAQs and the $$$$ standalone loggers is that they basically mash up a computer board and SD card storage with the $500 analog front end. Plus the surges may wreck whatever we use for logging so we have to consider them sacrificial, and consider the mission a success as long as our data gets collected. So a cheaper front end is better.

    Longer term it might be practical to make a logger by adding a USB host device (Raspberry Pi or Teensy) to the affordable analog USB front ends from companies like Dataq. I have tried using the AD2 with a Linux PC and it does not work reliably: USB connections time out. It's a great device on a Windows PC but apparently there is some USB kernel issue with Linux in general, and (other users report) Raspberry Pi in particular. Bitscope Micro works well with the Pi so I have one of those on order too. But the Pi is not a real-time device and brings a lot of complexity to the table along with its many features.

    OK so enough background. Since we use Teensy already and like it a lot, I wonder about using Teensy with USB Host hardware as a DAQ logger and manager (it could do some more complex triggering and data analysis). Then we could plug in any of a number of analog front ends from $59 up from places like DataQ or BitScope, anyone who publishes their API and has decent functionality. Does this seem like a reasonable idea for Teensy 3.6?

    So I googled and found mention of the USB Host Shield but all the links to purchase hardware are 404s. So my question is, in the other Teensy 3.6 USB Host threads here, exactly what hardware is being used to implement the USB host connection? Is there a way to buy a decent USB host mini shield? I will feel silly if the answer is already there staring me in the face... but happy to have it.

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,278
    The T 3.6 has 2 USB ports. One (USB0) is slow (12MB/s) and (actually) device only without host support. The second (USB1) is quick (480MB/s, IIRC) and accessible through the additional holes near pins 1 to 6 (see reference card). For the latter, the USB host library for T3.6 exists and gives everything you need.

  3. #3
    Senior Member
    Join Date
    Nov 2012
    Location
    Salt Lake City, UT, USA
    Posts
    259
    Quote Originally Posted by Theremingenieur View Post
    The T 3.6 has 2 USB ports. One (USB0) is slow (12MB/s) and (actually) device only without host support. The second (USB1) is quick (480MB/s, IIRC) and accessible through the additional holes near pins 1 to 6 (see reference card). For the latter, the USB host library for T3.6 exists and gives everything you need.
    Thanks! That's all? Direct DP and DM through 33 ohm resistors to a host connector? Is anyone here using any more protection to the slave device connection? From schematics I can see there isn't any other than the 33 ohm series resistors to the Teensy slave USB pins. I'm a USB neophyte.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,525
    Quote Originally Posted by bboyes View Post
    Thanks! That's all?
    Yeah, on Teensy 3.6 you just use the 2nd port as USB host.

    All you need to do is solder a 5 pin header to those holes and connect a USB cable.

    Direct DP and DM through 33 ohm resistors to a host connector?
    But DO NOT add resistors. It's meant to connect directly using this cable, which is the same type as used on PC motherboards for USB2.

    https://www.pjrc.com/store/cable_usb_host_t36.html



    Do not use 33 ohm resistors. This 2nd port runs at 480 MBit/sec (and it can automatically drop down to 12 or 1.5 if you plug in those types of devices). It has all the impedance matching built in. Adding resistors will only mess up the signals.

  5. #5
    Senior Member
    Join Date
    Nov 2012
    Location
    Salt Lake City, UT, USA
    Posts
    259
    Perfect thanks! I will order some right now.

  6. #6
    Member
    Join Date
    Apr 2018
    Location
    Eastern Time, USA
    Posts
    67
    I have some experience in this area. For example, I have developed systems with similar specs for extended deployments on the ocean floor.

    For a Teensy Data Acq board that would be suitable for this, see my post at the following link. This is a very low noise DAQ that runs at the rates you need and has low power requirements. Get in touch with me for the rest of the configuration.

    https://forum.pjrc.com/threads/53173...ta+acquisition

  7. #7
    Senior Member
    Join Date
    Nov 2012
    Location
    Salt Lake City, UT, USA
    Posts
    259
    Quote Originally Posted by DrM View Post
    Get in touch with me for the rest of the configuration.
    https://forum.pjrc.com/threads/53173...ta+acquisition
    Very interesting. I will follow up in the other thread which shows this DAQ system.

Posting Permissions

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