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