---

Friday, March 24, 2017

Logging Multimeter Readings with a Digitek DT-4000ZC on a Mac

I bought one of these multimeters a few months ago on eBay, to be able to automate the timed taking of readings using a multimeter.


Given the price, I wasn't expecting much, but it works pretty well.

Being a Mac user, I am used to either using software in a Windows XP virtual machine, or searching out alternative software for a device. I this case, I found that a Python library has already been written to decode the multimeter's strange display-based protocol. The protocol actually transmits the state of each of the segments on the display - an interesting problem to code.

To get this going, you will need to:


  1. Install Python on my Mac 
  2. Download the TP4000ZC library
  3. Unzip it and then in the directory containing the library python files you just downloaded, create a new file called 'dmm.py' and paste the following code into it:

import tp4000zc
import time
    
port = '/dev/tty.wch ch341 USB=>RS232 1420'

dmm = tp4000zc.Dmm(port)

last_time = 0
period = 1.0

try:
  while True:
    val = dmm.read()
    t = time.time()
    if t > last_time + period:
      last_time = t
      value = val.numericVal
      print(value) 
  
except:
  dmm.close()

The multimeter is supplied with an RS232 interface, so I bought a cheap USB to RS232 adapter. You may need to install drivers for this, and then you have to work out what the device name is and modify the line of dmm.py that starts 'port =' to match the device name for your USB adapter.

Run the program, and readings will start to appear.

MacBook:tp4000_dmm si$ sudo python dmm.py 
Password:
-0.0
-0.0
-0.0
0.086
0.136
0.141
0.146
0.182
0.284
0.235
0.33

0.329

To draw charts and analyze the data, just select the readings from the terminal and then paste them into a spreadsheet.


Thursday, March 23, 2017

Raspberry Pi 2 vs 3 Current Consumption During Boot

I just wanted to share this fairly uninteresting result in case its useful to anyone.

I measured the current drawn from a 5V power supply on both a Raspberry Pi 2 (with Realtek WiFi dongle) and a Raspberry Pi 3 (with built in WiFi) to get an idea of the current consumption while these two boards booted up.

So, with no further ado, here are the results.


Rather as expected - much the same, both settling down to an 'idle current' of around 300mA, booting in under 30 seconds.

In answer to MrMobileWill, to take the readings, I used the following setup.



I sacrificed a micro USB lead, stripping the wires to get the black and red power wires. I then put my multimeter in current mode in series between my bench power supply (set to 5V) and the Raspberry Pi.

This multimeter has an RS232 serial interface that I connected to my Mac using a USB to serial interface (cheap off eBay).

The software setup is a little complicated. So See my next post for details on how I did this.