Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

Project Request

Return
Bright Idea Automation Solutions
biasautomation

posted on 2013/03/15 06:55:41 AM CET

Graphics & LCD > LCD

Load cell interface with PIC16f877A

Hi to all,

This is Manikandan from Bright Idea Automation solutions, which is one of the reputed company in India. here i have a problem to interface Load cell with PIC16f877A. The input for the load cell is 5v. & it gives the output in mv like 3mv depending upon the weight & it varies according to weight in milli volts.
Here i want to know, how to read this millivolts from the loadcell & display in LCD in 6 digits. please help me. thank you all
Please mail me at biasautomation@gmail.com

USER Comments

Robinson Velasquez
Cagiva125

posted on 2013/03/18 07:56:24 PM CET

Hola:

Hay 2 formas para realizar el circuito:

1) It is more accurate and easy:
Puede calcular un Amplificador de Instrumentación con Gain =1000

*REF: http://es.wikipedia.org/wiki/Amplificador_de_instrumentaci%C3%B3n

Para ALTA PRECISIÓN:
PUEDE USAR EL CIRCUITO INTEGRADO INA114:

http://www.ti.com/lit/ds/symlink/ina114.pdf

*Gain=1+(50k/Rg)

Rg=50



2)*Only for testing:

AMPLIFICADOR OPERACIONAL LM741

Sabemos que Vout=3V Vin=3mV
Y=mX+b
Vout=m*Vin + b
3V=1000*0,003V + 0

m=1000;

En un Amplificador Operacional NO INVERSOR:
*REF: http://dl.dropbox.com/u/46164500/Opampnoninverting.png

Av=R2/R1

R1=1K ; R2=999K

Vout = Vin * (1+999) *REF: http://dl.dropbox.com/u/46164500/AV%20NO%20INVERSOR.png

Vout=3mV*1000
Vout=3V



Espero que le funcione.






  • Rating:
0
No Abuse Reported

Do you want to report abuse comment ID: 647 in "Load cell interface with PIC16f877A" request.

Bright Idea Automation Solutions
biasautomation

posted on 2013/03/16 03:34:37 AM CET

Thank you for the positive reply sir.

Here i got the concept of load cell interface. please would you tell me the instrumentation amplifier circuit to convert 3mv to 3v. or please attach the circuit diagram.

Thank you

  • Rating:
0
No Abuse Reported

Do you want to report abuse comment ID: 645 in "Load cell interface with PIC16f877A" request.

Robinson Velasquez
Cagiva125

posted on 2013/03/15 06:38:16 PM CET

Hola

Para visualizar el voltaje de la salida de la celda de carga en un LCD controlado por PIC...
Primero debe realizar la conversión Analógica a Digital, pero el PIC16F877A tiene una resolución de 10bit para la conversión, si configura el voltaje de Referencia Vref+=5V la resolución sería de 4.88 mV.

Porque: (5V / 1024 muestras) = 4,88 mV

Como el voltaje mínimo que puede leer el módulo ADC del PIC es de 4,88mV debe primero acondicionar la señal para que esté en un rango optimo para el PIC.

Si la señal está entre 0 y 3mV, puede calcular un Amplificador de Instrumentación con una ganancia de 1000 para que nos de una salida proporcional de 0 a 3V que si esta en el rango del PIC.







*
Hello

To view the the output voltage of the load cell on a LCD controlled by PIC...
You must first perform the analog-to-Digital conversion, but the PIC16F877A has a resolution of 10 bit conversion, if you set the reference Vref voltage += 5V resolution would be of 4.88 mV.

Because: (5V / 1024 samples) = 4.88 mV

As the minimum voltage that can read the PIC ADC module is 4, 88mV first conditioning the signal so that it is in a range optimal for the PIC.

If the signal is between 0 and 3mV, can calculate an instrumentation amplifier with a gain of 1000 for us of a proportional output of 0 to 3V if this range of PIC dentrel.



Cuando ya tengan el Amplificador....
Pueden usar y modificar el siguiente Código ejemplo de MikroC:

*
When you already have the amplifier...
You can use and modify the following code MikroC example that I modified for 16F877A - HS 8MHz:


// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections

unsigned char ch; //
unsigned int adc_rd; // Declare variables
char *text; //
long tlong; //

void main()
{

INTCON = 0; // All interrupts disabled
//ASIGNACIÓN DE REGISTROS PARA DEFINIR ENTRADAS,SALIDAS Y OTRAS CONFIGURACIONES.
ADCON1=0b10001111; // BIT_7=1: Justifica a la derecha el resultado.
// Y los últimos 4 BITS dan la configuracion de Puerto A.
// Hay una Tabla Adjunta en el Datasheet para ADCON1.
// AN0= Entrada Análoga (RA0).
// AN2= Entrada Vref - (RA2).
// AN3= Entrada Vref + (RA3).
// Los demás pines del puerto A son Digitales.

TRISA = 0b00000111; // RA0 es entrada analógica[0 = Salida ___ 1 = Entrada].
// Y los demás son salidas digitales (Menos RA2 Y RA3).

Lcd_Init(); // LCD display initialization
Lcd_Cmd(_LCD_CURSOR_OFF); // LCD command (cursor off)
Lcd_Cmd(_LCD_CLEAR); // LCD command (clear LCD)

text = "mikroElektronika"; // Define the first message
Lcd_Out(1,1,text); // Write the first message in the first line
text = "LCD example"; // Define the second message
Lcd_Out(2,1,text); // Define the first message

ADCON1 = 0x82; // A/D voltage reference is VCC
TRISA = 0xFF; // All port A pins are configured as inputs
Delay_ms(2000);

text = "voltage:"; // Define the third message

while (1) {
adc_rd = ADC_Read(2); // A/D conversion. Pin RA2 is an input.
Lcd_Out(2,1,text); // Write result in the second line
tlong = (long)adc_rd * 5000; // Convert the result in millivolts
tlong = tlong / 1023; // 0..1023 -> 0-5000mV
ch = tlong / 1000; // Extract volts (thousands of millivolts)
// from result
Lcd_Chr(2,9,48+ch); // Write result in ASCII format
Lcd_Chr_CP('.');
ch = (tlong / 100) % 10; // Extract hundreds of millivolts
Lcd_Chr_CP(48+ch); // Write result in ASCII format
ch = (tlong / 10) % 10; // Extract tens of millivolts
Lcd_Chr_CP(48+ch); // Write result in ASCII format
ch = tlong % 10; // Extract digits for millivolts
Lcd_Chr_CP(48+ch); // Write result in ASCII format
Lcd_Chr_CP('V');
Delay_ms(1);
}
}







Referencia para la conexión:

http://www.mikroe.com/chapters/view/17/chapter-4-examples/#c4v12



*(Bing Translator).

  • Rating:
0
No Abuse Reported

Do you want to report abuse comment ID: 644 in "Load cell interface with PIC16f877A" request.