Load Cell Project

Doesn’t sound crazy. That’s actually pretty simple these days on the electronics side. The trickiness is all in the hardware and making the interface good if it’s going to be a product you’d sell.

If it’s something for internal inventory management then that’s a bit of a lower bar and may be worth the slightly heavy-weight approach of larger single-board computers for a few measurements. Which I honestly hate as it’s such an inelegant solution and is just ‘throw expensive hardware at it’, but makes sense for a simplicity/get it running right now standpoint.

Actually it looks like an Arduino Mega has ~70 I/O pins so you could run 35 scales from one controller. That will cut down on cost and on the number of USB cables. Maybe an 8-port USB hub and you’re up to 280 scales already.

1 Like

No sell is never going to happen. If anything it goes in if they do business with us, then removes when they no longer do business with it. Never sell!

1 Like

Quite a few, we’ve routinely ended up with 8-10 in the past for a variety of reasons and I don’t see why that wouldn’t scale further out. They do get excessively brittle, though. Personally I don’t like dealing with higher level PC hardware for that reason and would probably do the combination a layer below that, ideally speaking. Have a single piece of hardware talking to the PC if at all possible.

1 Like

Right, but it’d be customer facing (as in your customers, not retail customers)? How ‘polished’ would you be expecting? Is it something you’d have to manage on one 1-2 sites or potentially hundreds?

So alot of what you said above was very intriguing. Especially the part of being able to change address of the slave modules.

Woukd be very fortunate if it went to 100s. Thwy would possibly give me a raise at that point, bahahaha

1 Like

I can polish it as i go. Not too worried about that. Arduino would be great, as i was considering some other things as well. Like rfid entrance and doors that lock.

As i just wrote that i am reversing my logic. I could have the pi send data as a logger type functon to sql! And possibly more! Just run fewer scales per! And pi could do poe hat for power

Yeah, a lot of this just comes down to how you’d manage it. The easy way is to have programmable/changeable addresses but that ends up being a lot of work at larger numbers and can add cost.

The zero-config way is to use a pre-burnt serial number like one-wire devices to, but it ends up needing a fully-fledged setup process because the serials will be ugly, as in like 10-digit alpha-numeric number ugly, so you won’t want to be typing those in manually anywhere.

Let’s say a nice easy 255 scales. That’s a single 8-pin DIP switch and setting the addresses in binary. You manually adjust each device to what you want and call it a day.

So the hardware: Cheap micro (ESP32 module used directly or a devkit or something), 8-way DIP switch for the address, RS485 transceiver with 1/8 load or better, linear regulator, 2 8P8C (the same used for ethernet) connectors so you can daisy chain them and make use of the twisted pairs and cheap patch cables and then the load cell IC going directly to screw terminals. Maybe $10 each in quantities of 100?

Then the system would look like: Main PC with USB-485 transceiver, maybe an external 12V power supply, maybe the 5V from the USB port would be fine. That transceiver goes straight to the first module, each module is daisy chained onwards. At the end you might need to add a special board with a terminating resistor, depending on how long the run is. At a few meters no problem, at 10m, probably fine, at 50m, definitely.

2 Likes

If that’s what you’re most comfortable with, you could definitely do it that way. Just be aware that it’s VERY hardware ‘heavy’, as in you’re using a lot of cost/complexity to do a relatively simple job. If it’s 10 scales, go ham, no real ‘wrong’ answers. I would suggest that this might seem like the easiest path because it’s familiar, not necessarily because it’s a good option :slight_smile:

Have you played around with micropython at all? If not, perhaps start there. Grab an ESP32 (I’m a big fan of the Seeed Studio Xiao modules but most any ESP32 will do) and program micropython onto it and start playing around with it via the REPL. That basically gives you a commandline where you can write python commands directly to it and interact with the hardware directly. You can read/set GPIOs, read ADCs, interface with peripherals connected via I2C, onewire, SPI, whatever else etc. It makes getting stuff off the ground super friendly because you can just poke at it, there’s no compiling/recompiling, debug can come straight to you via that interface etc. Then once you’re done and it’s working, you copy the commands sent into a text file, upload that as main.py, reboot the thing and away it runs. It really is a bit of a miracle, at least to the eyes of a dude who use to work in C directly with the occasional foray into inline assembly and needing to manually decode firmware .hex files to figure out wtf the compiler was doing…

I’m not even joking when I’m saying a simple version of this could be a few hours work for the PCB and maybe 20 minutes for the firmware…

1 Like

Never micropython. I have 3 esps here from when ryan started the fluidnc path, thought i could help, bahahahaa, that was not happpening. Do you have a link i can research?

I think i found it
https://docs.micropython.org/en/latest/esp32/tutorial/intro.html

2 Likes

Man i envy your education!

3 Likes

It’s more that I just pick and choose what to chime in on. This just happened to perfectly line up with my professional experience :smiley:

2 Likes

Yep, that’s the one. You’ll need Python installed to install and use esptool. Any way to program the ESP32 should work, though.

The next thing is to get a REPL prompt up:
https://docs.micropython.org/en/latest/esp8266/tutorial/repl.html
I had a bit of a mare with the WebREPL approach but I got it working in the end. Serial just worked straight off, so that’s my initial starting point and you’ll need that to get the web one up and running anyway.

Edit: From memory, the webREPL issue was that you need to be able to get to an http:// site from the browser, which took a bit of wrangling with Firefox. That can be sorted by just downloading a local copy of the webREPL page. The other was that you need to connect to the webREPL instance using the IP and port. Omitting the port just fails.

3 Likes

Thank you all! jono035 jamiek jeffeb3 Michael_Melancon

Sorry it told me i can only mention 3.

1 Like

Got it. I have monday and tuesday off. Let me see what i can do!!! Thank you! I love learning and creatimg new things!

2 Likes

I didn’t think I did anything :grin:

But I’ll take it :laughing:

4 Likes

Sounds good. Feel free to sing out if you have any questions. I’m about to bail out from work but I keep an eye out over the weekends etc.

If you get the uPython stuff up and running, perhaps grab one of those I2C breakout board things that @jeffeb3 and @jamiek mentioned above with the HX711 on and try getting that hooked up. That’d be my next step.

Oh, and definitely try getting the WiFi working on the ESP32 and then get it sending MQTT messages, especially if you have a Home Assistant instance floating around… That’s super simple and super rewarding. From there, the world’s your oyster :slight_smile: That’s basically the core of my custom home automation setup.

Moral support? :smiley:

2 Likes

I did something vaguely similar a few years ago.
I simply used an arduino nano and a load cell. The load cell comes with a little amplifier circuit, make sure you’re getting it otherwise the arduino won’t be able to measure the load. I connected it to the nano so it could interpret the load value, then the arduino transmits the value over the serial port with simple serial commands. It is super easy to do and it works well.

It looked like this:

With the arduino platform it is also very easy to add communication modules like bluetooth or wifi so you won’t even need physical cables from one load cell to the other.
In my case I was just using an usb cable to connect it to my computer.

If I were you I’d have one arduino nano per measuring device (they are super cheap), and then each arduino would send its data over serial either via a cable or via wifi to a Master raspberry pi in charge of collecting the data from each of your sensor. It would then be in charge of making sense of these data and organizing them so they could be used by your ERP system.

3 Likes