﻿ Arduino Voltmeter
Arduino Voltmeter

To measure the voltage, you need an ADC. Which is called Analog to Digital converter. In arduino, for instance uno has 10 bit ADC, that means you can measure whatever you want as a 10 bit resolution that also means your scale is between 0 to pow(2,10). If you have a better resolution than you get better result as you expect. But here is the one thing that you can just measure the 0-5 volt with only arduino, because if you give much voltage to the analog input then you burn up the board basicly, so we have two problems. One of them is the ability to meausre voltage which is higher then 5 volt, another one is resolution.

The key word is, to measure the voltage higher then 5 Volt, Voltage Divider rule. Using the rule, it is possible to measure the voltage whatever you want theoretically. You can google it the word then you get exactly what you want. But let me explain. You have two resistor. One of them has much resistance then the other. You connect them in serial. So give the voltage difference to this circuit. Then you need to take the voltage information on the resistance which is lower then the other. For example you have 68k resistor and 1 k resitor. Connect them serially and take the voltage difference on the 1 k resistor. So basically, you can measure voltage scale up to 400 volts !! I think that is great !!. That means we solve the scale problem. So the other problem, that we have to solve, is the resolution. You can ask why is it so important ? Than I can simply answer, If you want to measure the voltage like 56,332124 Volt than resolution will be needed. To get over this problem high resolution adc is needed. I use for example LTC 2400 which has 24 bit resolution. It is from Linear Technology. The situation is, I used the LTC 2400 not ADC of arduino.I just use arduino to take the value and sent it to somewhere.

In the project LTC 2400 module is the heart of the system. You can find the code on the internet which work with arduino. But first time when I used the code I realize that there is no returnable value. I mean you can see the voltage information on the screen but you can not use it in the any mathematical equation. That makes me crazy !! So I modified the code than I wrote it to give me returnable voltage value. I give the code you can check it or use it.

Also I need to say LTC 2400 communicate with arduino using SPI protocol. The code includes spi protocol that I do not explain here it. Here you can find the information about spi and arduino.

I give you a hint. When you use the voltage divider rule, some points you can not measure perfectly. I mean some points you can good measure but some point you do not. To solve that you can divide the voltage scale you want to meausure. For example below the 1 volt you can use different resistor values, above the 1 volt you can use different resistor values this increase the resolution of the data you get. For instance in my project When red light is on below the 4 volt I can measure when the other two leds are on above the 4 volt that I can measure. As I said before when you use voltage divider you can measure some points perfectly but some points are not desirable.To get over this problem, you should calibrate the circuit. There are bloody thousands way to do that. For example you can change the reference voltage of the LTC 2400 but I do not recomend it.Therefore I used a way which is all about software that makes me no handling much with electronical components. Using MATLAB !!! Actually using interpolation MATLAB helps to do it. Let me explain how it is possible. First you need to power supply which is really sensitive and you need MATLAB. You start a point for example 1 volt give to the circuit and note that what you read on the lower value resistance. Then also note real value you have to read which is 1 volt. Then take some data. Using matlab find all values which are needed to multiply our value on the lower resistor to get the real voltage value. Basicly divide real voltage value by the value on the lower resistor lets call it Vout. The result lets call it multiplier. Now graph the Vout vs Multiplier. Here you can find the link about basic fitting. Now on left side of the figure edit>figure properties then tools>basic fitting. From the opened screen click Center and scale x data and choose quadratic one. When click it you see some exponential line on the your graph also it gives the equaition. copy equaiton and paste it in you code. When code is working read Vout but do not show it, depends on Vout Mutliplier will be change so using equaiton find Multiplier and multiply it with Vout.Than the information is really equal to the incoming real voltage. You do not have to worry about equation MATLAB will do what you need absolutely.

Explanation is finished. If you have any question click the green arrow (probably you click before) and also click contact which is blue image. Now ask me whatever you want about the project. This project is developed to measure the voltage on the ion pomps for Turkish Accelerator Center at Ankara. Thanks to Burak Koç to help me about electronics , thanks to Mustafa Yıldız to help me about design to box. Also I want to say thanks to Emre Kazancı who trigs me to learn EPICS. I do not say anything about EPICS here so do not worry about it. I use it during the developing voltmeter.