Data logging with UT61E+ and UT61E question - Page 1
Forum section: electronics / testgear

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 17, 2022, 05:51:54 am
content: Hi y'al, it's been a while.I'm working on a project with DIY vactrols where I am doing PWM writes to the LED from an Arduino Mini Mega. I've been measuring the resistance of the LDR (photoresistor) with PWMs from 0 to 255 and manually recording them in a spreadsheet. This is too tedius; I want to automate the testing of all 256 values and have it generate a comma delimited list I can simply import into spreadsheet.Someone suggested a UT61E for logging the data, via RS-232. I bought the newer UT61E+ and it has a IR to USB cable with it, not the IR to RS232 cable.I've seen a python program for parsing out the RS232 data from the UT61E; I read the UT6E comes with the RS232 cable instead of the USB cable.Would this same program work with my UT61E+ if I bought the UT-D02 rs232 cable for the UT61E+ ?This UT61E+ I bought a couple weeks back, has a dent on it, so I am going to return it regardless. Maybe I should just buy the cheaper UT61E instead since it coems with the rs232 cable.Ultimately I am going to port over the code from the Python to a C++ library on the Arduino. Because I'd like to skip the PC/MAC altogether and have the same Arduino which generates the PWM to the LED in the DIY Vactrol to also read the RS232 data from the UT61E/E+.Hope my questions make sense.EDIT: I wish my Gwinstek GDM-825A bench multimeter had ability to send results over RS232 other than TRUE/FALSE; I read the manual and it only seems to send the result of a comparison test.. pass or fail... not the actual ohm reading.

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 17, 2022, 06:01:10 am
content: Btw, I tried building an auto-ranging ohm meter on my Arduino after someone shared the project on youtube.. it uses an 8 channel mux (4051) with 8 reference resistors. I found it to be way off for some lower values and off a bit for higher values. However I have since watched some videos how to improve things by using an analog reference voltage, filtering with caps etc..Should I pursue making a better ohm meter on the bread board, for easy data logging or just buy the appropriate UT61E/UT61E+ (i.e. with rs232 cable) ?

author: HKJ
author_rank: Super Contributor
timestamp: November 17, 2022, 06:43:39 am
content: The interface used from UT64E and UT64E+ is very different:UT64E uses a virtual COM port.UT64E+ uses a HID interface.For many meters with a virtual COM port you can usehttps://lygte-info.dk/project/TestControllerIntro%20UK.htmlto do the logging.

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 17, 2022, 08:09:36 am
content: I think I am just going to go with the UT61E since it has RS-232. I really want to log to the arduino with it. The arduino is controlling the voltage changes to the LED and my program can then read the multimeter after making the voltage change. Don't know how I'd do that with the above program. Makes sense if the arduino controls everything in my case. The arduino would create a two column comma delimited list of "PWM value" as well as the Ohms reading for that partciular PWM.Anyways, the UT61E with "Uni-T" brand on it is for sell on amazon for $75, however I see a Tekpower UT61E on ebay for $50. They look the same except for the brand silkscreen in top left corner. Should I save $25 and get it? over 50 were sold on ebay:https://www.ebay.com/itm/165010229698

author: HKJ
author_rank: Super Contributor
timestamp: November 17, 2022, 09:54:30 am
content: Quote from: JenniferG on November 17, 2022, 08:09:36 amIt is fairly easy to connect a Arduino to the above program, there is a couple of examples in the documentation. This means you can combine values from the Arduino and the UT61E in the log.The program also has a script language that allows it to automatic send commands to a device, i.e. you can do control from the program.There is a long thread about it here:https://www.eevblog.com/forum/testgear/program-that-can-log-from-many-multimeters/Using Arduino with TestController:https://lygte-info.dk/project/TestControllerArduino1%20UK.htmlhttps://lygte-info.dk/project/TestControllerArduino2%20UK.html

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 17, 2022, 02:25:42 pm
content: Quote from: HKJ on November 17, 2022, 09:54:30 amThank you I'll check it out.

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 19, 2022, 10:14:49 am
content: I went ahead and picked up the Tekpower UT61E for $49.99 off eBay (free shipping). I contacted them and they said the meter is identitcal, made in same factory as Uni-T and that the only difference is the silkscreen logo.https://www.ebay.com/itm/165010229698

author: myf
author_rank: Regular Contributor
timestamp: November 19, 2022, 12:33:30 pm
content: Hello,It may help you...I have 2 ut61e (not the ut61e+) and an old ut71?. I use the same usb-cable (at about 15eur) for these 3 dmm. I'm quite sure they have an hud interface and they are a little buggy.I use Linux-ubuntu. With some laptop I must reset the cable before I use it.And I must precise to sigrok exactly the dmm I use.Have a nice day.

author: rsjsouza
author_rank: Super Contributor
timestamp: November 19, 2022, 07:36:27 pm
content: I agree with you the UT61E (non-plus) is the best option here. A plain serial port is the most universal interface.One detail about its serial adapter is that you need to assert one of the serial lines (DTR or CTS, but I don't recall precisely) to properly power the circuit of the adapter.Good luck! I have a UT61E and it is a great meter!

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 20, 2022, 02:25:01 am
content: Quote from: rsjsouza on November 19, 2022, 07:36:27 pmLet's say it is DTR. So that would just be a matter of picking a digital pin on the arduino and set it to HIGH? Keep it high for DTR the entire time?Looking at this example Python code readme for this UT61E, he says DTR needs to be high and RTS is low:https://github.com/4x1md/ut61e_py/blob/master/README.mdI plan on porting the above python code to C++ for use with Arduino, STM32, ESP32 etc..

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 20, 2022, 10:33:39 am
content: 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.

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 21, 2022, 08:59:39 am
content: 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.

author: rsjsouza
author_rank: Super Contributor
timestamp: November 21, 2022, 04:22:52 pm
content: Quote from: JenniferG on November 21, 2022, 08:59:39 amDid 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.htmlAlso, 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 amThat is indeed expected. The DTR/RTS combination powers the optocoupler on the serial adapter.

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 22, 2022, 12:48:08 am
content: 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

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 22, 2022, 01:22:02 am
content: 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 wireCode used in this little test:Code:#define PIN_DTR 32void 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;if (Serial2.available() > 0) {Serial2.readBytes(buf, 14);for (int i = 0; i < 14; i++) {Serial.print(buf);Serial.print(" ");}Serial.println();}}

author: rsjsouza
author_rank: Super Contributor
timestamp: November 22, 2022, 01:42:00 am
content: Quote from: JenniferG on November 22, 2022, 01:22:02 amNice! And good music as well!Quote from: JenniferG on November 22, 2022, 01:22:02 amThe UT61E only transmits data and has no receiver, thus this is understandable.

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 22, 2022, 04:04:52 am
content: Reading 130 ohm resistor. removed the useless data from range byte, digits bytes, as well as mode byte.Code:#define PIN_DTR 32struct Packet {byte range;byte digit1;byte digit2;byte digit3;byte digit4;byte digit5;byte mode;byte info_flags;byte relative_mode_flags;byte limit_flags;byte voltage_and_autorange_flags;byte hold;byte cr;byte lf;};struct Packet packet;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;if (Serial2.available() > 0) {Serial2.readBytes((char *)&packet, 14);// remove redundant useless datapacket.range = packet.range & B00000111; // bits 7 through 3 are always 00110packet.digit1 = packet.digit1 & B00001111; // bits 7 through 4 are always 0011packet.digit2 = packet.digit2 & B00001111; // bits 7 through 4 are always 0011packet.digit3 = packet.digit3 & B00001111; // bits 7 through 4 are always 0011packet.digit4 = packet.digit4 & B00001111; // bits 7 through 4 are always 0011packet.digit5 = packet.digit5 & B00001111; // bits 7 through 4 are always 0011packet.mode = packet.mode & B00001111; // bits 7 through 4 are always 0011Serial.print("RNG: ");Serial.print(packet.range);Serial.print(" ");Serial.print("DIGITS: ");Serial.print(packet.digit1);Serial.print(" ");Serial.print(packet.digit2);Serial.print(" ");Serial.print(packet.digit3);Serial.print(" ");Serial.print(packet.digit4);Serial.print(" ");Serial.print(packet.digit5);Serial.print(" ");Serial.print("MODE: ");Serial.print(packet.mode);Serial.print(" ");Serial.println();}}

author: Gyro
author_rank: Super Contributor
timestamp: November 24, 2022, 01:25:53 pm
content: I just thought this might be a good reasonably current place to share my USB serial mod of the RS-232 adapter. I just used a bog standard USB - serial interface board from ebay, but I think the tweaks to the meter end might be an improvement on some others I've seen. As far as I can remember, it just uses the original parts for the receiver section (eg. Moving Q2 onto the Q3 footprint). I did add a 'TX' LED, in the provided PCB mounting hole (and drilling out the case hole), driven by DTR. This works with a corresponding phototransistor inside the meter, driving the serial data enable pin ('RS232') on the ES51922 chip (trck cut required), so that the meter will perform a normal sleep power down if the logging software isn't running or the adaptor removed.Unfortunately I didn't document the PCB track cuts (and some of them are not visible, but it ought to be reasonably easy to reverse engineer it from the schematic and bare PCB image.Sorry that it's badly documented, but maybe of help to somebody. I've attached modified interface schematic (the original is included in a corner of the UT61E meter schematic available on the web), bare PCB image (found on the web), my modified interface board, and the completed adaptor, (with USB-serial interface shrink sleeved).EDIT: Original RS232 Interface schematic added for reference. +/-12V supplies derived from by DTR and RTS.

author: JenniferG
author_rank: Frequent Contributor
timestamp: November 28, 2022, 08:43:12 pm
content: Quote from: JenniferG on November 17, 2022, 05:51:54 amTurns out there is quite an extensive command set to both set the functionality of the meter as well as reading results. Starts on page 99 of the manual. So it looks like I'll be writing a C++ library for the GDM-8251 as well for the Arduino; already pretty much finished the one for the Uni-T UT61A. I see how to set the baud rate but the manual mentions nothing about word length, parity and stop bits; I'll assume it's 8N1 and go from there. Curious if this meter works with Test Controller and/or Sigrok. If not, perhaps I can add it somehow and share the module for the either/both of those programs.. getting my Thinkpad here soon to run Sigrok and Test Controller. (Running Mac Mini M1 only currently.)