Sprache ändern

Recently visited

Featured Projects

Web Applications


Other Projects


A .csv to .png converter and visualiser for oscilloscope data

Jun 2015

Select .csv file to upload (1MB max. file size):

Use this height:

1 pixel per row of data (best lossless compression)
Use this width:

All channels share the same 0V line
Seperate the channels

A while back I was examining a data protocol between two circuits in my Lexmark printer; my goal was to make the printer print with cheaper ink from other companies (Brand toner cartridges cost you an arm and a leg).
My main problem was in saving the data I had captured: Making screenshots of the data on the oscilloscope was tedious, as I would have to make more than 10 screenshots of different portions of data and then stitch the shots back together in an image-editing program. It was hardly good enough. The only output possibility left (for the software I had) was to output the data in a "comma separated values" (.csv) format. But it was plain text, not a nice graph which could be easily read.
So I took it as a challenge to program a web-based data visualizer in PHP, which could convert the .csv file into a .png file.

An image created by my application

I found it important to add a small level of configurability into my app. You can define height and width of your image (or let the software determine that for you), as well as select whether you want the displayed channels to overlay or to be separated. With the data packets from my printer which were transferred over two wires, I selected the "separate" option so that I could better analyze each channel on its own.
The application has one limitation which is the size of the image. I say this even though it shouldn't be an issue - the maximum image area is 12.5 million pixels (an example: 10.000px X 1.250px large).

Structure of the input CSV file

If you are using a .csv file exported from a Rigol DS1052E, then you shouldn't care about the file structure, I used the same model. If not and you want to see if your .csv file is compatible, check the following points:

The first few lines of a compatible .csv file

Furthermore, the application supports up to 8 columns, which should be more than enough. If you're unsure if your .csv file is compatible, go ahead and try it out! Try out different option settings to see what fits best for your dataset.
The PHP code is open source and has its own Github repository .