Pages: [1]   Go Down
Author Topic: Load sensors  (Read 1146 times)
0 Members and 1 Guest are viewing this topic.
Howell, Mi
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all!

I want to make a scale using Arduino. I have 4 load cells, from SparkFun, http://www.sparkfun.com/products/10245, and 2 AD620 instrumentation amps. I am using +5 VDC to +Vs and -5 VDC to -Vs. I also am grounding REF. Rg is 28 ohms, giving a gain of about 1765 (this value has been changing as I play). Then, using +5 VDC, I send +5 to the white of one sensor and gnd to the black. The other sensor is reversed, sending +5 to the black and gnd to the white. This, i believe, creates a full Wheatstone bridge. The first sensors red lead goes to -in, the second to +in. I then put 1 Kohm resistor and 1 uF cap in series from the output to ground (caps negative to the ground) and read from after the resistor to my Arduino Uno. The last step was for smoothing the output. OK, with one AD620 running and setting cinder blocks on the two sensors with a puck for the third (3 points to sit on) I get some values on my LCD display. Questions:

1.) Connected correctly?
2.) The values are not always the same when applying the same weight. I try to set the blocks on the same place every time. What would cause the different values?
3.) My application will have about 160 lbs on the scale initially and that weight will decrease over a period of time, about a month (Keg!). Will a scale like this keep a steady measurement without major changes over time? Any help appreciated.
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 211
Posts: 13479
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The values are not always the same when applying the same weight.
Can you be more specific?
The analogRead() fluctuates, to stabilize one might connect AREF to 5.00 Volt.
Or take multiple readings and average them; 
  x = (analogRead() + analogRead()) /2;

Or use a "low pass" filter :  prev value is used for 90% and the new value is used for 10%  (percentages can differ, watch out for int overflow)
   x = (analogRead() + 9*x)/10;   


Quote
Will a scale like this keep a steady measurement without major changes over time?
Good question, do you have a link to the datasheet? maybe it makes some statements about continuous use.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Howell, Mi
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply.

I already take 30 readings and average them before outputting the data. I didn't think that I needed to play with AREF if I use 5 VDC. Does it help to specify it in programming? Also, as stated above, I am using a low pass filter to help smooth the output. Yours seems to be of the software variety (cool!). Should I use yours instead of or in addition to?

The sketch is available if interested.

Thanks!
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17261
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply.

I already take 30 readings and average them before outputting the data. I didn't think that I needed to play with AREF if I use 5 VDC. Does it help to specify it in programming? Also, as stated above, I am using a low pass filter to help smooth the output. Yours seems to be of the software variety (cool!). Should I use yours instead of or in addition to?

The sketch is available if interested.

Thanks!
The Arduino A/D already uses the boards +5vdc as it''s A/D reference through the Avcc pin, so no advantage to wiring it via the Aref pin. However keep in mind that long term accuracy will only be as good as the boards +5vdc power, and any drift in voltage value over time because of change of temperature or whatever, will have a proportional effect on the measurement's accuracy. That is the reason that high quality lab type A/D converters utilize special reference voltage source components. Arduino's 10 bit A/D conversion hardware does not match the capablilites of high quality strain gages and load cells. AVR's total worst case accuracy spec for the A/D is +/- 2 bits, that's a pretty poor specification. The Arduino A/D function is a very useful feature, but shouldn't be considered a high quality solution.

Lefty
« Last Edit: July 18, 2011, 07:43:03 pm by retrolefty » Logged

Howell, Mi
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using a transformer to a 7805 regulator to power the circuit, the arduino itself gets power currently from the USB, but will get it from the regulator when I get the networking code done. So power fluctuating shouldn't be an issue. I am concerned with your claim of +/- 1 or 2 bits. That is HUGE. I wanted to avoid and external ADC, but if you are correct, I may have no choice.

Thanks for the info.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17261
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using a transformer to a 7805 regulator to power the circuit, the arduino itself gets power currently from the USB, but will get it from the regulator when I get the networking code done. So power fluctuating shouldn't be an issue. I am concerned with your claim of +/- 1 or 2 bits. That is HUGE. I wanted to avoid and external ADC, but if you are correct, I may have no choice.

Thanks for the info.


From the 328p datasheet:

Quote

21.1 Features

• 10-bit Resolution
• 0.5 LSB Integral Non-linearity
± 2 LSB Absolute Accuracy
• 13 - 260 μs Conversion Time
• Up to 76.9 kSPS (Up to 15 kSPS at Maximum Resolution)
• 6 Multiplexed Single Ended Input Channels
• 2 Additional Multiplexed Single Ended Input Channels (TQFP and QFN/MLF Package only)
• Temperature Sensor Input Channel
• Optional Left Adjustment for ADC Result Readout
• 0 - VCC ADC Input Voltage Range
• Selectable 1.1V ADC Reference Voltage
• Free Running or Single Conversion Mode
• Interrupt on ADC Conversion Complete
• Sleep Mode Noise Canceler

Also note that if one is using the internal 1.1vdc band-gap reference that the actual voltage value will vary some from chip to chip up to a maximum of +/- 10% and your sketch should include some form of 'offset' correction constant so that A/D calibration can be improved.

Quote
Internal Voltage Reference 1.0 1.1 1.2 V

Lefty

« Last Edit: July 19, 2011, 11:14:38 pm by retrolefty » Logged

Pages: [1]   Go Up
Jump to: