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
60
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: 214
Last edited:
  • Like
Reactions: cak

Wolf

Active member
Joined
Sep 25, 2018
Messages
1,693
@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:
Top