Friday, October 9, 2015

Adding an isolated data output to Mastech MS8229

As seen from the previous related post, adding data output to MS8229 does not take very long and it might prove useful at times.

However, some people might undertake that modification - which for safety reasons I don't recommend - so here you get to see a proper isolated connection.

First, the hand-drawn schematic:


Some optocouplers and resistors were scrounged from crappy USB chargers. You need 2x optocouplers and 2x or 3x resistors. The left dotted side signifies the UART converter while the right side the multimeter.

The circuit above has the added benefit that it draws no power if the data output is not connected to a computer -> if no USB is plugged into the converter the first optocoupler does not turn on, yielding no power to the second one.
It also does the necessary inversion of the signal by weakly pulling RX to GND at all times (through the 3.3k resistor) while turning on the second optocoupler will pull the signal to VCC (3.3V).

The resistors are randomly chosen but there is a nice hack that can be done to get rid of the 1k resistor. If you take a look at a typical optocoupler datasheet you will see that it acts as a voltage-controlled resistor, designated by the posh-sounding "CTR":


In effect, with the circuit above, I get 2mA going through the multimeter side. The current should be 3mA (3V supply divided by the 1k resistor) so my current NCTR is 2/3=66%. This is controlled by the 330 ohm resistor connected to pin 1 - which gives me 10mA forward diode current. The graph above confirms that the NCTR should be 60-70%.

By raising the 330 ohm resistor above 3.3k we should get an NCTR of less than 25%, which would enable us to get rid of the 1k resistor connected to pin 4. We've seen in the previous post that the multimeter is able to source 40mA so we should target an NCTR of <0.1.

Perhaps a 5k resistor connected to pin one should do it, I haven't tried this yet. But it also means that the current going through the LED of the second coupler will be lower, causing the current seen at the other end to be lower which might not overcome the 3.3k resistor pulling to ground. Which means the 3.3k would likely be raised to >20k.

Update: tested and implemented the idea above, see the last part of this post.




The circuit above was mounted on a breadboard and confirmed to be working.


The TX pin draws 2mA while USB is connected which would mean a third of the battery life.


I will update the post with the "PCB" and mechanical construction - I would like to integrate the USB converter entirely in the device, allowing you to use a single cable to connect to the meter, without a 'Kabelsalat'.

Update:
The 330 ohm resistor was changed to 4.7k. The 3.3k resistor was replaced with 10k. The 1k resistor was removed (i.e. direct connection).
This had the benefit of removing one resistor from the BOM and decreasing the current drawn by the multimeter to 0.3mA while USB is connected, which means that less than 25% of battery life is lost.
There might be some reception issues when the batteries are sitting at a lower voltage, but I have not tested that.

I could not find any veroboard inside the house after a spring cleaning, lost my patience and decided to wire everything bug-style:


A bit of Dremel work was done to get the PCB to sit snug inside the case and also allow the USB port to move a bit to the front so the connection is more secure:


A liberal amount of hot glue was applied to the mod:


And the board was 'isolated' with painter's tape or masking tape - the paper-based one. It's one of my favorite household items, topping hot glue, aluminium foil AND duct tape.


Speaking of aluminium foil, it wouldn't have hurt to put some over the USB module, in order to lower the RF noise. The nicer-looking yellow tape is from the manufacturer and has a tin or aluminium backing.

After assembling, with the USB port in focus, proof that the unit is still functioning:


Not only that, but it's also sending out data!


I think that's as good as it can turn up to be, I don't think I would change anything about this. The noise floor of the multimeter does not seem to be affected when connected.

No comments:

Post a Comment