Pages: [1] 2   Go Down
Author Topic: Ball sorter using load cell  (Read 2155 times)
0 Members and 1 Guest are viewing this topic.
London sumware
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to build a ball sorter. There are two types of ball I need to sort; one made of acetal the other nylon. Both are 20mm in diameter. I don't have the balls to hand but I need this built beforehand. I've calculated the acetal ball to weigh approximately 5.8g and the nylon ball to weigh 4.6g. The way my machine will work is the balls will come in along a channel and be fed one at a time via an aperture (piece of card + servo). The fed ball will land on a scale, be weighed and push into its respective container.

I figured I could do this with a load cell, two servos and an Arduino. I looked online in case someone had already done it before and sure enough there were a few applicable projects out there. After reading through one of them I got the parts I needed.
  • Oomlout ARDX kit with Arduino UNO
  • 1kg digital jewellers scale with 0.1g accuracy off eBay
  • BurrBrown INA125P amplifier

To start with I followed the guide by Christian here and ended up with this: http://imgur.com/a/tfskO#0
This worked to an extent but required a 500g mass to produce a noticeable reading. I read the guides/blogs again and changed the gain resistor from 10 ohms to 560 ohms (the next highest I had was 2.2 kilo-ohms), added analogReference(INTERNAL) to my code and averaged a sample of 50 before printing to the serial monitor. Now I could detect 5g changes.

Next instead of using the 5v on the Arduino I used the scale's own excitation power (close enough to be 2 volts) instead (it also meant I could see the weight on the scale too). This brought down the readings from around 140 to 60 on the serial monitor but still no improvement in the resolution. I need at least 1g accuracy (0.1g would be excellent) which I haven't been able to achieve. From what I understand I need to adjust my reference voltage and my gain resistance to get the accuracy I need. This is where I need your help because although I can take apart, fix and improve all things mechanical my knowledge of electrical principles is pretty much ends with Kirchhoff’s and Ohms Laws. I am technically minded so don't worry too much about me not understanding explanations and requests for more information.

Thanks


Links to what I have looked at (the hw2sw.com stuff seems to be the most useful/rich):
http://cerulean.dk/words/?page_id=42
http://www.elane.net/index.php?go=loadcell_amplifier#
https://sites.google.com/site/vitorrosamd/load-cell-arduino-interface
http://www.hw2sw.com/2011/10/20/weight-sensors-and-arduino/
http://www.hw2sw.com/2011/10/27/liquid-filling-machine-part-4/
http://www.hw2sw.com/filling-machine/

Notes and images:
http://imgur.com/a/tfskO#4
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Besides different in density, are they different in any other ways, such as color, conductivity, magnetic property?

Do you have to involve arduino in this project to show some competence or are you finding solution to a problem you encounter and think arduino could help?

If I calculated correctly, the nylon ball has a density of 1.1g/cm^3 and the other is bit higher. You can just dump them in salt water (density between 1.0 and 1.2 depending on salt content), the nylon balls will float and the other balls all sink to the bottom.
Logged


The Netherlands
Offline Offline
Sr. Member
****
Karma: 4
Posts: 332
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With the loadcell your 1024 steps 10 bits resolution of the DAC on the UNO is the problem.
If the ADC has higher number of bits the steps become smaller so is the measuring tolerance.
I am not good in numbers so I cant give you the exact resolution you need to use i.e. 13 or even 24 bits.

Paco
Logged

Never to old to learn and I learn every day

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 627
Posts: 34220
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to increase the gain from your amplifier, so you need a bigger resistor. Try that 2K2 one you have it won't do any harm if it is too high.
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Can I clarify from what you're saying, with the 10g reference shown in your images, AnalogRead() shows 0, and at 0.5kg it shows 140 with a 5V excitation voltage on the load cell?  Also, how are you measuring the 2V excitation voltage the scales use internally?

Cheers ! Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to increase the gain from your amplifier, so you need a bigger resistor. Try that 2K2 one you have it won't do any harm if it is too high.
Hi Mike,

From the data sheet it appears this thing runs the other way.  The gain is given by G = 4 + 60kR / RG (ref page 10 of the datasheet) so with no connection it's 4, and it's up to 10000 at 6R.  The 10R in the original example would have provided a gain of 6004 or thereabouts (no connection gives 4).

Cheers, Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4808
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

See if one ball rolls down a ramp faster than the other. That's how old slug detectors work.

http://physics-animations.com/Physics/English/angl_txt.htm
Quote
   If two cylindrical bodies are rolling down on a inclined plane then body which has the smaller inertia moment will reach the end of the plane first.

The balls will have different trajectories after leaving the end of the ramp. You can literally put two buckets down and catch each type of ball in a different bucket.

Another way to tell that would take less space would be to use momentum transfer. The same momentum applied to each should make them move at different speeds. Put in a jump ramp with a block so the faster one goes over while the slower is blocked.
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

See if one ball rolls down a ramp faster than the other. That's how old slug detectors work.

http://physics-animations.com/Physics/English/angl_txt.htm
Quote
   If two cylindrical bodies are rolling down on a inclined plane then body which has the smaller inertia moment will reach the end of the plane first.

The balls will have different trajectories after leaving the end of the ramp. You can literally put two buckets down and catch each type of ball in a different bucket.
Only if they have the same mass, or one is very slippery and the other is sticky.

Quote
Another way to tell that would take less space would be to use momentum transfer. The same momentum applied to each should make them move at different speeds. Put in a jump ramp with a block so the faster one goes over while the slower is blocked.

That would work.

Now I am thinking about a simple balance. You put 5g weight on one side and introduce a ball to the other side. Gravity will tell you what to do.
Logged


London sumware
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Besides different in density, are they different in any other ways, such as color, conductivity, magnetic property?

Do you have to involve arduino in this project to show some competence or are you finding solution to a problem you encounter and think arduino could help?

If I calculated correctly, the nylon ball has a density of 1.1g/cm^3 and the other is bit higher. You can just dump them in salt water (density between 1.0 and 1.2 depending on salt content), the nylon balls will float and the other balls all sink to the bottom.
To quote my project brief "The balls are identical in appearance and surface texture".
I chose to use the Arduino because I couldn't really see any feasible way to sort the two out with a calculated mass difference of 1.2g so I opted to do it eletronically.
Nylon66 ball has a density of 1.1g/cm^3 (I worked out mass to be 4.6g)
Acetal ball has a density of 1.4g/cm^3 (I worked out mass to be 5.8g)



You need to increase the gain from your amplifier, so you need a bigger resistor. Try that 2K2 one you have it won't do any harm if it is too high.
Check this video out
In it I tested using a 5v excitation and cycled through gain resistors of 10, 560, 1k pot, 2.2k with masses of 3g and 10g. Then the same using a 2v excitation.



Hi,

Can I clarify from what you're saying, with the 10g reference shown in your images, AnalogRead() shows 0, and at 0.5kg it shows 140 with a 5V excitation voltage on the load cell?  Also, how are you measuring the 2V excitation voltage the scales use internally?

Cheers ! Geoff
Please check the video above within this post for my readings.
As for the 2V. I was curious to see what the digital scale used to excite the load cell. So I opened it up again, turned it on and measured the voltage across E+ and E- using a multimeter and got 2v (2.03). The scale is powered by two AAA batteries.



See if one ball rolls down a ramp faster than the other. That's how old slug detectors work.

http://physics-animations.com/Physics/English/angl_txt.htm
Quote
   If two cylindrical bodies are rolling down on a inclined plane then body which has the smaller inertia moment will reach the end of the plane first.

The balls will have different trajectories after leaving the end of the ramp. You can literally put two buckets down and catch each type of ball in a different bucket.

Another way to tell that would take less space would be to use momentum transfer. The same momentum applied to each should make them move at different speeds. Put in a jump ramp with a block so the faster one goes over while the slower is blocked.

I considered something similar but without the balls to test with I struck the idea off since I wasn't sure if the 1.2g difference would create enough of a trajectory difference.
The block could work but same problem although I suppose if there's any significant differnce in the eleasicity between acetal and nylon it might have a better chance.
I might have to find a physicist to help me work this out if the Arduino plan fails.



Now I am thinking about a simple balance. You put 5g weight on one side and introduce a ball to the other side. Gravity will tell you what to do.
A mechanical idea I like. Now I'm just a bit unsure of how to place the ball onto that balance without it dropping off.



Thanks for your responses guys I really appreciate it.

Here's the code I have uploaded to the Arduino:
Code:
void setup()
{
  analogReference(INTERNAL);
  // initialize serial communication with computer:
  Serial.begin(9600);                         
}

void loop() {
  const int sampleSize = 60;
  float AnalogValueTotal = 0;
  float AnalogValueAverange = 0;
 
  for (int i=0; i < sampleSize; i++){
    AnalogValueTotal = AnalogValueTotal + analogRead(A0);
  }
  delay(5);
 
  AnalogValueAverange = (AnalogValueTotal)/sampleSize;
  Serial.println(AnalogValueAverange);             
}
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 627
Posts: 34220
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
To quote my project brief
So is this homework that you are supposed to do yourself?

The fact remains if you want a bigger output you need more gain from your load cell amplifier no matter what resistor value you need to achieve it.
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4808
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Scales are cool and could be made quite small.






 
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to build a ball sorter. There are two types of ball I need to sort; one made of acetal the other nylon. Both are 20mm in diameter. I don't have the balls to hand but I need this built beforehand. I've calculated the acetal ball to weigh approximately 5.8g and the nylon ball to weigh 4.6g.

Is discrete mechanical weighing/sorting part of the requirements, or is that just the solution you preferred? I suppose it could have been specified like that just to force you to tackle the design issues, but there are other possible approaches to differentiate based on density or mass, some much simpler.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Based on your video, the 10R resistor maxes out your readings at 1023 when there's no weight on the scales.  Clearly that's too much gain.  It's not that it "doesn't really have a reaction", it's just that is as big a value as your 10bit DAC can produce and it's hitting that with the idle reading, so there's nowhere to go when you put more weight on the scales.

In contrast the other larger values of your resistor are not setting your amp up with enough gain, so there's not enough variation being reported.  At 2k2 you'll have a gain of just 31, and at 560R you'll have a gain of 111 compared to the 6004 (that's too much) as a result of the 10R.

Check out the table on page 10 of the datasheet (immediately below and to the left of the formula I quoted above) for the gain available from some standardised resistance values.  That should give you an idea what might suit better.  If you have a trim pot all the better - you might be able to set that up such that there's enough variation.  Also, setting up a voltage splitter between the amplifier and the arduino sensor pin might be useful for reducing that lower voltage for the "no weight" to nearer 0 so you don't waste the lower range of your 1023 possible steps (it has quite a bit of noise in it so you'll need to keep it above 0 for the Arduino to be happy with it).

Cheers !
Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 627
Posts: 34220
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
10R resistor maxes out your readings at 1023 when there's no weight on the scales.  Clearly that's too much gain
No, the gain is fine. You have too much DC offset. You need to compensate for that by introducing a DC shift in the other direction to the input of the amplifier.
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
10R resistor maxes out your readings at 1023 when there's no weight on the scales.  Clearly that's too much gain
No, the gain is fine. You have too much DC offset. You need to compensate for that by introducing a DC shift in the other direction to the input of the amplifier.
Of course, that makes sense.  Could that be as easy as reducing the excitation voltage provided to the scales?
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Pages: [1] 2   Go Up
Jump to: