Ball sorter using load cell

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: Load Cell - Album on Imgur
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
ELANE - Loadcell Amplifier
https://sites.google.com/site/vitorrosamd/load-cell-arduino-interface
Weight sensors and arduino – Hardware To Software
Liquid Filling Machine – Liquid Filler Part 4 – Hardware To Software
Filling Machine – Hardware To Software

Notes and images:

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.

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

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,

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

Grumpy_Mike:
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

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

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.

GoForSmoke:
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

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.

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.

liudr:
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)

Grumpy_Mike:
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 - YouTube
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.

strykeroz:
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.

GoForSmoke:
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

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.

liudr:
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:

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);              
}

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.

Scales are cool and could be made quite small.

ferret141:
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.

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

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.

Grumpy_Mike:

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?

No because that would also decrease the reading as well.
The data sheet for that amplifier might give you some clues. The DC offset problem is a common one.

Thanks guys for all your help. In the end I went for a balance to sort the balls.
Here's a vid of the balance section: Section of ball sorter for uni. Weight based. - YouTube

I would like to get the load cell circuit working but that'll have to wait till later in the summer when I have more time.

Well done, you got it to function. Quite ingenious solution in the end.