Products > Test Equipment

Data logging with UT61E+ and UT61E question

<< < (3/4) > >>

JenniferG:
I got the Tekpower multimeter in the mail today.  It came with a dead battery and I think the stock leads are really junky.. glad I have my probemasters here.

I got it hooked up to the Arduino and the arduino is reading bytes/packets successfully from it.   WHen I simply change the selector switch on the meter it sends a different packet of bytes.

JenniferG:
Update:

I am getting regular packets of data, but turns out only 7 bytes at a time -- which is wrong .. it should be 14 bytes with CRLF as last 2 bytes (not getting any CRLF bytes of the 7 bytes) . I don't know what's wrong. On DB9 I hooked pin 5 to ground, pin 4 to a digital pin on the Arduino which supplies a +5V for DTR. Pins 2 and 3 I hooked up to RX/TX. For the RTS pin I just hooked it up to ground. I have it set to 7 word length, odd parity, 1 stop bit, 19200 baud.

If DTR signal is set to LOW on arduino the multimeter doesn't send the 7 byte packets. When I set the pin to high (5V) it starts sending the packets. If I disconnect RTS from ground, it stops sending packets.. When I recconnect RTS to ground it starts sending the 7 byte packets again.

But I know it at least comunicating because it sends at regular 1/2 second intervals and the same 7 bytes.. and then when I flip modes on the multi it starts sending different, but consistent, string of bytes.

rsjsouza:

--- Quote from: JenniferG on November 21, 2022, 08:59:39 am ---I am getting regular packets of data, but turns out only 7 bytes at a time -- which is wrong .. it should be 14 bytes with CRLF as last 2 bytes (not getting any CRLF bytes of the 7 bytes) . I don't know what's wrong. On DB9 I hooked pin 5 to ground, pin 4 to a digital pin on the Arduino which supplies a +5V for DTR. Pins 2 and 3 I hooked up to RX/TX. For the RTS pin I just hooked it up to ground. I have it set to 7 word length, odd parity, 1 stop bit, 19200 baud.

--- End quote ---
Did you try to use a regular windows terminal program? The page below describes the settings and a useful terminal program that allows you to manually set the serial control signals. Regarding the settings, I made a comment a few years ago on that page that my particular meter works only with 7N1 instead of 7O1. You may want to check that. 

http://www.starlino.com/uni-t-ut61e-multimiter-serial-protocol-reverse-engineering.html

Also, there is a chance the meter sends only LF instead of CR/LF, but that is easy to test.



--- Quote from: JenniferG on November 21, 2022, 08:59:39 am ---If DTR signal is set to LOW on arduino the multimeter doesn't send the 7 byte packets. When I set the pin to high (5V) it starts sending the packets. If I disconnect RTS from ground, it stops sending packets.. When I recconnect RTS to ground it starts sending the 7 byte packets again.
--- End quote ---
That is indeed expected. The DTR/RTS combination powers the optocoupler on the serial adapter.

JenniferG:
Okay great, I ran the RX signal through a 74HC14N (inverting it) -- before sending it to the RX pin on the arduino -- and it works great!  Getting 14 byte packets ending with CR LF.

Here's the string of bytes (in decimal) with the multimeter set to Ohms:

54 50 50 53 56 48 51 49 48 48 50 48 13 10

JenniferG:
Here's a quick video of my Arduino reading 14 byte packets successfully from the UT61E.   The meter is set to ohms and two leads are connected  together directly.  I show the packets received when they are connected, and then show the packets received after disconnected, they differ in bytes.

In this example, I guess it was unnecessary that I have the Arduino transmit wire connected. :)



EDIT: PCB Mount DB9 connector is on order -- hacked it up temporarily with some large solid core wire :)


Code used in this little test:

--- Code: ---#define PIN_DTR 32

void setup() {
   Serial.begin(115200);      // coms from arduino to mac

  // ************************************************************
  // Setup Serial Communications with UT61E.
  // Serial port settings are 19200 bps, 7 data bits, odd parity
  // and 1 stop bit.  The suppied adapter also requires DTR = 1
  // and RTS = 0;
  // Pins 16 & 17 on Arduino Mega 2560 are Serial2 TX/RX.
    // ************************************************************
  Serial2.begin(19200, SERIAL_7O1); 
  pinMode(PIN_DTR, OUTPUT);
  digitalWrite(PIN_DTR, HIGH);
}

void loop() {
  byte buf[20];
 
  if (Serial2.available() > 0) {
    Serial2.readBytes(buf, 14);

    for (int i = 0; i < 14; i++) {
      Serial.print(buf[i]);
      Serial.print(" ");
    }
    Serial.println();
  }
}


--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod