Built a Voltmeter

I was a little bored so I pulled out the Arduino. I started to think on what to build and got a fun idea of a simple Voltmeter. I did a quick search and it’s easy to make one if you have the right parts. I didn’t have a typical LCD to use so I tried using the TVout library. After a couple of hours since I’m not too keen with programing a Arduino I finally got it working.

All you need is a AV cable, two 1/4 watt resistors 470ohm and a 1kohm, two quarter watt resistors 10kohm and 100kohm. Don’t forget a old analog TV and alligator clips.

Follow the TVout wiring scheme that is posted on the google code page. I used the TVoutBeta1 release.

Build a voltage divider with the quarter watt resistors. The 100K is positive and the 10K is negative for the test leads.  Connect the voltage divider to A0 on the Arduino. Also connect a ground lead from the Arduino’s GND to the test lead negative side.

Load the code and upload it to the Arduino.

#include <TVout.h>
#include <fontALL.h>

TVout TV;

int analogInput = 0;
float vout = 0.0;
float vin = 0.0;
float R1 = 100000.0;
float R2 = 10000.0;
int value = 0;

void setup() {
TV.begin(NTSC,120,96);

pinMode(analogInput, INPUT);

}

void loop() {
TV.select_font(font6x8);
TV.print(0, 0, “TCPMeta’s Voltmeter”);
TV.print(“___________________”);
TV.select_font(font8x8ext);
TV.print(10, 30, ” VOLTS=”);
TV.print(vin);
TV.delay_frame(60);

value = analogRead(analogInput);
vout = (value * 5.0) / 1024.0;
vin = vout / (R2/(R1+R2));
if (vin<0.09) {
vin/=100;
vin=0.0;
//delay(10);
}
}

Now whatever you do, DO NOT go over 30volts and this only works for DC voltage.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s