Weight measurement to computer input?

Aug 08, 2019 Last reply: 6 years ago 25 Replies

Peeps,



I would like to read the output of a strain gauge (measuring weight (0-5kg) in this instance) from a PC as part of a general experiment but not sure what bit does (and maybe limits), what.



So, strain gauge (or gauges) connects to a SG amp and that turns the output into volts?



Then you could read said volts with say an Arduino and then have a USB interface to PC, effectively streaming the output of the strain gauge in ASCII (numbers) to the PC (and the rest is software etc) .



However, I understand the Arduino's only have a 10(12 with a tweak) bit ADC and so with 10 bits I'm only going to get 1024 output values?



eg, If that was a 1kg 'scale' then I could read around 1g increments but if it was a 5kg scale then ~5g would be the smallest increment (that may be fine but I am just testing my understanding here).



Or is the output of the little eBay strain gauge amps already serial so if it was a 24 bit device (16777216) it would be resolving down to ~1/3000 of a g (mathematically at least) and so would just use the Arduino to turn it into ASCII over a USB interface (no ADC needed)?



I know you can buy commercial strain gauge to ASCII over USB devices but they aren't exactly cheap (~£250+).



Cheers, T i m


I have made this sort of suggestion for a studetn project, where it can count coins going into a money box.

youtube has more than just cat videos :-)

formatting link

their resistance changes and for small scale a wheatstone bridge circuit is a good idea and then that can be tunred into volts.

I did a simialr thing years ago using pressure sensors and a BBC computer using the analogue joystck ports as the input.

I;m guessing theres far better dedicated boards from somneone than an ardunio for changing volts to a digital o/p.

formatting link
|pcrid|78108376509|&CAWELAID=120173390002973959&CAGPSPN=pla&CAAGID=14406255429&CMP=KNC-GUK-GEN-SHOPPING-2946119&CATCI=aud-308408796421:pla-41477300408 One of the problems with studetn projects is that they can;t really practical make their own hardware they just ask me to order modules that they join together it's more like lego than electronic engineering.

After connecting a few boards hopefully the right way around, and nothing gets hot the rest of their time is spent coding

It's difficult to come up with an actual electronic engineering project where they use components.

Or buy a cheap set of electronic bathroom scales and hack it. Brian

Yes. You should be able to get 12bit or 16bit ADCs relatively cheaply provided that you don't want fast ones and can live with a bit of non-linearity. I you want strict linear then you will have to calibrate it against a reliable voltage reference source.

I'd expect a simple strain gauge to output either a resistance value, voltage or current depending on its internal design. Yo will have to think about shielding from air currents and all sorts of mechanical details if you want to go more precise than 10mg.

Decide what resolution and accuracy you need first and work from there.

Yup, or use a Arduino with Wifi and you can make it available on TCP/IP or even a simple embedded web sever.

Sounds like it.

However, there are other options...

You could use an external ADC with more resolution and talk to it on the I2C bus - trivial to do on an Arduino.

formatting link
Or I suppose you could use scaling and DC offsets (with some clipping to protect the ADC) to feed a couple of ADC channels so you can read coarse and fine readings and combine them in software.

That gets me a brake hose!

<snip>

I don't need fast but not sure about linearity (how much to expect).

Understood.

That seems to be the way most I look at are.

Ok.

1g will be more than enough. ;-)

Well, the thing is (for this experiment), as long as I know I can get (commercially) the right stuff, then that's covered. For my experiments I was interested to see how close to that I could using d-i-y level money / kit.

The 'Arduino level' strain gauge amps I've seen on eBay are supposed to be 24bit and if true and assuming I can make use of that level via something that would easily turn that into a stream of ASCII data on a PC USB port ... then I'll probably be happy. ;-)

formatting link
formatting link
formatting link
It looks like that one uses the I2C interface so if it's really 24bit internally then I should still get that resolution though the Arduino (as it's not using it's 10bit ADC's)?

Cheers, T i m

On Thu, 8 Aug 2019 17:00:22 +0100, John Rumm snipped-for-privacy@nowhere.null wrote: <snip>

Sure, not what I want to do this time. ;-)

(don't, you sound like Rod!). ;-(

Cool. I have seen then at 24bit (FWIW etc) and have since seen the mention of I2C, so that explains a lot. ;-)

Yeah, I think that's how it's done in some commercial 'Dual range' scales.

24 bits to decimal resolution. Try 352734178458 or 161780625450 ;-)

Cheers, T i m

If you find the data sheet for the device you may find that the lower bits are effectively noise and you need to be averaging multiple readings.

Nah, that's an Amazon order number! :-)

As usual, there's chips for it:

formatting link
formatting link
The main thing here is the data rate is very very low - it's not like you're trying to capture video at 24 bits here. So the ADC can do lots of filtering and averaging to get the accuracy up and ignore noise.

Since it's an external ADC, you aren't limited by the internal ADC in the Arduino's Atmel CPU.

Theo

Or if not in a hurry:

formatting link
or quicker:

formatting link
Also

formatting link

Quite.

Excellent.

... because they (can) 'talk' over I2C, I've since learned. ;-)

Cheers, T i m

Thanks for those John.

I actually have a scale with a 9PDM that goes straight to the strain gauge and a few Arduinos so will probably order something from the UK so I can get on and play (as it won't be 'expensive' in any case, especially when compared with the commercial solutions).

Cheers, T i m

Agreed.

I think there can be some of that already going on in the chips plus we can also do it in software.

Take several readings. Are they all within a reasonable percentage of each other, if yes, assume that reading etc. ;-)

Cheers, T i m

Bathroom scales only read to within 1lb, so 8 bits would allow a maximum weight of 18st.

Loads of examples in Eli's tutorials, e.g:

formatting link

I thought it was the percentage of people that voted remain[1] in the referedium ;-)

[1] according to T i m calcualtion of "the will of the people".

beware of banggood and of course other suplliers for cheap fake products One of our students had problems. We have had good products from them and it might not be their fault.

formatting link

It's a pity I can't always blame the students as that is far more fun.

<snip>

Yeah, I've used I2C quite a few times already and it makes attaching an LCD display pretty easy, via an I2C interface module.

Also used it for (multiple) digital temperature sensors and have a little routine in my library for scanning the I2C bus and revealing device ID's.

My main reason for asking the question was in case anyone here had practical experience of such things and could help me shortcut the initial research bit to some degree. Better chance of something that works reasonably well OOTB, rather than going though several 'who sold you that then' stages. ;-)

Cheers, T i m

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required