Hey,
I am using load cell(200kg) connected with AD620AN(load cell amplifier). I am getting proper output on of amplifile(checked by multi meter). When i am reading this value from arduino UNO analog pin(A0, A1). Serial monitor is giving some different data.
Please find screen shot of output.
also find the code i am using.
#include <XBee.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
XBee xbee = XBee();
uint8_t payload[] = { 0, 0 };
// SH + SL Address of receiving XBee
XBeeAddress64 addr64 = XBeeAddress64(0x0013A200, 0x40DC8215);
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
ZBTxStatusResponse txStatus = ZBTxStatusResponse();
int offset1=0;
int offset2=0;
int L1,L2,L3 = 0; //
int statusLed = 13;
int errorLed = 13;
void flashLed(int pin, int times, int wait) {
for (int i = 0; i < times; i++) {
digitalWrite(pin, HIGH);
delay(wait);
digitalWrite(pin, LOW);
if (i + 1 < times) {
delay(wait);
}
}
}
void setup() {
pinMode(statusLed, OUTPUT);
pinMode(errorLed, OUTPUT);
Serial.begin(115200);
mySerial.begin(115200);
xbee.setSerial(mySerial);
}
void loop() {
// put your main code here, to run repeatedly:
String dataString;
L1=analogRead(0);
L2=analogRead(1);
dataString= String(L1)+","+String(L2)+";";
float weight = ((L1-offset1)+(L2-offset2))/2.3;
Serial.println(dataString);
payload[0] = int(weight) >> 8 & 0xff;
payload[1] = int(weight) & 0xff;
xbee.send(zbTx);
// flash TX indicator
flashLed(statusLed, 1, 50);
delay(500);
}

