Main Site Documentation

Serial Communications with 'Probe' and Powering of 'Probe' from FEZ Mainboard


#1

Hello again everybody

I have more newbie questions which I hope you can answer.

I have an old sensor probe unit (a single device) which measures voltage, temperature, and distance. This probe uses serial communications (via usb cable) to send and receive data to a computer. It used to work by user running a C program on their computer and then inputting a hexadecimal string to send to computer’s COM port and then the probe would interpret the hexadecimal string as a request and send back parameter values as hexadecimal string for computer to convert to actual values.

Example:

  1. code 1A2B is request for voltage
  2. computer writes 1A2B to COM port
  3. message is transferred to probe
  4. probe interprets message and sends voltage value as 04A1
  5. computer receives 04A1 and translates to 1.182 Volts

I would like to get this probe up and running again with a Cobra II board and was wondering which Serial Modules would let me do it and if it would work with probe.

The modules in catalog are:

USB-Serial Module https://www.ghielectronics.com/catalog/product/287
USB-Serial SP Module https://www.ghielectronics.com/catalog/product/437
RS485 Module https://www.ghielectronics.com/catalog/product/479

I will definitely need TX and RX, but don’t think I would need RTS and CTS (I think these two are just for handshaking but the probe does not use handshaking).

Now I cannot remember but I think the probe will maybe need to be powered through the serial connection (maybe up to but no more than 200mA).
USB-Serial Module does not have any 3.3v or 5v pin connections but both USB-Serial SP Module and RS485 Module do have them, so will either of these two be able to supply power to probe or are they only meant for receiving power?

Also, I know that RS485 Module does not have a USB plug, but I do not mind stripping the probe usb cable and connecting wires directly to RS485 Module.
But I know the probe serial cable uses four wires (i think one each for RX, TX GND, but not sure about what forth cable does, maybe power) and the RS485 Module only has three connection slots for wires, so I would not know what to do with the fourth wire?
Any suggestions?

I know it is probably easier to just buy similar modules for gadgeteer or just use it directly with old computer (code won’t run on windows 7 and I do not have XP anymore) but I would like to get it working with a portable system (not stationary computer) and prefer the nostalgia of using my old probe.

Help much appreciated, thanks.


#2

Hi Jason,

do you know what form of serial connector is on the “probe” ? Based on the way you describe the device and it’s age, I am guessing it’s likely a DB9, meaning it’s an RS-232 connection, but to be absolutely sure you will need to find the details of the interface (not the command structure - yet). Once you know that, you can be certain of the correct module to buy.

Powering the device - that is probably not done over standard connections to a PC, given that there is no voltage output pin available. Again, if the device does something specific you may need to look at it’s manual / website to find the details, and only then would it be possible to help figure out a scheme to achieve that.


#3

Hi Brett,

Sorry but it looks like I made a mistake in my last post, there are actually six wires within the serial cable.

Also, I forgot to mention their is a small box near the probe plug end of the cable and after opening it up it turns out to have a small pcb in it (looks like some kind of amplifier circuit, probably to convert from serial cable to usb cable.
So cable is of form USB----------PCB–ProbePlug.

On the probe end of the cable the plug is shaped like a cylinder with five holes in it (looks like a gatling gun) and the computer side of the plug is just a regular usb plug.

The cable has six wires, including a red, orange, yellow, green, brown, and black wire.

The probe end cable connects to the PCB using red, orange, green, brown, and black wire.

The USB end cable connects to the PCB using red, orange, yellow, brown, and black wire.

I cannot find any plugs on the probe for an external power supply and plugging it in to usb appears to power the probe (LED comes on) so I am pretty certain it is USB/Serial Cable powered.
The cable looks like it has “up to 200mA” written on it in marker.
Will any of these serial modules be able to provide such an amount of power?

If none of the modules support powering the serial cable could I just connect it directly to one of the power pins on the Cobra II board?

I have a ‘basic’ manual for the probe but it just list general information like what the hexadecimal commands are and what functions it supports. I will try to look for any other documents for it but I wouldn’t count on being able to find much more.

Edit: I found a one page concept document which says the usb cable end (one which plugs into PC) is a FTDI USB Adapter TTL232 which connects to the PCB board with +5V, Rx, Tx, and GND. Whereas the probe end is shown to connect to the PCB with Rx+, Tx+, Rx-, and Tx-.
The PCB is shown to mostly consist of resistors, 1 BC557B transistor, and 1 LM395? comparator.
Sorry, but I have not got a scanner so I can’t show the picture yet.

Closest it has to interface specifics is the following

UART - Communications
The UART is setup to match interface specifications by using the following parameters

Transmission Mode: Asynchronous, full duplex
Number of Start Bits: 1
Character Length: 8 bits
Parity: No
Number of Stop Bits: 1
Baud Rate: 1200 baud
Bit sent first in each byte: LSB

P.S. After careful scouring pages I find mention that the probe cable uses ‘modified’ RS232 for serial interface and has a 4V output for powering the probes. But doesn’t say how it is modified.

Hopefully this helps for determining serial requirements.
Thanks for trying to help.


#4

Best bet is to get all the “original” cables - but here’s how I picture it in “normal” operation in the past.

PC —(cable)— [black box]—(cable2)— [probe]

From your description, “cable” is a regular old USB cable - possibly a standard USB PC connection on the PC side, and may be custom wired to the PCB you found in the “black box”. Then there’s a specialised cable, cable2, that goes to/from black box and probe itself, and it is what I assume would be a DIN plug/socket. http://en.wikipedia.org/wiki/DIN_connector

This is reasonably good though - from replacing the PC’s perspective, all you have is a USB plug, and with your Cobra2 you can use the USB Host https://www.ghielectronics.com/docs/36/usb-host and likely you’ll find this is just serial connection over the USB. the 4v would be “stolen” from the 5v in the USB cable (my earlier comment was related to DB9 or DB25 serial connections - had you said it was a USB connection… :wink: )

Is there a reference to this probe anywhere on the internet ? Manufacturer website?

So now it’s time to explore USB host :slight_smile: First test, power your Cobra2 (USB is fine), and connect the probe’s USB cable to the USB Host port. If the same LED lights up, winner !


#5

oh and take pictures of that PCB if you want to try to track down what it’s doing :slight_smile:

EDIT: I see you found it’s an FTDI cable. Awesome, USB host caters for that out of the box :slight_smile:


#6

Yes, it looks like cable plug is similiar to DIN, I googled DIN images and found one that has similar plug/socket to my cable.

But I am confused on the difference between USB Host Module https://www.ghielectronics.com/catalog/product/270 and USB-Serial Module https://www.ghielectronics.com/catalog/product/287

From their descriptions it sounds like USB host only works with USB memory sticks or mouse/joystick/keyboard but does not say it works with serial communications, whereas USB-Serial Module says it makes a virtual serial connection which can communicate with PC.

From this it sounds like only USB-Serial Module can do serial communication, so I am worried which one will be right for using the probe.

P.S. when plugged into computer the probe cable shows (or at least is supposed to show) as a COM port, if that makes any difference for choosing module.

Will the USB Host module also support RS232-type serial communication with the probe, and for giving it power from the usb port?
And what is actual difference between USB Host Module and USB-Serial Module?

Hopefully, USB Host can support the probe directly so it will be much more convenient for me.
I just want to try to make sure that I order all components I need in one transaction.

There is no reference for probe or manufacturer on the internet, so I suspect it is some sort of custom module.

I think the PCB is just an isolation circuit to prevent power feedback from damaging the usb port. I will try to post some visuals on it over the weekend (I have no camera or scanner at moment and my phone has fuzzy resolution).

Thanks for your help


#7

you have looked athte right things, but there’s a subtle difference you need to understand.

USB HOST is for HOSTing a USB device, like a thumb drive, hard drive, keyboard or mouse. In this scenario, the netmf device can behave like it was a PC, so it can read the mouse movement or key presses and do stuff on that input.

USB-Serial is a USB CLIENT device, so the netmf device can behave like a USB SERIAL adapter that you connect to a PC. This is the opposite scenario to the host scenario.

When you have a USB device you want to plug into netmf, you need USB Host. When you have serial data you want to send to a PC, you need USB Client.

So for your scenario you want USB Host. Cobra2 has that built in.

Check out the USB Host doco https://www.ghielectronics.com/docs/36/usb-host
Item 5 in the contents is pretty clear it offers serial :slight_smile:

Here’s the thing - you don’t need to concern yourself about RS232. The FTDI chip you found is a USB to RS-232 converter, and is doing all that for you. All you need is to communicate to the FTDI chip (as a serial device over usb host) and it’ll do it’s magic getting it to the RS232 device on the end of the line.

dodgy resolution image from your phone would be better than nothing - probably worth a try, but nothing earth shattering.

Let me also clear up something - do you HAVE the Cobra2 yet? If so, do you HAVE the probe? If so, what are you waiting for, connect it up, and see if the LED lights (my bet: it will). If it does, take the serial code on the USB host page I linked to, and deploy it to your cobra, then plug the probe into it as well and watch the debug messages and report back :slight_smile:


#8

Thanks Brett

Good to know USB Host can handle it all, makes my project easier.

I have the probe but don’t actually have Cobra II yet, but it is the board I will definitely purchase after I finish making list of all components I need for my intended projects (to save on postage).
Sorry, I ticked it under ownership in my profile since it is the board I was wanting help with, so I will have to wait for postage to arrive before can confirm that it works.

Now I just have to figure out how to transfer photos from my mobile to PC (but thats a different topic).