bmuessig / ParksideView

Program for connecting to and retrieving data from a Parkside PDM-300-C2 or PDM-300-C3 digital multimeter.
https://www.mikrocontroller.net/topic/491973
GNU General Public License v3.0
40 stars 5 forks source link

Thank you! Bluetooth possible? #16

Open atax112 opened 8 months ago

atax112 commented 8 months ago

Hello.

Vielen dank fur den app! Thank you so much for the app!

Got my multimeter and got it to work without the optoisolator (never used one), whats the point of it in this case? I have used my usb/ttl adapter, but also ordered a bluetooth ttl hc-06 module.

Would this be plug and play with the HC-06? Or is there a better way to make this bluetooth?

bmuessig commented 8 months ago

Hello atax112,

happy to hear you find the application useful 🙂

The opto-isolator is used to electrically isolate the multimeter from your computer. This is something done by all commercial data-logging multimeters. If you were for instance to use the multimeter to measure the 230V mains, there is a direct current path from the input of the multimeter to the grounded USB port on your computer, which could damage the USB port or if the hack is improperly wired you might shock yourself. It does work without it, but this is why I strongly recommend the isolator.

You can also use Bluetooth as you suggested to circumvent the above safety issues and opto-isolator, as long as the Bluetooth module is supplied with power from the internal battery.

A few years back, another forum member over at mikrocontroller.net has created a little Bluetooth mod-board to be used with my application and the PDM-300-C2 and C3. He has also released the schematics and code to make it work here: https://www.mikrocontroller.net/topic/491973#6260692

The board performs baud-rate-conversion before transmitting the data with a HC-05 module. It can then be read by the _BT variants of ParksideView.

You can also give it a try, if you can make it work directly. The required baud rate is 2400.

Let me hear how it went.

Best regards, Benedikt

atax112 commented 8 months ago

Many thanks for the explanation and hints.

I am waiting on AliExpress to deliver the hc06(should be the same as hc05?) and opto isolators I ordered when finding this project.

I have thought that it will be useful to power the meter from usb with a boost converter since it's going to stay in place at my station but the risks aren't worth it directly.

I'll add the isolator because I want to get rid of the battery and go from usb, however that said, I have two other DMMs so I won't be using this one for anything else than troubleshooting boards etc, all well below 50V. Still, to be safe...

I have checked the forum posts, topsoft did a whole custom PCB/MCU setup for Bluetooth.

I was kind of hoping the hc06 can be plugged instead of the usb TTL and the rest is maybe settings on PC, baud rate to be exact. Assuming the hc06 exposes a com port after drivers are installed.

I'm not sure why he wanted to convert the baud rates etc. Is it needed? I'll just stay with usb then...

bmuessig commented 8 months ago

Many thanks for the explanation and hints.

You're welcome 🙂

I am waiting on AliExpress to deliver the hc06(should be the same as hc05?) and opto isolators I ordered when finding this project.

In this case, HC-05 and -06 should be close enough. The -06 lacks master-mode, but this is not needed for connecting to the meter.

I have thought that it will be useful to power the meter from usb with a boost converter since it's going to stay in place at my station but the risks aren't worth it directly.

I'll add the isolator because I want to get rid of the battery and go from usb, however that said, I have two other DMMs so I won't be using this one for anything else than troubleshooting boards etc, all well below 50V. Still, to be safe...

That's a good decision. With an appropriately isolated DC/DC converter, you can still attempt to power the meter from the USB port. I am not sure if the built-in regulator inside the multimeter has enough spare current capability to power the Bluetooth module reliably. A 3.3V linear regulator or buck-converter might be advisable. You might also want to check if the ground on the multimeter is virtual (i.e. if battery negative and GND don't connect directly).

I have checked the forum posts, topsoft did a whole custom PCB/MCU setup for Bluetooth.

I was kind of hoping the hc06 can be plugged instead of the usb TTL and the rest is maybe settings on PC, baud rate to be exact. Assuming the hc06 exposes a com port after drivers are installed.

I'm not sure why he wanted to convert the baud rates etc. Is it needed? I'll just stay with usb then...

I've had a quick look at the HC-06 datasheet. I don't see why it would not be possible directly. This might just work. Before you connect the meter, configure the baud rate of the HC-06 as follows by sending this command via serial over Bluetooth: AT+BAUD2 After that, remember the serial port name and try to use regular (non-BT) ParksideView.

Good luck!

atax112 commented 8 months ago

Ok, so parts arrived, but I cant get the HC06 to work. I can connect to it with another USB TTL but I get no responses.

When I pair my phone with it and send messages via the usb ttl i can see it on the phone bt terminal and vice versa, even if coding seems to be off a bit (probably baud rate not sure) But using putty/securecrt I cannot get AT commands through for whatever reason...

I am using these:

https://www.aliexpress.com/item/32786773297.html?spm=a2g0o.order_list.order_list_main.5.756e1802OAiuel

https://www.aliexpress.com/item/32831329095.html?spm=a2g0o.order_list.order_list_main.29.756e1802OAiuel

I have also found this but cant get it to connect:

https://github.com/dilshan/hc6-config

Will give it more tries and report back, but in the meantime I have finished the multimeter. Added the isolator and hard wired the usb ttl. Couldnt figure out a way how to have it isolated but also powered from usb at the same time since the dc-dc boost converter ground/- is shorted all the way, so connecting it to the usb would skip the isolator on the ground line making it pointless.

atax112 commented 8 months ago

Hey,

I think I finally managed to set the baud rate to 2400 on the HC-06. Wasnt AT+BAUD2 command but AT+UART=2400,0,0

image

But since I already finished the multimeter, all hardwired and done I dont have another one to try it out with :D

I have a Mastech 8268 which I tried to convert a similar way some time ago, based on another approach. But couldnt get that to work. Its MCU has RX/TX pins, but I think the serial protocol isnt implemented, I couldnt read anything back then...

Maybe Ill try it with the HC-06, but have no clue if the baud rate is 2400 or what ? Not that experienced with hacking multimeters :D

image

bmuessig commented 8 months ago

I think I finally managed to set the baud rate to 2400 on the HC-06. Wasnt AT+BAUD2 command but AT+UART=2400,0,0

Great you found a solution. It would probably make sense to document this somewhere and give instructions to set up Bluetooth with the PDM300 series.

I have a Mastech 8268 which I tried to convert a similar way some time ago, based on another approach. But couldnt get that to work. Its MCU has RX/TX pins, but I think the serial protocol isnt implemented, I couldnt read anything back then...

Maybe Ill try it with the HC-06, but have no clue if the baud rate is 2400 or what ? Not that experienced with hacking multimeters :D

Good luck! I'd suggest an oscilloscope to determine the required baud rate (and to check if there is a signal at all). Falling-edge trigger at about 1V, a time base of around 100us/div and a vertical scale of 1V/div. Probe around until you get a signal, then stop the scope and use the cursors to measure the shortest pulse and then calculate the frequency using 1/period_in_seconds. If you don't have one laying around, even one of the 20 dollar scopes is worth every penny ;)