Author Topic: Need help in interfacing a current sensor  (Read 4841 times)

0 Members and 1 Guest are viewing this topic.

Offline Udayan SinhaTopic starter

  • Regular Contributor
  • *
  • Posts: 71
Need help in interfacing a current sensor
« on: December 18, 2013, 05:32:56 pm »
I am trying to use a LEM HTB-100TP current sensor to measure DC currents (maximum expected current=210A). However I am unable to get a proper reading whenever I connect its output to an Arduino board (analog input).
Here are the pin connections which I used -
+V=12V
-V=Ground
0V=Ground
Output=ADC of Arduino board
I had no need of measuring an negative current and so did not use a split power supply. However I am not getting a proper output. Sometimes the digital value is 0, sometimes it is the full scale value & sometimes it just keeps fluctuating randomly. Right now I am only trying to measure small currents (1-2A) before moving on to larger values. The wire whose current is to be measured is being passed through the hole on the sensor body.
Please help me understand what I maybe doing wrong so I can rectify it. Thanks

Code i used -

int sensor_out=0, i;
void setup()
{
  Serial.begin(9600);
  pinMode(sensor_out, INPUT);             //sensor input at analog pin 0
}
void loop()
{
  i=analogRead(sensor_out);
  Serial.print("Output: ");
  Serial.println(i);
  delay(1000);
}
 

Offline Jon86

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: Need help in interfacing a current sensor
« Reply #1 on: December 18, 2013, 05:41:13 pm »
How have you got it connected to the arduino?
Death, taxes and diode losses.
 

Offline qno

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: nl
Re: Need help in interfacing a current sensor
« Reply #2 on: December 18, 2013, 06:04:54 pm »
Have you read the datasheet??

As far as i can remember the output is at 0 (zero) current half way up the power supply voltage.
So with a 12 volt power supply 0 current the output is 6 V.

Did you check with a voltmeter the output?
Why spend money I don't have on things I don't need to impress people I don't like?
 

Offline Udayan SinhaTopic starter

  • Regular Contributor
  • *
  • Posts: 71
Re: Need help in interfacing a current sensor
« Reply #3 on: December 19, 2013, 02:49:18 am »
How have you got it connected to the arduino?

I have mentioned it above. I have directly connected the output pin of the sensor to the analog input pin of the Arduino. There are no resistors, OPAMPs or anything. Should I connect something in between?
« Last Edit: December 19, 2013, 02:51:49 am by Udayan Sinha »
 

Offline Udayan SinhaTopic starter

  • Regular Contributor
  • *
  • Posts: 71
Re: Need help in interfacing a current sensor
« Reply #4 on: December 19, 2013, 02:50:58 am »
Have you read the datasheet??

As far as i can remember the output is at 0 (zero) current half way up the power supply voltage.
So with a 12 volt power supply 0 current the output is 6 V.

Did you check with a voltmeter the output?

Is it specified in the datasheet (I found their documentation is really poor)? If so, then where is it written? And yes I did check with a multimeter.
 

Offline electronupdate

  • Regular Contributor
  • *
  • Posts: 70
  • Country: ca
Re: Need help in interfacing a current sensor
« Reply #5 on: December 19, 2013, 03:27:38 am »
the data sheet indicates it needs +/-12V to +/-15V.

Even if you don't plan on negative currents in order for the circuit to work internally it may need 24V  to 30V.

Try  putting the part onto a bench power supply with the voltages in range of what the data sheet requires and measure the output.

You may find the voltage output also goes far beyond what an Arduino raw ADC input can handle.  It's not unusual to have to do a bit of signal conditioning with an op-amp to scale the voltage (and potentially a bit of capacitance to smooth out noise, if present).

You are correct, the data sheet is not very good.  In situations like this a bit of reverse engineering is needed.... you can often also contact the company and ask to speak to their 'application engineering.
 

Offline Udayan SinhaTopic starter

  • Regular Contributor
  • *
  • Posts: 71
Re: Need help in interfacing a current sensor
« Reply #6 on: December 19, 2013, 04:37:57 am »
the data sheet indicates it needs +/-12V to +/-15V.

Even if you don't plan on negative currents in order for the circuit to work internally it may need 24V  to 30V.

Try  putting the part onto a bench power supply with the voltages in range of what the data sheet requires and measure the output.

You may find the voltage output also goes far beyond what an Arduino raw ADC input can handle.  It's not unusual to have to do a bit of signal conditioning with an op-amp to scale the voltage (and potentially a bit of capacitance to smooth out noise, if present).

Thanks. I will try with a split power supply & then also add some signal conditioning if it still doesn't work. The voltage output should not be a problem though for the Arduino ADC as it will go from 0-4V only don't you think?


You are correct, the data sheet is not very good.  In situations like this a bit of reverse engineering is needed.... you can often also contact the company and ask to speak to their 'application engineering.

Yes I have already mailed the company asking for some sample schematics of application circuits. Yet to receive a reply.  :(
 

Offline Udayan SinhaTopic starter

  • Regular Contributor
  • *
  • Posts: 71
Re: Need help in interfacing a current sensor
« Reply #7 on: December 27, 2013, 04:08:03 am »
Tried with a split power supply. Didn't work.  |O
Fortunately the company has replied.  :-+
Lets see if they can help.
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: Need help in interfacing a current sensor
« Reply #8 on: December 27, 2013, 05:25:15 am »
To get started, connect the V+, V- and ground pins to a regulated bipolar +/-12V supply. You don't need much current, it's only rated to draw 15A.

Now put an oscilloscope on the output pin, relative to ground, measure what waveform you're getting out. Now run a mains line through the Hall effect sensor, turn it on with a good load current, and measure what comes out of the sensor. Once you know what the actual output looks like you can design appropriate signal processing going into the Arduino.

Remember you need only one of the mains conductors passing through the sensor, if you have, say, a cable with active and neutral together then the net current through the sensor is zero and you won't read anything.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6316
  • Country: 00
Re: Need help in interfacing a current sensor
« Reply #9 on: December 27, 2013, 05:41:19 pm »
Thanks. I will try with a split power supply & then also add some signal conditioning if it still doesn't work. The voltage output should not be a problem though for the Arduino ADC as it will go from 0-4V only don't you think?

As electronupdate said you are running out of spec. The datasheet says that the sensor needs at least 24v between V+ and V-.  Your best bet is to stay within spec.
 

Offline Udayan SinhaTopic starter

  • Regular Contributor
  • *
  • Posts: 71
Re: Need help in interfacing a current sensor
« Reply #10 on: December 28, 2013, 04:05:54 am »
Remember you need only one of the mains conductors passing through the sensor, if you have, say, a cable with active and neutral together then the net current through the sensor is zero and you won't read anything.

Yes I know that. I have only one line passing through it. Also tried with a split supply. The readings are also not the type you had get if you are picking up random noise. Its fluctuating right from zero to the maximum output value. I think I may have found the problem though. They have said that the TP version has a primary bar option (I didn't notice this before). So I guess we don't actually have to pass a wire through it. We have to solder it onto the primary bar given.
Sadly I will have to wait for a few days to test this as the lab is closed due to Christmas vacations.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf