EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   Instrumentation (https://ecomodder.com/forum/instrumentation.html)
-   -   Tips for USB datalogging out of an iDuino? (https://ecomodder.com/forum/showthread.php/tips-usb-datalogging-out-iduino-5931.html)

jim-frank 11-10-2008 11:16 AM

Tips for USB datalogging out of an iDuino?
 
My Iduino is working pretty reliably now, but I want to get some data logged to use for detailed analysis of mpg at different situations. I can only find sparse mention of how to interface a laptop to the beastie, and I was wondering if there are any specific posts that I'm not finding with the search function.

Thanks, all.

jim-frank 11-10-2008 12:09 PM

Hmm- couldn't edit post. I wanted to emphasize that I have the USB version of the iduino, in case that matters. I can use a VB app on the laptop, unless there's an easier way.

dcb 11-10-2008 12:15 PM

The data is in the following format
instant mpg, instant mph, instant.injHius, instant.injPulses, instant.vssPulses

000.00,000.00,000.00,000.00,000.00

It uses the display formatter and mpg/mph will be to two decimal places if under 99.995. The other values will be 000.00 if zero, or the actual integer number.

With this basic info, a laptop application can compute instant gph and apply a vsspulses/mile and us/gallon correction factor and keep track of accumulated distances, fuel usage. It gets sent out the serial port once per 1/2 second.


I'm not sure about connectivity in vb, it should just be a serial port if you have the ftdi driver installed, same one you connect to from the arduino ide for uploadign sketches.

dcb 11-10-2008 10:37 PM

FYI, played around with vb express and was able to echo the arduino serial output to the console without much fuss. would still need to parse it, but it is entirely doable (change COM4 to your com port):

Code:

Module Module1
    'based on http://support.microsoft.com/kb/904795/
    Sub Main()
        Using comport As IO.Ports.SerialPort = _
                My.Computer.Ports.OpenSerialPort("COM4")
            Do
                Dim Incoming As String = comport.ReadLine()
                If Incoming Is Nothing Then
                    Exit Do
                Else
                    Console.WriteLine(Incoming)
                End If
            Loop
            comport.Close()
        End Using

        Console.WriteLine("Press ENTER to quit")
        Console.ReadLine()
    End Sub

End Module


jim-frank 11-11-2008 10:28 AM

Thanks, that gives me a great starting point. Now what I have to do is hack a hole in the duino case for a USB cable. :D

dcb 11-11-2008 07:13 PM

If you are windows/dos you can use the following two commands also just to log it to the screen (change com4 to your com port number, and redirect the type command if you want a file). Similiar options in unix/mac land certainly.

mode com4:9600,N,8,1 >nul

type com4:

jim-frank 11-12-2008 06:55 PM

Unfortunately under win2k the easy way won't work. USB ports don't show up as COM ports, afaik. At least, I've never been able to use a USB port directly that way. I've tried to get my GPS to work outside of the proprietary software's specs, to no avail.

I haven't played with VB's communications capabilities yet, but USB seems to be much less friendly to the direct approach than plain serial ports.

Thanks for your attention to the questions I ask, though.

Jim:thumbup:


All times are GMT -4. The time now is 05:43 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com