Hello community,
I've installed a Dagu 4 channel motor driver and all coming fine.
What I figure out now is to use the current pin sensor present for every board, I use the function AnalogRead based on some documention and/or based on the fact that this pin is connected on Analog pin of my Arduino board.
What I not really understand, is the value read on the pin and here your help is appreciate.
Someone knows if the value is related a Voltage (Volt)?
What range min and max could be retreived? From 0V to 1024V?
Is it right to correlate the 0Volt&0Ampere-1024Volt&4Ampere?
Which the formula that must be used for calculate the Ampere?
The picture of the board shoes 4pcs 1 Ohm resistors (1 or 1/2 W) I guess the analog voltage out just reflects the voltage drop over the resistor. since 1 Ohm: The analogread reflects both current and voltage (same value).
as 5V (5A) will read 1023 it should be just divide value by (1023/5=205).
What may interfere, is that the value may not be steady - as u use PWM for the speed control
If u're lucky, there is some kind of filter to deal with this problem.
....
hmmmm. found this: http://www.robotshop.com/media/files/pdf/schematic-rs011mc.pdf
It shows filtering and 22 times amplification.
I must have seen colors incorrect. Resistors are 0.1 Ohm.
current close to analogRead(ax)/92
I did a simple simulation with the circuit from the datasheet.
PWM : fully on (100%)
Found that 2A motor current returns 4.32V at output. (analog value 884)
This may be "far from correct", I don't trust the simulation fully.
Datasheet also talks about this voltage. Read it.
The ADC has 1024 input values spread across the voltage range, not 1023 (minor point),
and integer division truncates (1024/5 = 204, 1024.0/5.0 = 204.8, which is 0.4% different).
The cast to int for limit also truncates, but that is actually correct since the first input bucket
(0.0V to 0.005V) all maps to a 0 ADC reading.
converting an ADC value to a voltage in an unbiased manner is done thus:
float V = (analogRead () + 0.5) * 5.0 / 1024.0 ;
Then any reading from the first bin yields the mid-point voltage of that bin
Usually these details are spurious accuracy, but are worth rememebering if using a lower
resolution ADC where the LSB is more important.
Imagine a 2 bit ADC:
0 means 0.0 - 1.25V
1 means 1.25 - 2.5V
2 means 2.5 - 3.75V
3 means 3.75 - 5.0V
so reading a 2 could mean anything from 2.5 to 3.75, whose mean is 3.125V ( = 2.5 * 5.0 / 4.0)
[/code]
[/code]
Current output:
Each channel has a current sensing circuit. The output of this circuit is approximately
1V for each amp the motor draws (5V maximum). This output can be connected
directly to the analog input of any 5V micro controller.
You are mixing few things.
But ADC (analog to digital) will give you 1024 values (depends on Reference selector on board)
You can also see some motor example here: