Go Down

### Topic: AnalogVoltage Read to Digital out. (Read 2388 times)previous topic - next topic

#### GunGeek

##### Oct 11, 2014, 10:59 am
In this project I need to measure voltage from four different analog pins, then normalize that and output the voltage on digital pins. The voltage being read will be between 0 to 5 volts DC on each pin. By normalize I mean that if the voltage comes in at 2.47 then round up to the nearest tenth for output, 2.5.

Right now I am on the first half of the project and am getting a little bit frustrated. First this board is a SunFounder Board, I also have an official Arduino board that I may try this on but I have a project sitting on that one right now. Even with no voltage connected to the analog pins, it is reading voltage between 1.1 and 2 V DC. I mean nothing is connected to a bread board or anything and it is still reading. I am using basic analogRead() as an INT then passing to a float with a conversion to volts A2 * (5.0 / 1023).

I looked at the board, I dont physically see any issues off hand. Any help anyone can provide will be appreciated. If no voltage is connected to the pin I need it to read 0. Or is this not possible???

After I get the first half done I am going to start messing with the output and may have a question or two there.

#### wildbill

#1
##### Oct 11, 2014, 01:57 pm
If there's nothing attached to the pin you'll have a floating input with dubious readings as you observe. Google "pull down resistor".

#### GunGeek

#2
##### Oct 11, 2014, 04:50 pm
I figured it out after I posted and started plugging stuff in. So at least my assumption after plugging everything in was correct.

Now for the kick in the pants, I dont need to be measuring voltage, I need to measure a change in mA and voltage and pass that along through the digital in some way. I was completely wrong on what is occurring on this hack. Not sure I can change the current through the digital pins.

#### KenF

#3
##### Oct 24, 2014, 03:44 pm
I suspect you're not fully understanding what the remit of this project is all about.  Do you have the actual wording of what you are supposed to achieve?  Anything written on paper?

#### edmx

#4
##### Nov 06, 2014, 05:42 pm
Hi GunGeek,
although nothing is connected to an analog pin there can be signals as shown in this pdf-file on page eleven. Hence switch the analog pin to a well-defined voltage level e.g. GND. For currents you need a measuring resistor. For Arduino DUE the maximum of the voltage is 3.3V, for some other Arduinos 5V.
WBR: Edgar Marx

#### edmx

#5
##### Nov 06, 2014, 05:51 pm
Hi GunGeek,
although nothing is connected to an analog pin there can be signals as shown in this pdf-file on page eleven. Hence switch the analog pin to a well-defined voltage level e.g. GND. For currents you need a measuring resistor. For Arduino DUE the maximum of the voltage is 3.3V, for some other Arduinos 5V.
WBR: Edgar Marx

#### Mahmood

#6
##### Nov 08, 2014, 07:55 pm
Hello there,

To measure current you will need to pass it through a resistor then the arduino. This website will help you:

CT Sensor Interface

R1 and R2 is just for DC bias, ignore them if you don't have negative readings.

Go Up