Load Cell Project

Yeah, we use Sealevel. Very expensive, but sometimes very worth it.

the more I look into this, I liked rs485 because I could have 32 devices in chain, but programming in Hex is not my cup of tea. Now I need to look at i2c!

1 Like

The DigiOne SP and DigiOne SP IA (which better supports some industrial automation protocols) are also awesome sauce. I can’t remember anymore why I changed from Lantronix to Digi for RS-232/422/485 over IP… Might have been price, might have been availability. Used them a lot in manufacturing environments, and water/waste water facilities (which is just a flavour of manufacturing).

1 Like

We mostly used the Lantronix DR-IAP because it was rated for the offshore environments we dealt with.

I only used the smaller UDS on one job because it was an IT room on a FDPSO that didn’t need the rating.

Customers were always buying so price didn’t matter, and we almost always were just extending Modbus Serial devices onto the network for remote monitoring.

Probably has been 15 years now since I had to mess with them though…

1 Like

Showing your age old man!

It’s fine… I’ll always be younger than I feel :grin:

2 Likes

Wait until we start posting about Lantronix token ring setups.

I’ve probably got some here somewhere…

1 Like

Bit late to this and haven’t read the rest of the thread but I can probably help a bit with this.

What’s the total number you’re looking to address and over what kind of cable length?

RS485 isn’t limited to 32 devices in any ā€˜real’ sense, that’s just the acceptable number of theoretical ā€˜full load’ devices that can be on a single link before the voltage thresholds are exceeded and you can’t guarantee that marks/spaces will be determined correctly anymore. RS485 transceivers are commonly specified in terms of partial load, so an 1/8th load receiver means you can have 8x as many devices on that one bus or 256.

That’s also assuming that you don’t add buffers, repeaters or make any topology changes to suit.

I’m also not sure what you mean by ā€˜programming in hex’? Depending on what you’re trying to achieve, you don’t necessarily need to leave it as a binary protocol. If you don’t mind the overhead you can still just treat the RS485 interface as a ascii text over serial interface. I’ve done that a whole bunch where we’ve used existing data provided as a NEMA string or something and just stuffed that straight out on the RS485 line and then turned it back into a 232 level UART at the other end for simplicity’s sake.

I would STRONGLY advise steering away from I2C for any length of distance or any amount of noise. It’s really not suitable for anything other than internal comms. Edit: Unless I’ve got the wrong end of the stick and you’d just be using it to communicate to a bunch of those interface ICs on a single board in which case that’s what it’s perfect for.

1 Like

Short wires are a good idea but more realistically it would be to add some filtering that’s appropriate. A wheatstone bridge is a relatively low impedance measurement scenario so wire resistance doesn’t matter as much and filtering is much more effective. Personally I’d say a good basic set of filters is going to go much further than keeping the wires short, given that the bridge itself will be connected to a metallic component that will likely act as some degree of antenna anyway.

That HX711 chip looks pretty cool, that’s exactly the route I would take if I was going this way: Get a standalone IC that does most of what you want and focus efforts on supporting that. It may end up being a $2-3 IC but if you’re only making 100-200 of them, I’d expect to save that money in design time pretty quickly.

this sounds promising, I like that. How would you go about that?

I’m sorry if I missed this above but can you try to outline the scenario for me? Either a spec list or a brief user experience story kinda thing would help.

You’ve said a lot of scales, how many is that? 10? 100? 1000? 100k? Inventory bin means I’m guessing hundreds? How are they organized? What’s the kinda budget? What’s the eventual interface you’re after? How much scalability are you expecting? That kinda thing.

Honestly i am just trying to get this going. Lets just say 5 right now.

I can expand from there is this works!

So in my mind i thought i could talk over rs485 like i could if it was just serial. I envisioned at first a pi connected to scales. Then another pi conected to scales and another. But maybe i cannot do it.

As a rough idea, if you were dealing with 100 bins that had load cells in each and were spread out randomly over 10m, I’d probably plan to have each one as its own individual fully standalone sensor and then connect them somehow.

For a wired system, my recipe for the sensor would be a low Iq linear regulator, a simple atmel micro, something like the ADC amp listed above and a low load RS485 transceiver. Perhaps a DIP or pair of rotary switches to manually set an address. For comms, if it were me personally I’d define a basic binary protocol but you could do that as ascii. Something like sending out Wxxx? where W is the command (return the measured weight), xxx is the unit ID and the question mark then carriage return/line feed is the end-of-command signal. The unit could then respond with something like Wxxx=YY.YYY where xxx is the unit ID, YY.YYY is the weight in kgs/grams/whatever. I’d then just pipe that into something a bit more heavyweight like a raspberry pi or some other single board computer via a USB-485 interface and write all the application logic in something like python or whatever directly on the raspberry pi.

From there you’d expand on that by adding a checksum to the end, or better yet a CRC so that you can determine whether the received response has been corrupted in transit or not.

If you wanted to omit the DIP switches for programming the addresses then you could have a command that sets the address of whatever unit that hears it then use that after programming to set the address and have it stored in EEPROM. Alternatively some micros have serial numbers burned in and accessible which could be used as a form of GUID. Then just keep a table of those GUIDs on programming, add a command that makes it just echo out the GUID, use the least-significant part of the serial number to assign a simpler human readable address, etc.

Another option with more up-front learning/complexity would be to use CAN, but that would result in a MUCH simpler overall wired system that ā€˜just works’ and doesn’t need scheduling of messages etc. In that case the protocol/CRC is all handled for you automatically and you’d define a static message structure to the response. Something like the first 2 bytes are a 16b unsigned int that’s the weight in grams or whatever. Or go ham and just sent it as a float, who cares, processing is cheap these days! Each device would then periodically just spit out its weight and you could use a USB-CAN interface to just listen to the weights coming back, you wouldn’t even need to send anything out.

If this were me trying to do this at work, I’d get some Seeed Xiao ESP32 modules, stick micropython on them, make a super simple custom PCB that mounts to the bin/load cell or whatever with something like that HX711 bridge amp/ADC on it (or probably a western supplier version of that part due to likely having better documentation) and then just figure out how to route power out to each one. As an extra stretch goal I’d potentially try get them running off batteries and avoid the power distribution altogether. From there, connect it to WiFi and use MQTT to a home assistant instance and use that for the display, graphing, logging/database and business logic.

Well, it’s helpful to know a realistic max bound (obviously without going crazy!) to know how it’s best to organize some of this stuff. At 5 I’d probably just get the Adafruit modules listed above and have them all hooked up to a single raspberry pi, each on their own set of IO pins using software I2C or something and call it a day. That’d be a super awkward way to do 50 because I2C doesn’t like distance or electrical noise, so I wouldn’t want to connect 50 to a single pi that way, nor is it likely to address that high or have enough pins available to do that.

Wow, the things your head can do! Jono you always impress me! But I would not feel comfortable for you giving me my project i bring to work! I was hoping my vision was doable, but maybe it is not! I would definitely want it all powered, maybe batt backup! If i can research can then maybei can continue

1 Like

But that is doable, i can connect alot of pis, i am a network engineer! Fifty would be 10 pis and a switch!

Oh, please don’t worry about that at all. This is a few minutes of thinking about it and I’m at the point with my work where I enjoy getting to think about new projects like that. If I can spend a few hours and give you something you can use at work then hey, your success is my success! :smiley:

Oh god, please don’t :grimacing:

1 Like

I’ve used these and they come together with the HX711 and there’s an Arduino library to read it (or any HX711)
https://www.amazon.com/gp/product/B09VYSHW16

These were the ones I used here:

If you were going to have only a small number (less than 10) then a single controller with two GPIOs for each scale can keep track of all of them. If your controller has USB serial then you can send the results to a computer COM port. Maybe JSON or something so it’s easy to parse.

If you need 100 scales then you can have 10 controllers and 10 USB cables and a USB hub (or a few). I’m not sure how many COM ports a computer can have before something breaks.

3 Likes

So here is what happened, we have at work a customer that was (forced) to buy alot of smartshelfs by mettler toledo. I had the idea i could make these and we could do something with inventory mgmt. Maybe i was crazy. But for it to work, they need to be scalable and addressable so we can correlate the bin to scale to parts and cross reference to erp for ordering!

:rofl:

2 Likes