0% found this document useful (0 votes)
364 views3 pages

UD18 01 en

UD18 manual

Uploaded by

GlennH 59515
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
364 views3 pages

UD18 01 en

UD18 manual

Uploaded by

GlennH 59515
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Atorch UD18: Bluetooth protocol and node-red

applications

UD18 hardware
This low price device (13.88 €) is more than just a digital USB tester. See ATORCH UD18 here:
• Aliexpress: https://it.aliexpress.com/item/4000001021645.html
• Banggood: https://www.banggood.com/UD18-USB3_0DCType-C-18-in-1-USB-Tester-
APP-DC-Digital-Voltmeter-Ammeter-HD-Color-Screen-6-Bit-High-Precision-Display-
UD18-Bluetooth-Digital-Meter-p-1564949.html
The tester has 4 inputs (USB M, DC 5.5mm M, USB-typeC M, USB-tytpeC F) to be connected to a
generator, and 3 outputs (USB F, DC 5.5mm F, USB-tytpeC F) to connect to a load.
There are two buttons ([-] and [+]) and two LEDs: red (power) and blue (Bluetooth).
The measures that UD18 can carry out (6 digit precision !) are:
• Tension: 3.6…32 V
• Current: 0...5.1 A
• Power: 0...163.99 W
• Equivalent resistance: 0…999.99 Ω
Furthermore:
• Time: 0...999 ore
• Capacity: 0...99999 mAh (cumulative)
• Charge: 0...999.99 Wh (cumulative)
• USB-data+: 0...2,99 V
• USB-data-: 0...2.99 V
Numerous accessories are also available: NTC for temperature
measurements, constant current loads, triggers for PD and QC
Fig. 1: UD18 power supplies, etc ...
In addition, UD18 can function as a charge/discharge controller (FCOP: Full Cut Off Power),
disconnecting the load when one of the following events occurs (the values indicated are user-
configurable):
• Power < minW (1...9W) for XX (01...99 min.)
• Time > T-C (countdown hh:mm, 0...24h)
• Current > Over-C (0...9A)
• Tension > Over-V (0...36V)
• Tension < Low-V (0...29V)
If FCOP is ON and intervenes, an ad hoc view identifies the reason.

Main view A can be rotated clockwise in 90 ° steps


by pressing the [+] key for a long time, and
presents the instantaneous values: V, I, W (V*I) and
Req (V/I). View B rotates only 180°.
A short press on [-] key switches to black view
then to view B, which presents all the accumulated
values (Time, mAh, Wh), the FCOP conditions, the
Fig. 2: A screen Fig. 3: B screen USBdata + and USBdata- values.
In view B, the values used by FGOP can be set: by long press on [-] key the field is chosen, then it
can be modified (keys [+] and [-]). Timed automatic saving.
UD18 software
UD18 can communicate via Bluetooth (it use a JDY19, low power) and two applications can be
downloaded, one for PC and another App for smartphone (Android 5 and iPhone). Unfortunately,
both applications provided are derived from programs developed for an AC current meter (AT3010)
and present various problems.
On the other hand, the use of the only two buttons on tester is quite complex: with an application
the configuration of UD18 is simplified and new commands are also available.
UD18 protocol (reverse enginnering)
In order to use the UD18 in custon applications, the first step is to discover the protocol used.

The Bluetooth connection originates


in WIN two virtual serial ports,
visible in 'Device Manager'.
The minor index serial port is used
Fig. 4: Device manager (on my PC: COM11).

Using the application on PC, and using the excellent "Serial port monitor"
(https://www.eltima.com/products/serial-port-monitor/) as sniffer, I managed to capture and
partially decode the messages exchanged via Bluetooth. For tests and verification I also used
'Termite', a serial hexadecimal terminal (https://www.compuphase.com/software_termite.htm).
The current state of knowledge about the protocol is in the UD18-protocol.txt file.
Contributions are obviously appreciated.
Some notes:
• I have not discovered the CRC8 algorithm used. It is therefore possible to use only the 8
commands captured.
• Measurements are sent by UD18 at 1 second intervals. Voltage and current are transmitted
with only 2 decimal places, instead of all 6 digits available on the display.
UD18 custom applications
It is now possible to develop custom applications in any language, but the fastest and most versatile
solution is to use node-red (https://nodered.org/). Node-red is available on many platforms
(Windows, Linux, Raspberry, etc) and has an impressive collection of modules for IOT, MQTT,
also for communications with databases and for creating UI: perfect for quick experimental
realizations or for extensive IOT integrations.
The attached flow
(UD18flow.json) is very simple:

It reads the data sent by UD18,


decodes them and presents them on
the debug window.

It can also send the 8 know


commands.

Fig. 5: UD18 flow


The received serial data buffer is first
transformed into a json structure, then the data
are scaled and formatted to be presented on the
screen. The outputs are, in order: V, I, mAh,
Wh, USB_data-, USB_data+, time (h:m:s) and
time2 (seconds).

For transmission, the complete message first


passes into an experimental node, to test the
CRC algorithms (under investigation), then it
is sent to UD18.
It is easy to extend the flow to view the data of
interest, save it on a DB, create automatism,
etc...

The code for the Bluetooth association is


'1234': the blue LED flashes during the search
phase and is fixed when UD18 is connected.
After a 'deploy' the serial connection is
Fig. 6: Serial port reactivated either immediately or after a few
seconds.

The serial port (COM11 on my PC) is configured as in fig. 6: 8N1, 115200.

The commands work in the following way:


[+], [-] switch between view A => black screen => view B
[ENTER] rotates 90 ° view A and 180 ° view B
[setup] rotates view A. With view B the values used by FCOP can be changed:
with subsequent [setup] commands, you move forward through the fields
with [+], [-] you adjust the value (ON / OFF or numeric)
with [ENTER] you save the new value
[RESET] clears all cumulative fields (mAh, Wh, T) also exits the FCOP activated signaling
screen.
Installation
1. Install the WIN PC application first: allows you to check the correct operation of Bluetooth
and the tester (I use a USB Bluetooth dongle adapter).
2. Add new nodes to the node-red 'palette': node-red-node-contrib-binary and
node-red-node-serialport
3. Copy the contents of the UD18flow.json file to the clipboard.
4. Import into a new node-red flow from the clipboard
5. Check the used COM ports in 'device manager' and configure node-red.

Note
I developed this application in Windows 10, node-red 1.0.3. If you encounter significant differences
in other environments, please let me know, to add useful information for all node-red users.

You might also like