Arduino via USB as data logger for serial output from measuring device

Hello!
I would like to read in the serial output of a measuring device using an Arduino (no preferences). The device sends via USB (CH340). On PC/Mac I read in 8n1 9600 via a terminal application.

Only numbers (a pair of numbers separated by a comma, e.g. 3647E-07, 0000 or 3647E-05, 2124) are sent.
I set the interval rate (0.5s - 3min) on the unit.

If I have the data in the Arduino, I would do the second part (date & time) and prepare it as a csv in the first step and expand it with a GPS interface to include the geo data) and store it on an SD card if there is a delta from the previous data set (data minimisation).

So far I have experience with reading in sensors via I2C etc. and also experience with sending codes via USB to the PC (aka Control Box with Digistump etc).

I am now missing the start (any hint) on how to set up an Arduino as a “terminal application” for the measuring device - because the USB port (or a USB port) must now be the host and listen for data input.

Thanks for any tips!

Get an Arduino Mega and use one of the other serial ports to connect to your device as well as being connected to your PC

Thank You!

I have read about this, but I understand that a host shield is also required for the Mega?

It is not clear to me whether it is usually sufficient to connect a host shield like this one to a Pro Mini, for example.
See for example here: USB to USB keyboard converter build log(Pro Micro 3.3v with mini host shield) but it looks like this is one solution.

It is obviously not possible to simply " reverse " an Arduino xxx and use the USB as a host… If necessary, take two.

I have various Arduinos here, including ATTINY85 + ATTINY167 and (just discovered) an STM32F103C - which also has no host on board, but the higher models :-/ e.g. STM32F4 - it’s overdressed but if I have to buy it first… then it’s more lucrative in cost compared to the Pro Mini with host shield - only the power requirement would probably be higher…

Ever think of using a excel as terminal receiver.
There is a group that has such VBA excel program which you can modify to your needs. Its all in VB code and very readable and learnable.

Takes in Serial and dumps it into the Excel sheet directly.

I now have only a modified version as I adjusted it and improved some of the calls but not all.
It is pretty much well written and works very slick.
however it does require a Desktop version of Excel and Windows as it uses windows API calls.

I have been using it and found out I was close to writing my own… API just missed a few steps. . I was big fan of Terminal Services that Windows NT3 to NT5 had and before Windows 8 and then WIN10 totally dropped it. Sad sad day for those who did research and development.
Here is example…
It is a free down load.

Yes It works on WINDOWS 10 and Excel 2016 which is what I have. I have not updated to excel 2019 yet. I see no reason to at this time.
It does have to be a desktop version that is loaded on your machine and not excel 360 will not work.
Key words is like “DATA” and process Comma delimited data and once a newline is used it takes that as the complete data stream. Which is then dumped into excel.

PLX-DAQ version 2 - now with 64 bit support! (and further new features)

Am I understanding you correctly that you are trying to have a chain like PC->Arduino->that device you mentioned? This way you get to reformat and append data from that device you mentioned so PC doesn’t have to do anything? Or do you intend to remove PC from the chain and log directly to an sd card on an arduino? If the latter is the case, you could still get away with wiring the TX of your unnamed device to arduino and skip the while USB hosting bit altogether. Is this device you mentioned untemper-able?

Many thanks for all the answers, I now have a lot to try!

I’ll test tvgemert’s idea! I have an Intel Compute Stick with Win10, so that’s a good choice!
Sounds better than the device provider’s proprietary Windows SW (see below).

Thanks also to liuzengqiang. My goal is a battery-running unit based on Arduino. Rasperry or the Intel stick if need be. But in any case autonomous!
With battery!
Stationary, the stick variant with the PLX-DAQ would fit perfectly.

We are talking about an EMF measuring device that supplies the data via USB. A PDF is available here: http://electrosmog.org/resources/ED88TPlus%20Data%20Logging-v3.1.pdf
(the device is this: Cornet ED88TPlus, i have that too ENV RD-10)

In order to also record the coordinates, the above-mentioned idea includes GPS. I have ordered parts (USB host for Arduino, GPS module, also a MEGA, you can always have in stock) now have about 14 days for all Windows ideas… and some experimenting with a Rasperry…
Maybe the delivery will come sooner :slight_smile:

Thanks Guys!

OK I see, both models are enclosed in cases so it’s not like bare circuit boards you can wire up the serial port pins to arduino.

UHS library V2.0 doesn’t have an official driver for CH340. This is all I could find after a few searches:

Maybe it works hopefully. If not, you could have a raspberry pi zero w with a USB interfaced GPS module and make it work on the pi so you can get its readouts via python and merge data with the sensor that python can read via serial port. It’s cost more power due to the pi but it’s a linux computer so there’s lots of tools you can use. I’ve done data loggers this way, USB or serial port GPS module, several arduino custom boards each with sensors. Python code coordinates everything and spits out data file with all sensors including GPS.

If I read your question correctly you don’t need USB host. I always start with 32U4 boards like the Leonardo or Micro for stuff like this, as it has double serial ports. Perfect for having MIDI/GPS/GSM/radios talk with a computer.
On the computer side, use a program that has good tools to visualise incoming data streams from Arduino, like Processing:
www.processing.org

OP has a device they wish to interface with arduino. That device is USB only. So if the OP uses a host shield, then there is a possibility of proper driver code to driver the USB device with Arduino. Also OP wishes to eventually get rid of the computer/pi so the arduino would do all the work on battery.

Short progress report:

I can’t get the PLX-DAQ to work on my Intel stick with Excel 2016, I’ll have to test it with Excel 2013.

On the Pi zero I have a python script so far that I can get the data into a csv. I still have to do some error monitoring and will be happy to make the py available here.
It took a bit of learning, but I’m thrilled with how well it works and is a great groundwork for the Arduino.

For the Arduino, I’m still waiting for the host shield.

In the interim I have read that there is apparently a version of the Mega 2560 that already has the USB host on board. However, the price of the board would be much higher than the price of a zero, and it would also be bigger and more power-hungry…

Thank you all!

[quote=“u34g, post:11, topic:849202”]
can’t get the PLX-DAQ to work on my Intel stick with Excel 2016, I’ll have to test it with Excel 2013.
[/quote]That sounds like the original PLX, which requires Office 2003. If you use v2 by Netdevil on this forum it should be good for the latest Office.

Thank you Nick!

I mean, I would have tried both. But maybe I got confused or, because I had the 2013 on the system, the older one was loaded despite the V2?

I’ll check again carefully. Thanks for the helpful hint!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.