Getting same value of dc when using acs712

i want to measure dc current between the battery and electronic speed controller. But when i start getting readings from the current sensor it gives the same value.using acs712 current sensor. It gives the default value of 512 even if load is connected.

how to fix this. What i am doing wrong.

I don't know anything about that part, but the datasheet says:

66 to 185 mV/A output sensitivity

If the current is small, the output voltage (or voltage change) may be too small to measure. A few of the typical applications shown on the datasheet show an op-amp following the sensor's output.

You have not given any details of the sensor being used. If it is ACS712, the zero current reading should be 512 as an analogue reading.

Weedpharma

weedpharma: You have not given any details of the sensor being used. If it is ACS712, the zero current reading should be 512 as an analogue reading.

Weedpharma

I am using ACS712. But with load it gives the same 512.

Hi,

Can you please post a copy of your sketch, using code tags? Please use code tags.. See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Tom.... :)

this is the code.
#include"Servo.h"
#define MAX_SIGNAL 1500
#define MIN_SIGNAL 900
#define MOTOR_PIN 5
Servo m1;
float b;
float i;
void setup()
{
Serial.begin(9600);
m1.attach(MOTOR_PIN);
m1.write(MAX_SIGNAL);
delay (5000);
m1.write(MIN_SIGNAL);
delay (5000);
i=MIN_SIGNAL;

}

void loop()
{
i=i+10;
m1.writeMicroseconds(i);
b=analogRead(8);
Serial.println(b);
delay(1000);
}

block_diagram.pdf (92.1 KB)

TomGeorge: Hi,

Can you please post a copy of your sketch, using code tags? Please use code tags.. See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Tom.... :)

this is the code.
#include"Servo.h"
#define MAX_SIGNAL 1500
#define MIN_SIGNAL 900
#define MOTOR_PIN 5
Servo m1;
float b;
float i;
void setup()
{
 Serial.begin(9600);
 m1.attach(MOTOR_PIN);
 m1.write(MAX_SIGNAL);
 delay (5000);
 m1.write(MIN_SIGNAL);
  delay (5000);
i=MIN_SIGNAL;

}

void loop()
{
 i=i+10;
 m1.writeMicroseconds(i);
b=analogRead(8);
Serial.println(b);
delay(1000);
}

We need a circuit diagram as previously requested. We need to know how you have wired the device. Either draw the circuit and take a photo of the drawing, or take a picture of the project that CLEARLY shows how it is connected.

Weedpharma

I hope I understand this right. A straight wire runs through the sensor, and a hall sensor picks up it's magnetic field. The sensor outputs exactly [u]half[/u] of it's own [u]supply voltage[/u] when no current flows through the sensor. Sensitivity is how much the output voltage deviates from 50% supply. The sensor can pick up DC (both directions) as well as AC. It makes sense that you supply it from Arduino's 5volt line, so any Vref variation still reads 512. Since ~5mV is one digital step, 1A should deviate ~13 digital steps per Amp (if 66mV/A). Leo..

edit. How do you meaure a PWM speed controller. Current draw is not constant. If you take a sample at the wrong moment, you could be measuring nothing. ?

What is the current rating of your sensor?

Weedpharma