element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Test Instrumentation
  • Challenges & Projects
  • Project14
  • Test Instrumentation
  • More
  • Cancel
Test Instrumentation
Blog TinyDVM#4 : Graphical Display
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test Instrumentation to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dubbie
  • Date Created: 5 Nov 2018 5:48 PM Date Created
  • Views 1956 views
  • Likes 7 likes
  • Comments 6 comments
  • p14 mkr 1010
  • tinydvm
  • diytestinstruch
Related
Recommended

TinyDVM#4 : Graphical Display

dubbie
dubbie
5 Nov 2018
image

Test Instrumentation

Enter 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 image

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.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

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
    value = analogRead(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.

  • Sign in to reply

Top Comments

  • DAB
    DAB over 6 years ago +2
    Nice post, but the screen is too small for these old eyes. DAB
  • 14rhb
    14rhb over 6 years ago +1
    Great work Dubbie. For some reason I seem to have missed the rest of your build blogs so will be searching for them now and having a back-read. Rod
  • genebren
    genebren over 6 years ago +1
    Smallest oscilloscope ever! Gene
Parents
  • 14rhb
    14rhb over 6 years ago

    Great work Dubbie. For some reason I seem to have missed the rest of your build blogs so will be searching for them now and having a back-read.

     

    Rod

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • 14rhb
    14rhb over 6 years ago

    Great work Dubbie. For some reason I seem to have missed the rest of your build blogs so will be searching for them now and having a back-read.

     

    Rod

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • dubbie
    dubbie over 6 years ago in reply to 14rhb

    Rod,

     

    Thanks for the support. I hope that you can find the other parts of TinyDVM. I have trouble working out where to blog and what tags to use, even though I have done this several times now. The knowledge of what and where doesn't seem to stick in my memory for some reason. Too old I expect.

     

    Dubbie

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube