Reading problem of ACS712 hall effect sensor with PIC16F877A

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Reading problem of ACS712 hall effect sensor with PIC16F877A

Postby navidbox » Thu Jun 16, 2011 11:15 pm

Dear Friends,

Project Description: Data Acquisition System for Solar Panel

In fact, i need to measure the current from solar panel and display it on the LCD.

I am using PIC16F877A with C language to do so. For the Temperature, Light, and Voltage, there is no issue of reading the sensors and it is working perfectly. However, ACS712 hall effect sensor is mentioned to be a good solution for DC current measurement in the datasheet as well as having a linearity characteristic, but the time i am using it with PIC, it does not give me a true value within at least 0-50 A input ranges.
This is the Proteus + ADC codes, Please help me to accomplish this task as well.


ADCON0=CHANNEL3;

lcd_goto(44);
read_adc();
current=read_temp();
current=0.074*current;
current=(current-37.888);
current=current/2;

dis_num(current);
send_char('.');
dis_num(current%10);

send_char(' ');
send_char('A');
send_char(' ');
Attachments
proteus.jpg
navidbox
Newbie
 
Posts: 8
Joined: Thu Jun 16, 2011 2:20 am

Re: Reading problem of ACS712 hall effect sensor with PIC16F

Postby shahrul » Fri Jun 17, 2011 8:25 pm

If you have no problem on reading Temperature, Light, and Voltage, so you have no problem with ADC. The problem here is the ACS712 sensor no exactly linear. I have used this before, see code here.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Reading problem of ACS712 hall effect sensor with PIC16F

Postby navidbox » Mon Jul 04, 2011 9:25 pm

shahrul WROTE:If you have no problem on reading Temperature, Light, and Voltage, so you have no problem with ADC. The problem here is the ACS712 sensor no exactly linear. I have used this before, see code here.



Dear Shahrul,

Thanks for your comment in Forums of Cytron related to ACS712.
It helped me to solve the problem.

May i ask the following questions:

1- ACS712 is able to measure the current till what value? (Input to the ACS712)

2- Write me the code to display 20.15 instead of (20.1)- I can't get the exact code for that within your program.

3- Do you have any experience with LABVIEW for real time monitoring of analog measurement?


Can i have your email address to keep in touch?

Thanks in advance.
navidbox
Newbie
 
Posts: 8
Joined: Thu Jun 16, 2011 2:20 am

Re: Reading problem of ACS712 hall effect sensor with PIC16F

Postby shahrul » Mon Jul 04, 2011 9:58 pm

navidbox WROTE:1- ACS712 is able to measure the current till what value? (Input to the ACS712)

The sensitivity either 66mV/A, 100mV/A, 185mV/A. The real, you just test it.
navidbox WROTE:2- Write me the code to display 20.15 instead of (20.1)- I can't get the exact code for that within your program.

Not my job to write you a code.

navidbox WROTE:3- Do you have any experience with LABVIEW for real time monitoring of analog measurement?

I never use LABVIEW yet
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Reading problem of ACS712 hall effect sensor with PIC16F

Postby robosang » Tue Jul 05, 2011 10:46 pm

shahrul WROTE:Not my job to write you a code.


Shahrul, good point you have there! :mrgreen:
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Reading problem of ACS712 hall effect sensor with PIC16F

Postby navidbox » Wed Jul 06, 2011 11:28 pm

shahrul WROTE:
navidbox WROTE:1- ACS712 is able to measure the current till what value? (Input to the ACS712)

The sensitivity either 66mV/A, 100mV/A, 185mV/A. The real, you just test it.

I mean is it able to measure 50A? it means that 66 (mV/A) * 50 A=3.3 V
navidbox WROTE:2- Write me the code to display 20.15 instead of (20.1)- I can't get the exact code for that within your program.

Not my job to write you a code.

navidbox WROTE:3- Do you have any experience with LABVIEW for real time monitoring of analog measurement?

I never use LABVIEW yet
navidbox
Newbie
 
Posts: 8
Joined: Thu Jun 16, 2011 2:20 am


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 4 guests