Test InstrumentationEnter Your Electronics & Design Project for a chance to win a Grand Prize for Originality, a Tool Set, and a \$100 Shopping Cart!Back to The Project14 homepage Project14 Home Monthly Themes Monthly Theme Poll

As it turned out, programming the graphical display for the TinyDVM was easier than I thought and I was able to get a working version in only a couple of hours, as can be seen below.

The OLED display is both graphical and text at the same time, as the text is treated as graphics when it is transferred to the display. I  put a smaller text version of the instantaneous voltage in the bottom right hand corner, something which I had seen in another project somewhere (Sorry, I cannot remember where, but I thought it was a good idea so I borrowed it.) and scrolled the voltage from left to right. I made the plotted point a square of four pixels as I couldn't really see it when it was only a single pixel. The analogue voltage was converted to a value between 0 and 47 which is the Y dimension of the display, with the X direction being used as time. The delay between measurements was reduced to 100 ms to obtain a reasonable refresh rate. A single dimension array was used to hold the previous position of the dot so that it could be erased by writing the black colour to the display, and then the new point could be drawn in. The display coordinates are (0,0) for the top left hand corner, with positive integers increasing along the X axis, but Y values increase down the display. This si fairly standard for displays. The programme to do all this is listed below:

while (1)
{
oled.setCursor(34, 34); // points cursor to x=0 y=0
TinyV = (3.30 * value)/1023;
oled.print(TinyV,2);  // Print a float
oled.print("V");
colour = 0;

// Erase the previous pixel
oled.pixel(x,yarray[x],colour,0);
oled.pixel(x+1,yarray[x],colour,0);
oled.pixel(x,yarray[x]+1,colour,0);
oled.pixel(x+1,yarray[x]+1,colour,0);
y = 47 - ((47 * value)/1023);
oled.display(); // Remove the previous pixel

yarray[x] = y;
colour = 1;
oled.pixel(x,yarray[x],colour,0);
oled.pixel(x+1,yarray[x],colour,0);
oled.pixel(x,yarray[x]+1,colour,0);
oled.pixel(x+1,yarray[x]+1,colour,0);
oled.display(); // Draw the new pixel
delay(100);
x = x+1;
if (x>63)
x = 0;
} /* while */

I think it works quite well. It could easily be improved and extended to change the delay between measurements, or change the size of the dot, or maybe just have a one-shot scan rather than continuously overwriting. However, this would then require some form of user interface which the TinyDVM currently does not have.

While I was doing all this reprogramming I also worked out how to print 3D letters on my 3D printer so I printed out TinyDVM and stuck them on the front. I didn't quite get the spacing correct and it is not quite aligned with the edge of the case, but it I think it looks OK. It was a good first attempt. Next time I might try some form of base plate rather than sticking the letters on individually.

There are a few days left until the end of this challenge, so I will have a go at getting the WiFi link to work.