hello everyone,
We are working on a weighing scale design with the following specifications.
- Load cell 500Kg
- Load cell output 2mV/V
- Vref 5VDC
- input supply 5 VDC
- ADS Gain 128
- Data Rate 10SPS
- Interfacing with atmega328 controller
I am facing issue on ADC output count and output count continues fluctuated.
When I applied 0.00 VDC on +Ve pin and read ADC output,but data count still fluctuated.
Please help me to solving issues of ADC value fluctuation and how to measure noise?
#include<SPI.h> int ADS1230_DOUT = 12; //Pin for DRDY/DOUT of ADS1230 int ADS1230_SCLK = 13; //Pin for SCLK of ADS1230 int ADS1230_NPDWN = 5; //Pin for nPDWN of ADS1230 float capacity = 500000; float sensitivity = 2; void readdata() { SPI.beginTransaction(SPISettings(400000, MSBFIRST, SPI_MODE1)); int32_t sum = 0; int count = 0; for (int i = 0; i < 10; i++) { if (digitalRead(ADS1230_DOUT) == LOW) { int32_t sample = 0; sample |= SPI.transfer(0); sample <<= 8; sample |= SPI.transfer(0); sample <<= 8; sample |= SPI.transfer(0); sample <<= 8; sample /= 1L << 12; sum = sum + sample; count++; } } sum = sum / count; int32_t weight = (capacity * sum ) / ((1L << 20) * 128 * ((sensitivity / 1000))); Serial.println(weight); SPI.endTransaction(); } void setup() { Serial.begin (9600); pinMode(5, 1); digitalWrite(5, 1); pinMode(ADS1230_DOUT, INPUT); SPI.begin(); } void loop() { readdata(); delay(1000); }
our ADC outputs,
28332
28213
28299
28340
28310
28265
28312
28310
28263
28245
28287
28273
28332
28291
28306
28327
28323
28286
28256
28323