Programmable Logic

Enter Your Electronics & Design Project for a chance to win up to a $200 Shopping Cart of Product!

Back to The Project14 homepage

Project14 Home
Monthly Themes
Monthly Theme Poll

 

Here's a simple DVM made from an Arduino VIDOR 4000.

A potentiometer is placed in between VCC and GND with the wiper connected to analog input A3.

The value of the analog input is read and then shown through the HDMI to a monitor screen.

The arduino example code for showing the Arduino logo was modified for this project.

Here is the code listing:

//MKR VIDOR 4000 Simple DVM
//R. Scott Coppersmith
//Last Edit 16July2019


#include "VidorGraphics.h"
#include "Vidor_GFX.h"


Vidor_GFX  vdgfx;
int analogPin = A3; // potentiometer wiper (middle terminal) connected to analog pin 3
                    // outside leads to ground and +5V
int val = 0;  // variable to store the value read
void setup() {
  // Initialize the FPGA
  if (!FPGA.begin()) {
    Serial.println("Initialization failed!");
    while (1) {}
  }


  delay(4000);
  // Fill the screen with a white background
  vdgfx.fillRect(0,0,640,480,vdgfx.White());


}


void loop()
{
  
  while (1) {
    delay(200);
    val = analogRead(analogPin);  // read the input pin
    vdgfx.fillRect(50,50,250,180,vdgfx.Yellow());
    vdgfx.text.setCursor(50,150);
    vdgfx.text.setAlpha(255);
    vdgfx.text.setSize(4);
    vdgfx.text.setColor(vdgfx.Blue());
    vdgfx.println(val);
  }
}

 

 

Video of operation:

https://www.element14.com/community/videos/29879

 

 

To convert counts (14-1023) to voltage (0.0 vdc to 3.3 vdc) change val from int to double and add this line of code after reading the analog input:

 

val = (val-14)*3.3/(1023-14); //convert to voltage 0-3.3vdc