YR1035+ enabling serial port to read data


MASSIVE restock of EV Batteries at www.batteryhookup.com 5% coupon "POWERWALLS"

Oleksii

Member
Joined
Mar 18, 2020
Messages
74
Hi all !
Owners of YR1035+ could see in Menu an entry "6. RS232" and probably wondered why is this for?
yr-settings.jpg
I figured it out !
(let me note that right here that Add: must be 00, otherwise data will be missing. And Baud can be changed, but it will not be saved when you turn device off/on)

If open it you will see this PCB:
pcb.jpg

There is once place where some chip supposed to be soldered, but it's missing:
chip-location.jpg

If look on PCB traces you will see that 2 bottom go to USB D+ and D- (using 2nd PCB layer).
And 2 traces on left go to a main square chip. If touch one (which I marked by black as T) by oscilloscope, you will see some data transmitted each half a second.

I figured out that missing chip is well known CP2102, which is serial -> usb converter, when you connect it to PC and have virtual COM port appearing.

Here is more close look:
pcb-chip-key-pin.jpg
I marked KEY by red where chip KEY pin should be.

Here are pin names from datasheet:
chip-pins.png

Where to take the chip itself?
You can by a cheap converter (there are tons of such in market) and unsolder it, here an example:
chip-source.jpg

On mine were not any marks on top (actually almost not visible white dot was), so it was hard to understand where is key pin after you unsolder it.
But bottom is such kind of mark on square corner:
chip-bck-side-key-pin.jpg

Solder it manually (it was really hard as the ship is not for manual soldering):
chip-soldered.jpg
and it appeared as serial port and I could read serial data !!! Wooohooo !

You can spot that I also soldered a small capacitor C11 on the PCB, which kind of needed according to typical schematic (C2 on it) and should be 0.1mF
chip-schema.png
That's all what I did.

Read data time!
Connect t USB and see a virtual com port!

I'm many years Linux user so here is my way how I did it. Example output data when I removed/inserted a 18650 cell a few times:

prepare port (some Linux magic) and see prints:
# tio -b 9600 /dev/ttyUSB0
read it then in more nice view:
# cat < /dev/ttyUSB0 | strings
022.5mR 3.5065Vxw
022.5mR 3.5065Vxw
022.5mR 3.5065Vxw
022.5mR 3.5065Vxw
022.6mR 3.5065Vw3
022.5mR 3.5065Vxw
022.5mR 3.5064Vy
022.5mR 3.5065Vxw
022.5mR 3.5065Vxw
022.5mR 3.5065Vxw
022.5mR 3.5065Vxw
022.5mR 3.5065Vxw
022.5mR 3.5065Vxw
01.47mR 3.5065V
OL mR 3.5966V
OL R 3.4558V
OL R 3.3377V
07.35 R 3.3377V5
OL R 3.0777V
OL R 2.9724V8
OL R 2.8733VV
OL R 2.7767V
OL R 2.5944V
OL R 2.5944V
OL R 2.5136Vx
OL R 2.3494V
OL R 2.2725V
OL R 2.1950Vh
OL R 2.1277V
OL R 2.0530V
OL R 1.9908V
00.00 R 1.9215V}
0.000 R 3.5065V
002.0mR 3.5065Vjy
020.9mR 3.5065V@e
021.5mR 3.5065V}
021.7mR 3.5065Vv
021.8mR 3.5065VF
022.5mR 3.5065Vxw
022.5mR 3.5064Vy
022.5mR 3.5065Vxw
022.6mR 3.5065Vw3
024.9mR 3.5065VN
OL R 3.5543V
OL R 3.4703V
OL R 3.4962VE
OL R 3.0845V
OL R 3.0845V
OL R 2.9823V9
OL R 2.8851V
OL R 2.6958V
OL R 2.6075V|q
OL R 2.5174V8
OL R 2.4388V1f
OL R 2.3573V
OL R 2.2769V
OL R 2.1300V{d
OL R 2.0641V
133.6 R 2.0641VX
00.00 R 1.9953V=
0.000 R 3.5065V
002.0mR 3.5065Vjy
020.6mR 3.5065Vpq
021.2mR 3.5065Vg
021.6mR 3.5064Vs`
021.7mR 3.5065Vv
021.9mR 3.5065VB

You can see some garbage at the end of each line. It's there indeed, some not ASCII bytes which I don't take care of. They should be some checksum, I guess.
Attaching also raw capture of the data, if someone needs it, find it in attachments.

I have to say that there no any software for it to read the data. I also tried read data using software for another IR meter - RC3563, but it cold not parse it correctly, so data formats are different.

Based on my success support of YR1035+ was added to Mega Cell Monitor and you can use it there.
 

Attachments

  • YR1035+.zip
    382 bytes · Views: 259
Last edited:
  • Like
Reactions: cak

Wolf

Active member
Joined
Sep 25, 2018
Messages
1,760
@Oleksii

So yea I played around with my YR1035+ and did the CP2102 update,
1640317999809.png
and I got serial data....... yes.
1640318855817.png
So now what am I going to do with it?
I can see all that on the YR1035+ screen and now I have it on my PC. so what?
Never leaving an opportunity to learn something new I got out the python book so to speak and started to play with the output string.
This is what an amature came up with after a couple of days scratching my head and losing some more hairs.
Nicely parsed output ready for machine reading and importing into excel with xwings.
1640319107135.png
Here's the code. Please feel free to snicker, laugh, tear it apart or fix it. but it works and for someone who has never coded till a few years ago I feel pretty good.

Wolf


Python:
import serial.tools.list_ports
import time
ports =serial.tools.list_ports.comports()
yr1035 = serial.Serial()

portList =[]

for onePort in ports:
    portList.append(str(onePort))
    print(str(onePort))

val = input("select Port: COM")

for x in range(0,len(portList)):
    if portList[x].startswith("COM" + str(val)):
        portVar = "COM" + str(val)
        print(portList[x])
  
yr1035.baudrate = 9600
yr1035.port = portVar
yr1035.open()

while True:
        if yr1035.in_waiting > 0:
            yr1035_data = str(yr1035.readline(18))
            #print(yr1035_data)
            values_r = yr1035_data
            values_r = values_r.lstrip("b")
            values_r = values_r.strip("'")
            values_r = values_r.strip("\\x02")
            #sep_r = 'm'
            #values_r = values_r.split(sep_r, -1)[0]
            sep_r1 = 'R'
            values_r = values_r.split(sep_r1, -1)[0]
            values_v = yr1035_data
            values_v = values_v.lstrip("b")
            values_v = values_v.strip("'")
            values_v = values_v.strip("\\x02")
            sep_v = 'R'
            values_v = values_v.split(sep_v, 2)[1]
            sep_v1 = 'V'
            values_v = values_v.split(sep_v1, 1)[0]
          
            #print(values_r)
            #print(values_v)
            print(f"RESISTANCE:{values_r}Ω")
            print(f"VOLTAGE:{values_v}V")
        
      
            time.sleep(1)
 
Last edited:

Kabron

New member
Joined
Jul 16, 2022
Messages
6
Any 3.3V USB-TTL converter could be used.
 

Attachments

  • USB.jpg
    USB.jpg
    121.5 KB · Views: 40

Kabron

New member
Joined
Jul 16, 2022
Messages
6
Your python code gives:
Traceback (most recent call last):
File "D:\Down\YR1035+\reader.py", line 40, in <module>
values_v = values_v.split(sep_v, 2)[1]
IndexError: list index out of range

after about 10 acquisitions
 

Wolf

Active member
Joined
Sep 25, 2018
Messages
1,760
IndexError: list index out of range

after about 10 acquisitions
Hm @Kabron not sure what you mean by that.
I just ran it for 80 cycles and no issues.
I am by no means a professional coder so if you can fix it please be my guest.
Maybe it works on the CP2102 better?
¯\_(ツ)_/¯

Wolf


C:\RC3563>python yr1035.py
COM3 - Silicon Labs CP210x USB to UART Bridge (COM3)
select Port: COM3
COM3 - Silicon Labs CP210x USB to UART Bridge (COM3)
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8141V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8141V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8141V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.2mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
RESISTANCE:70.3mΩ
VOLTAGE: 3.8142V
 

Kabron

New member
Joined
Jul 16, 2022
Messages
6
Here is my output
COM137 - USB Serial Port (COM137)
RESISTANCE: OL Ω
VOLTAGE: .00064V
RESISTANCE:^x\x02 OL Ω
VOLTAGE: .00058V
RESISTANCE:8f^x\x02 OL Ω
VOLTAGE: .00065V
RESISTANCE:V{\xcex\x02 OL Ω
VOLTAGE: .0005V
RESISTANCE:V\x89\xfex\x02 OL Ω
VOLTAGE: .V
RESISTANCE:63Vxnx\x02 OL Ω
VOLTAGE: .V
RESISTANCE:50V\x88\x9ex\x02 OL Ω
VOLTAGE: .V
RESISTANCE:57V\x8a\xaex\x02 OL Ω
VOLTAGE: .V
RESISTANCE:52V\x89\xfex\x02 OL Ω
VOLTAGE: V
RESISTANCE:.00057V\x8a\xaex\x02 OL Ω
VOLTAGE:V
Traceback (most recent call last):
File "D:\Down\YR1035+\reader.py", line 40, in <module>
values_v = values_v.split(sep_v, 2)[1]
IndexError: list index out of range
And this is COM sniffer output
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 36 34 56 7a 5e x. OL R .00064Vz^
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 35 38 56 8f 5e x. OL R .00058V.^
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 36 35 56 7b ce x. OL R .00065V{.
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 35 32 56 89 fe x. OL R .00052V..
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 36 33 56 78 6e x. OL R .00063Vxn
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 35 30 56 88 9e x. OL R .00050V..
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 35 37 56 8a ae x. OL R .00057V..
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 35 32 56 89 fe x. OL R .00052V..
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 35 37 56 8a ae x. OL R .00057V..
78 02 20 20 4f 4c 20 20 52 20 2e 30 30 30 35 36 56 8b 3e x. OL R .00056V.>
78 02 20 20 4f 4c 20 20 x. OL
Obviously your and my data out are different. Maybe new FW version/ Mine is 2.211
 

Kabron

New member
Joined
Jul 16, 2022
Messages
6
yr1035_data = str(yr1035.readline(19))
this corrects the problem
 

Kabron

New member
Joined
Jul 16, 2022
Messages
6
Apropo,
did you observe such screen?
It appeared with beep after several minutes of serial communication and start to send the following data:
78 02 2d 2d 2d 2d 2d 20 52 20 2d 2d 2d 2d 2d 2d 56 da ef x.----- R ------V..
78 02 2d 2d 2d 2d 2d 20 52 20 2d 2d 2d 2d 2d 2d 56 da ef x.----- R ------V..
78 02 2d 2d 2d 2d 2d 20 52 20 2d 2d 2d 2d 2d 2d 56 da ef x.----- R ------V..
 

Attachments

  • VOhm.jpg
    VOhm.jpg
    69.5 KB · Views: 15

Wolf

Active member
Joined
Sep 25, 2018
Messages
1,760
Obviously your and my data out are different. Maybe new FW version/ Mine is 2.211
Yes I concur. Could definitely be either the firmware or the CP2102.
By enabling line 26 #print(yr1035_data) I get a result of b'\x0200.06mR 7.8701V\x ***' or whatever suffix it likes. could be x92k or in this case xa2.
Hence all the lstrip and strip functions to clean the data up.
1658114421408.png1658114498929.png1658114738124.png
If I add your suggestion and change from 18 to 19 I start getting odd results.
yr1035_data = str(yr1035.readline(19))
So in conclusion It works for me with the CP2102 and may not work for all TTL chips
( some code manipulation may be required)
Apropo,
did you observe such screen?
I do after some time it will go to "Sleep" when there is no reading. Albeit I get the same visualization on the serial monitor.
Wolf

1658115112236.png1658115243633.png
 
Top