Products > Test Equipment
Metrahit USB-IR DIY interface
(1/3) > >>
eb4eqa:
Hi All,

I have a Metrahit Energy and I would love to have also the genuine IR-USB Interface, called "USB-Xtra". But I am not willing to spend that huge amount of money on something that should be VERY cheap and that will see little use at my "lab". So I decided to to investigate and try to build something at home.

The small IR led+detector combo that can be seen in Dave's teardown of the meter seemed to be a IRDA module, so the first step was getting one. I had an Agilent DSL1100 IrDA transceiver and also a Texas Instruments TIR1000 interface lying around and decided to give it a try. Here is the story (too little time, no pictures, sorry).

There is a PDF document with the protocol information for the Metrahit Energy, which says it communicates at 38400-8N1, so I needed a 614.4KHz clock(38.4*16). I used a Fluke 6060AN 520MHz RF generator (yes, a bit overkill but I have no other) to output a 1mW sine wave which I converted to TTL simply with an 74HC04 gate with Vcc/2 bias resistor at the input, after a 100nF cap to isolate the generator from DC. This clock is fed to the TIR1000.

I used a FTDI FT232-based USB-RS232 converter to connect the PC to the TIR1000 and wired everything up, including the support electronics for the DSL1100, which requires only a few components (see its datasheet).

As simple as it sounds, everything worked at the first try. The first command the meter replied was the "IDN?<CR><LF>" with a nice string of data, as expected. All other commands specified in the document worked too. This looked even too easy....

What was next? Obvious. Download de MetraWin trial software and give it a try. Did it work? NOPE. I was fearing that it would search for the proprietary interface and give up, but using the Serial Port Monitor tool from Sysinternals, it can be seen sending different identification requests at different speeds over the FT232 converter's serial port. Different meters respond to different identification request commands, and for some (probably good) reason, the "IDN?" command was being sent at 9600bps. That meant the the Metrahit Energy was never going to reply to that. Other id request were sent at 38400 but not the string that the Energy requires. And now?

Well, I thought that maybe the official interface also includes a baud rate converter. So I took a PIC 18F4520 board I had around and wrote a quick program that converts a 9600bps string to 38400 and the other way around. I put in betwee the IRDA transceiver and the FT232 converter and I saw it working perfectly with the Intronix LogicPort (what a wonderful instrument), my converter I mean. The 9600 "IDN?" command was sent at 38400 bps, the meter replied and the converter sent the string back to the PC at 9600. BUT, the Metrawin software refuses to detect the meter.

It may be simply a timing issue or maybe something completely different. Converting from 9600 to 38400 can be done char by char because sending a char at 38400 takes less time that at 9600. But for the reverse conversion, I sotre the complete string (until <CR><LF> is received) and then send it at a time at 9600. This takes a bit of time and it may be that the software times-out.

Anyway, since the interface works with a terminal application, it is just a matter of writing a simple program that does whatever you want to do with the instrument. So I would call this a success, even if the official 30-day evaluation MetraWin software doesn't work. I plan to build a small PCB with a clock generator, IrDA module and transceiver to extract logged data from the instrument. It is easy to plot it with something else.

It would be great to have a genuine a USB X-TRA interface hooked to the logic analyzer, but I will not pay that much for it. Does anyone have one of those? Or at least ideas?

Thanks for reading,
Roberto EB4EQA

0xdeadbeef:
I'm aware that I'm digging up a very old thread, but just in case someone else is looking here for this topic, I feel it's the right place to document information regarding the "Starline" Metrahit IR communication.
Anyway, I own a Metrahit X-TRA and always wanted to try the measurement via IR but was to cheap to spend nearly 300€ on the adapter. Back one or two years ago I tried a cheap serial to IrDA adapter from eBay which failed completely and while I figured it would be probably the IrDA bitrate and bought some parts to build my own converter, I put this topic aside for other things.
Now recently, I stumbled over a little IrDA board called "IrDA2 click" which is essentially just a MCP2120 encoder/decoder and a TFDU4101 transceiver and a 7.3728MHz crystal. So I bought this and hooked it up to a cheap eBay FTDI/USB thingie (genuine FTDI though). I configured the baud rate jumpers to 38400 baud (B2=0, B1=1, B0=0), connected 5V/GND (note that by default only the 3V3 input is connected, but you can connect 5V there as well, as it's just a name). I also had to swap RX/TX lines since they are also obviously swapped inside the "IrDA2 click".
So first of all I tried a terminal at 38400baud (8bit, one start, no parity) and sending stuff like "IDN?", "TYPE?" and "POS?" worked immediately.
Then I tried the Metrawin10 demo - not expecting that it would actually work. But it did! My meter was correctly identified and I could start measurement sessions without any issues.
Maybe there is something different with the Energy, but I somewhat doubt it. To me it looks like this fixed 38400baud setup works perfectly well with either a DIY terminal communication or with Metrawin10.
So no need to buy the official cable. Unfortunately, the Metrawin10 SW itself is also quite expensive and while I'm quite sure that it should be possible to reset the trial period by deleting a hidden registry entry, I'm not really sure if this is worth it.
giovannirat:
Sounds really good.....

As I am also a owner of two older metrahit devices (18c and 18s) i am really interested in more details (schematic, where did you buy the parts, etc..)

I am not shure if my decices are compatible with your "adapter" but i would give it a try..

It would be great if you could share more information.

Thanks
0xdeadbeef:
I fear that I read somewhere that the 28S doesn't use IrDA. Also the official adapter (BD232) for the 18S is completely different from that of the Starline series (USB X-TRA).
Anyway, I listed everything I used above. As I said I just used a small IrDA adapter called "IrDA2 click"  configured to 38400baud and some cheap Chinese FTDI adapter. At the moment, this is I just wired the 5V/GND/RXD/TXD lines on a breadboard. Nothing really exciting.
My main statement was that - at least for the X-Tra, there is nothing sophisticated needed to get communication with the meter, either with a terminal program or with the Metrawin10 software.
For this device at least, it's just a plain vanilla 38400 baud IrDA connection.
quarks:
thanks for the info about IrDa2click.
I will give it a try
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod