Log two Multimeters with single serial port

Update – new version :
Logger for Android @ http://ficara.altervista.org/?p=3208

As promised in my previous post, here is the program to log the data coming from two multimeters. I opened the Rs232 box of one multimeter (we are talking about the DT4000-ZC model) and discovered that there is no GND reference ! Look at the picture :

rs232-ifAt left side, you can see the “circuit” that’s in the rs232 connector box ; at right, what I suppose it’s inside the multimeter. The GND reference isn’t needed ‘cause the pin 2 of DB9 connector is normally polarized at -5V, that is the voltage level coming from the pin 3 (Txd) via 10K resistor. When the DTR signal (pin 4) goes high, the PNP transistor acts like a switch, commutating the pin 2 level from -5V to +5V depending on serial signal captured by the PNP phototransistor. In this case, the GND reference is inside the PC serial port and therefore there is no need to insulate the two multimeters one respect to the other.

But… I just want to use a single rs232 port on my PC to log both the multimeters, as channel #1 and #2. Ok, if the circuit inside the multimeter is like I supposed it to be, I can simply make an ‘OR’ of the outputs, powering via RTS one channel, and via DTR the other, once at a time. The schematic for this mixer is here:

That's not CAD, but MAD (Manually Aided Design)

That’s not CAD, but MAD (Manually Aided Design)

In the next picture you can see the prototype I built to test the program.

mixer-detailsNow, all is ready to test. I used a USB battery charger (very simple circuit, look on my previous articles for details) and two multimeters to measure the battery voltage and the charging current.

IMG_20130818_180318 Ok, the multimeters are running. Now I can launch my new application, having set the com port as in the previous program. Starting the log, I can see on the screen the samples, alternatively taken from the multimeter #1 and the #2. At the start of each line, I added a time stamp, for successive data elaboration, may be in graphical form.

dos2x2The application has been written in FreeBasic (look at the right column of this page for the link to the free, open source compiler) and doesn’t need for installation. Please, look at the previous post for more details on starting from batch. The new program acts exactly as the previous, only has enhanced data stream verification and, obviously, double channel capabilities 🙂

Note: this article was cited on “Hack-a-day” on Aug 26 2013.

Disclaimer: this application is provided with no explicit or implicit warranties of operation. I do not assume any responsibility for problems that may arise on the device where the application is installed. The program is a “demonstration” and no support of any kind is provided. By downloading and installing the program, you implicitly accept my terms of not taking responsibility. If you do not agree, do not download and / or install the file !

I have read and understood the note, accept the terms and want to download the file DT4000x2.zip (42.204 bytes)

Note: the zip file has a password. Check the hash of the zipped file, then extract it and you will have your executable ready to run. If you don’t have a tool for computing the hash, I suggest HashTab, free for personal use.
Note: DO NOT extract or use the downloaded file if MD5 doesn’t match with the following code : MD5 = 0EEA13D48A3E915B2C4E53CC54663679
The password is: eficara

Logger for DT-4000ZC digital multimeter

Update 31 Dec 2016:
Look at the end of this article for new version of EXE
Log 2 multimeters with one serial port @ http://ficara.altervista.org/?p=1602
Logger for Android @ http://ficara.altervista.org/?p=3208

I recently purchased a digital multimeter with RS232 serial output. If interested to, search ebay for “IN06158” and you will find the item from UK seller al reasonable low price.

The device measures actual temperature. Uh, it's hot :)

The device measures actual temperature.
Uh, it’s hot 🙂

The reason for this was that I’m going to design my own LiFePO4 battery charger and want to create a test diagram for Voltage and Current while battery is charging. The Multimeter is shipped with software that has graphical style and logging capabilities, but I always choose to write my own application ‘cause it will be certainly “tailored” for my needs.

So, a quick search on Google pointed me to the serial protocol, that’s very simple (read about the protocol at this link). All the infos are sent via 14 bytes frames, with the digits and icons bitmapped on various bytes. I used the FreeBasic compiler to create an executable that shows on screen (in console mode) the decoded frames and also saves the data on a text file. The executable (actually tested under Win7, but I’m pretty sure that will work on XP) doesn’t need for installation, it can be run directly clicking on the .exe icon. The first step is to supply the com port that must be used for communication, as you can see in the picture below.

Type in the com port you want to use

Type in the com port you want to use

After the com port is open, the program stands for an UP-arrow to start communicating with the Multimeter ; a DOWN-arrow will pause the communication, while the ESC key will terminate the program (saving the log file). Every row shown on the screen is also saved on disk. The digits are enclosed in brackets [ ] just for “cosmetic” reasons. You can see an example of records in next picture.

A frame error message is shown if first byte is wrong

A frame error message is shown if first byte is wrong

The protocol isn’t very “sure”, ‘cause there is no check on the full string or on single bytes, but you can filter it easy if some “strange” value appears on decoded segments or if the sequence of high nibbles (they start with 0x1n and end with 0xEn) is non-continuous. The serial cable is short (about 1 m), so errors would be rare.

The executable (zipped) can be downloaded from the link supplied at end of this page, after the disclaimer. Please, note that the zip file also contains a batch file .bat that can be modified to start the program without the need for typing the com port. In fact, if you modify the .bat file, substituting the com port value (on my PC is com22), you can simply start the executable, using the selected port, just clicking on .bat file icon.

I’m also planning to create a new version of this file for logging two multimeters simultaneously,  ‘cause I need for Voltage and Current sampled at same time. Obviously I would use two multimeters with different com ports and probably I would apply some interface for isolating the serial ports of the Amp and Volt meters. Ok, stay tuned for improvements 🙂

Disclaimer: this application is provided with no explicit or implicit warranties of operation. I do not assume any responsibility for problems that may arise on the device where the application is installed. The program is a “demonstration” and no support of any kind is provided. By downloading and installing the program, you implicitly accept my terms of not taking responsibility. If you do not agree, do not download and / or install the file !

I have read and understood the note, accept the terms and want to download the file DT4000.zip – updated 2016/12/31

Note: the zip file has a password. Check the hash of the zipped file, then extract it and you will have your executable ready to run. If you don’t have a tool for computing the hash, I suggest HashTab, free for personal use.
Note: DO NOT extract or use the downloaded file if MD5 doesn’t match with the following code : MD5 = BC558E8F4A118548BAB949535087FEC0
The password is: eficara

2016/12/31: I modified the executable after a request from a reader. Now you can add in the command line a flag to autostart the log and on every line of the log you can read the timestamp of the sample in the format hh:mm:ss.

The screenshot of the new version of the program

The screenshot of the new version of the program

The program running with autostart flag set in the command batch file

The program running with autostart flag set in the command batch file

The downloadable zip file also contains an example of batch file to automatically start the logging on port Com3.

Note that some USB -> RS232 interfaces can’t control the DTR / RTS lines (due to missing commands in the drivers), so… such interfaces cannot work. I tried with an original Prolific PL2303 interface and it works. There are some non-original PL2303 chips that can have problems. The control of DTR / RTS lines is MANDATORY for this program to work.

Well, that’s all (for now)…

Convert Casio QV100 cam files to jpg

I found on my PC a very old folder, probably coming from a backup, with a series of .cam files. Such files were created by a Casio application that extracts the pictures (via serial cable) from my old, but still working, QV100 camera.
Now, the problem is that I can’t view / open such files on my Win7 computer ; searching on the Internet, I found that Irfan View can handle this format and can do a batch conversion, but I haven’t such application on my PC and just need it for one shot, so I don’t like to install it. Another “simple” way seems to be perfect for me. In a forum’s thread, someone tells that you can simply rename .cam to .jpg in order to make it readable in the new format. That solutions wasn’t working for me (wrong file format error). Reading a .cam file with an Hex Editor (FrHed), I discovered that it really has JFIF signature inside, but there is a supplemental header (54 bytes) probably imposed by Casio. Removing such header and renaming the filename from .cam to .jpg, has made it readable, finally 🙂 Then, I decided to write my own application, using the FreeBasic compiler, to do this operation automatically.

Screenshot of the application

Screenshot of the application tested under Win7  (click to enlarge)

The program is a pure executable : it doesn’t need for installation. Just get the .zip, extract the .exe and put this in the folder containing the .cam files you want to convert. Run the program, press ‘c’ and the conversion starts. At the end, you will find the old, untouched, files .cam and the new converted .jpg … Hope it will be useful for you 🙂

Disclaimer: this application is provided with no explicit or implicit warranties of operation. I do not assume any responsibility for problems that may arise on the device where the application is installed. The program is a “demonstration” and no support of any kind is provided. By downloading and installing the program, you implicitly accept my terms of not taking responsibility. If you do not agree, do not download and / or install the file !

I have read and understood the note, accept the terms and want to download the file EFcam2jpg.zip (15.816 bytes)

Note: the zip file has a password. Check the hash of the zipped file, then extract it and you will have your executable ready to run. If you don’t have a tool for computing the hash, I suggest HashTab, free for personal use.
Note: DO NOT extract or use the downloaded file if MD5 doesn’t match with the following code : MD5: 29A64B8301D0A6392435FED19286EF99

The password is: eficara

Smartphone WM6 – GPS tracker

GPS Tracker: crea un file .kml con le coordinate ricevute da un GPS

Questo programmino serve a visualizzare le coordinate GPS del punto dove ci si trova e per creare un file .kml (google maps) con la traccia del percorso. Il file minigps.kml generato nella directory My Documents, può essere visualizzato con google maps sullo smartphone o sul PC una volta trasferito su di questo. Nota importante: assicuratevi di avere una connessione internet “flat” sul cellulare se volete usare Google Maps o Google Earth ! Altrimenti, il vostro credito telefonico ne soffrirà parecchio…
Per ricevere le coordinate GPS si può utilizzare un ricevitore esterno Bluetooth o uno interno, se disponibile (sul mio Samsung i600 non c’è). Attenzione: la funzione “Stop Log / Save” salva i dati sempre sullo stesso file (minigps.kml), quindi se vi interessa conservare un tracciato, copiate il file salvato su uno nuovo, con un altro nome.
Il file .cab contenuto nel file .zip disponibile per il download è autoinstallante. Una volta estratto e trasferito sullo smartphone WM6, basta cliccarlo per avviare l’installazione ; vi verrà richiesta l’autorizzazione a procedere perché l’autore è sconosciuto a Micro$oft, ma l’autore sono io 🙂 Una volta eseguita l’installazione, troverete una nuova icona nell’elenco programmi, con il nome MiniGps. Se le impostazioni della porta seriale non corrispondono a quelle del vostro sistema, editate con blocco note il file minigps.ini

Compatibilità: Smartphone WM6 (Windows Mobile 6)

screenshot applicazione


screenshot dell’applicazione ; la scrissi in Francia, come si evince dalle coordinate che appaiono in figura…

Nota per il download : non viene fornita nessuna garanzia implicita o esplicita di funzionamento del programma. Non mi assumo nessuna responsabilità per eventuali problemi si dovessero presentare sul dispositivo dove l’applicazione verrà installata. Il programma è un “dimostrativo” e non viene fornita assistenza, né supporto di alcun genere. Scaricando ed installando il programma, accettate implicitamente le mie condizioni di non assunzione di responsabilità. Se non siete d’accordo, non scaricate il file e non installatelo !

Ho letto e compreso la nota, voglio scaricare il file minigps.zip (475 KB)
(ultimo aggiornamento: V1.03 25/08/09) il file .zip contiene il .cab per l’installazione diretta

Riconoscimento accordi

Tempo fa scrissi un programmino per testare il Visual Basic 2005 Express (gratuito, sembra incredibile, conoscendo il soggetto) di Microsoft ; ora ve lo propongo.
L’applicazione permette di riconoscere la nota fondamentale e il tipo di accordo per una qualsiasi digitazione sulla tastiera di una chitarra. Con i checkbox, a destra, si determinano quante e quali note debbano suonare, mentre i radiobutton sulle “corde” servono per indicare dove le dita faranno pressione.
Per usare una corda libera (non premuta su nessun tasto) utilizzate il primo radiobutton a sinistra ; il tipo di accordo e la nota fondamentale possono sembrare, in qualche caso, errati (per esempio Am7 verrà indicato come C6), ma le note di entrambi gli accordi sono esattamente uguali ; si tratta solo di un diverso “punto di vista”… Per una maggiore precisione si dovrebbe conoscere l’accordo precedente, in modo da estrapolare un collegamento armonico, ma questo programma non ha uno “stato precedente”, quindi tenetevelo così com’è 🙂
I tipi di accordi riconosciuti sono 13, tra questi maggiori, minori, seste, settime, aumentate, diminuite eccetera. Se il tipo di accordo risulta “boh!”, cioè non riconosciuto, provate ad eliminare qualcuna delle note attive mediante i checkbox a destra.
Il programma, quando si clicca il pulsante “play”, suona l’accordo con lo strumento MIDI n.25, che è la chitarra. Ovviamente è necessario che sul PC sia installata una scheda audio in grado di riprodurre files MIDI… e che il volume non sia azzerato 🙂  Il file di installazione può essere prelevato da questo link.
Nota importante : sul PC deve essere installato il framework .NET ; se non avete un computer a legna e carbone, probabilmente è già presente 😉
Nell’immagine in basso è visibile uno “screenshot” del programma in funzione…

chordrec