How to hack a weighing scale.  - Page 1
Forum section: electronics / beginners

author: Nexo
author_rank: Regular Contributor
timestamp: February 28, 2017, 07:44:59 am
content: Hello everyone!I have this project and is about hacking an electronic scale, as shown in the picture, in order to connect it to a Data acquisition board and to save all the weights the scale detects to a computer as an Excel spreadsheet using LabView.http://1.bp.blogspot.com/-fJ6eIAeqUmw/UDehttdbi9I/AAAAAAAAFQo/EwvTV1Cq6iw/s1600/scalelimegreen.jpgMy question is, how can I hack the scale in order to grab the number it shows on the display and send it to the computer.I'd really appreciate your help!P. S. The scale is just a reference, I'd probably use a different one.Have a great day!

author: CaptCrash
author_rank: Regular Contributor
timestamp: February 28, 2017, 09:20:16 am
content: Assuming that you are happy to hack the scale, then you can use something like the HX711.With a little bit of code and some calibration you can get quite accurate measurements.As a guidehttps://learn.sparkfun.com/tutorials/load-cell-amplifier-hx711-breakout-hookup-guide

author: Nexo
author_rank: Regular Contributor
timestamp: February 28, 2017, 09:32:43 am
content: Thanks for your reply!In fact, what I want to do is to use the existing scale and just "intercept" the info that's going to the display and to recorded on the computer using a Data Acquisition Board and Labview.Is there anyway to play around with the circuit itself?

author: wraper
author_rank: Unknown
timestamp: February 28, 2017, 09:36:36 am
content: Quote from: Nexo on February 28, 2017, 09:32:43 amThat won't be that easy and likely will cost more than such crappy scale itself. It's really easier to just throw out electronics completely and make your own.

author: bktemp
author_rank: Super Contributor
timestamp: February 28, 2017, 09:44:30 am
content: Reading and interpreting the signals going to the LCD glass is possible, but not trivial, because the LCD uses multiplexing and needs multiple analogue signal levels to make the signals seen by the LCD an AC voltage.Replacing all the electronics, or if the scale uses an external ADC grabbing the raw data from the ADC is much easier, although you need to do the calibration yourself.

author: CaptCrash
author_rank: Regular Contributor
timestamp: February 28, 2017, 09:45:18 am
content: Quote from: wraper on February 28, 2017, 09:36:36 am100% agree, just use the scale body, cut off the standard electronics from the load cell, use the HX711 and connect it to your processor of choice.In my case I was measuring very small amounts 0.01 - 0.2g (fish food pellets), so it was easier to source the load cell as a cheap ebay jewellery scale.Trying to intercept the signals to the LCD panel would be very painful

author: voltsandjolts
author_rank: Unknown
timestamp: February 28, 2017, 09:54:28 am
content: If you enjoy programming use a camera to read the display, it could work with any weigh scale then.http://stackoverflow.com/questions/9413216/simple-digit-recognition-ocr-in-opencv-python...or this...https://github.com/arturaugusto/display_ocr

author: capt bullshot
author_rank: Super Contributor
timestamp: February 28, 2017, 10:02:11 am
content: SCNR :-Þ

author: Brumby
author_rank: Unknown
timestamp: February 28, 2017, 10:37:36 am
content: I have actually done exactly this.... reading the LCD drive signals on a cheap digital scale and creating a data stream to a PC.In fact, I went a little further - I added a barcode scanner.Using an Arduino (clone) I programmed it to capture the barcode and weight in one action. The idea being to record the weight of a product for uploading to a product database for an online eCommerce site.It probably would have been a nice little project to present - but it was before I joined the EEVblog, so I didn't even think about that idea. Not sure what happened to my notes - but I do have the project ... somewhere ... and the sketch. The Arduino programming isn't very pretty - it was my first effort outside flashing LEDs.I never got it up to the Excel entry stage. I got as far as the data being received by the serial monitor and set it aside. It was enough to get the data I wanted - and there were other priorities.

author: ebastler
author_rank: Super Contributor
timestamp: February 28, 2017, 01:27:46 pm
content: Whether and how a scale can be hacked will probably depend quite a bit on the specific model, and what chip(s) it uses. Best to look for instructions including specific model recommendations, I think. Google will show quite a few, e.g. this one:http://www.instructables.com/id/Digital-kitchen-weighing-scale-interface-for-Ardui/On the other hand, if you still have to buy a scale anyway: With USB-enabled scales selling new on ebay for $25 (shipped from the US), this may not be the most rewarding project?

author: NivagSwerdna
author_rank: Super Contributor
timestamp: February 28, 2017, 05:11:46 pm
content: I have had a low priority hacking project running for years now...https://aardvarklabs.wordpress.com/2013/02/03/reverse-engineering-the-salter-ultimate-accuracy-scale/The LCD on my scale is very multiplexed (four-way) so it is quite tricky to intercept. In the end I designed a PIC24 based PCB to read the load cell and drive LCD glass and threw out the existing board... but I'm still to finish it off completely... 4 years later...Does it just have a single load cell?You will need a lot of gain to detect a voltage change.... and with that gain will come challenges... The HX711 suggestion earlier is sound and might save you a world of pain.

author: james_s
author_rank: Super Contributor
timestamp: February 28, 2017, 06:01:09 pm
content: I assume the scale uses a single IC or blob to do everything and not a separate display driver?I have a computer interface board installed in one of my old radio scanners. It taps into the serial bus that controls the LCD display and from there it is able to read the data being sent to the display, works really well. I'm guessing that isn't going to be possible with a cheap scale though.

author: Nexo
author_rank: Regular Contributor
timestamp: March 01, 2017, 02:57:50 am
content: Brumby, do you think you could share your notes and code?I would be really helpful!

author: Nexo
author_rank: Regular Contributor
timestamp: March 01, 2017, 03:07:02 am
content: Quote from: ebastler on February 28, 2017, 01:27:46 pmGood point although I've only found this ones:http://www.ebay.com/itm/USB-Electronic-Pocket-Mini-Digital-Jewellery-Weighing-Scales-0-01G-to-1000Grams-/282276135695?var=&hash=item41b8f8030f:m:mgKTHzQXL4lgZoJBWRunE5wHave usb but only for charging, I guess... Can't quite understand.

author: Brumby
author_rank: Unknown
timestamp: March 01, 2017, 03:50:57 am
content: My notes were not kept with the project - so I don't know where they are.I've just checked through my sketchbook - and found some sketches I used both for the analysis of the LCD driver signals and the last version of the operational sketch. The comments in the sketch are woefully inadequate. I would not feel comfortable sharing it until it had better documentation.Mapping the LCD display was an interesting exercise, but fairly straightforward, once you understand which pins affect what segments.I do remember going through an evolution in using the Arduino to analyse the LCD signals. First I tried multi-channel analogue sampling only to find the Arduino was simply way too slow - and I only got some results of sufficient resolution when I had it capturing only one input.From that, I was able to jump directly to digital input sampling and found - much to my delight - that I could connect the driver lines directly to the Arduino digital inputs. I did not go into the specifics of how this worked - because it just did. I do not suggest you take this step as a given - I may have just found a happy set of circumstances ... but I took it!I did find that I would occasionally get a mis-read, but I got around that in software, making sure I only output a scale value where the same result had been recorded more than X times out of Y samples.Maybe I should try organising this into something more formal.....Time, at the moment, is a problem, though.

author: Nexo
author_rank: Regular Contributor
timestamp: March 02, 2017, 04:45:30 am
content: I've decided to build my own scale using the HX711 and a acrylic base.Now, my questions is, after I calibrate the scale on Arduino, what can I do to save the data of the things that have been weighted on a excel spreadsheet?Having in mind that I'd like to weight almost 30 items per minute.Any ideas?Thank you very much for your help!

author: Brumby
author_rank: Unknown
timestamp: March 02, 2017, 04:57:04 am
content: Quote from: Nexo on March 02, 2017, 04:45:30 amTry reading up on Keyboard.write(), Keyboard.print() and their associated commands.Note this:WARNING: When you use the Keyboard.write() command, the Arduino takes over your keyboard! Make sure you have control before you use the command. A pushbutton to toggle the keyboard control state is effective.This warning is given for other Keyboard.xxxxcommands.

author: Harvs
author_rank: Super Contributor
timestamp: March 02, 2017, 05:04:01 am
content: Just an example if you're interested, I read the LCD on a cheap IR thermometer. The principles would be the same.https://forum.makehackvoid.com/t/reverse-engineering-a-ir-thermometer-lcd/724/18

author: Nexo
author_rank: Regular Contributor
timestamp: March 02, 2017, 06:37:47 am
content: Quote from: Harvs on March 02, 2017, 05:04:01 amAwesome information!I'm a newbee so I'll have to start reading it along with wikipedia or another electronics site. Thank you very much for sharing!

author: Nexo
author_rank: Regular Contributor
timestamp: March 03, 2017, 08:48:01 am
content: That's the problem.The computer is shared so somebody else will be using it. There is another way to accomplish that? I was thinking, instead of doing that, it could send the data to a database or something but without using the command that takes over the keyboard.

author: Brumby
author_rank: Unknown
timestamp: March 03, 2017, 02:36:44 pm
content: Well, the first exercise I did was sending data to the serial monitor, so that's a way to bypass the keyboard - but it isn't particularly workflow friendly.I don't doubt you could write some code to capture the data stream and do something more useful with it, but that's a step I haven't ventured into. Saving to a text file shouldn't be too hard. Direct updating of a database might be more 'interesting'.The other thing, too, is that if you are going to get into a background processing application while someone is using the machine on foreground work, you should also think about how this setup will handle abnormal conditions - which can be anything from communication dropouts to data capture confirmation and how to correct data that is in error, duplicate, etc.In short, a self-contained subsystem.

author: Nexo
author_rank: Regular Contributor
timestamp: March 04, 2017, 06:16:31 am
content: How much data per minute could sending data to the serial monitor allow me? I mean, how many times could I use the scale to weight a product per minute without having problems. I´d like just an approximation if that would be possible.Thanks again!

author: ebastler
author_rank: Super Contributor
timestamp: March 04, 2017, 08:28:07 am
content: Quote from: Nexo on March 04, 2017, 06:16:31 amI don't think the data transfer to the PC (serial or whatever) will be limiting there. Even at a modest baud rate of 9600, you could transfer 1000 characters per second. You don't need any "dialog" between the scale and the PC; just push your digits to the PC whenever its handshake signal says you are clear to send.Handling your products, waiting for the scale readout to stabilize, pushing a button to tell your microcontroller that it can now send the data, will be limiting your throughput.Depending on what you want to use the scale for, you may also need a "workflow" where you enter a product serial number or so, and record the weight for that specific article? That would require either a little program on the PC, or you would need to add a keyboard (or maybe a barcode reader) to the microcontroller you attach to your scale, so you can record this meta-intormation?

author: Brumby
author_rank: Unknown
timestamp: March 04, 2017, 01:40:27 pm
content: Quote from: ebastler on March 04, 2017, 08:28:07 amYes. Data transfer rate is not an issue.QuoteAbsolutely correct! These are the limiting factors - not the data rate.One thing that I took special steps to safeguard is the settling time. My software stores a number of readings and only passes data for transmission when it has a certain number of identical values. This means that even if I'm too quick with triggering the barcode scanner, it will wait.QuoteThis is why I added the barcode reader. It not only provides an identifying piece of data, but also supplies the trigger to initiate data transfer.This is starting to inspire me to drag my project out again.....

author: Nexo
author_rank: Regular Contributor
timestamp: March 04, 2017, 05:33:26 pm
content: Quote from: ebastler on March 04, 2017, 08:28:07 amIncredible info, again, thank you very much!I´ll start reading all about the concepts you mentioned.Quote from: Brumby on March 04, 2017, 01:40:27 pmYou should do it! That way I could learn a lot about it

author: Brumby
author_rank: Unknown
timestamp: March 05, 2017, 01:23:24 am
content: You might have to be patient. I have an urgent job at hand that is going to keep me busy for several days, at which time some other jobs are going to start getting short on time.But hang in there.

author: Nexo
author_rank: Regular Contributor
timestamp: March 05, 2017, 05:01:27 am
content: I will mate! Thanks in advance!

author: bson
author_rank: Unknown
timestamp: March 05, 2017, 09:24:13 pm
content: Just buy a cheap USB scale. I bought a Radio Shack one about 10 years ago (or more) that connected as a USB HID device, then connected to it and reverse engineered what it sent. Super simple stuff. These days I'd use something likehttps://freeusbanalyzer.com/with any inexpensive USB scale, reverse engineer it and go write my own software for it. (The free version of that one is session duration limited; I have the $200 pay version since that's the only pay version that will show raw data, which is 90% of my use. There are many others also, but they all work and cost pretty much the same.)

author: Smokey
author_rank: Super Contributor
timestamp: March 05, 2017, 11:12:25 pm
content: How is it we are on the second page here and I'm the first person to bring up the fact that this dude sure sounds like a student looking to get some class project done for him by someone else on the internet without making any effort to understand anything related to the job at hand or do any technical work himself?

author: Nexo
author_rank: Regular Contributor
timestamp: March 06, 2017, 01:59:51 pm
content: Well you are completely wrong.First of all, if you read my previous treads, I'm a first year, second semester, student of EE and the subject that I asked here is studied at least in the third year so your point there makes no sense.Second of all, I asked because I'd like to implement that on a personal project which I will most certainly not rate nor gain money from.And third of all, wouldn't be nicer if you asked first what was it for instead of making assumptions based on what you think instead of facts?Some people need a doze of common sense...You just commented once in this thread and it was not helpful at all, wouldn't be easier for you just to stay out of this if you can't add value to the thread?Have a good day, pal.

author: cverburgh
author_rank: Contributor
timestamp: March 06, 2017, 06:06:06 pm
content: Hey Guys,I did something very similar last year, and am building a second one now. We have an industrial scale that has a barcode reader attached, and an RS-232 output. I have it hooked up to a raspberry pi.The use places an item on the scale, then scans the work order number of the item. The scale then outputs the weight (with UoM) and work order number. The Pi is standing by monitoring the serial port. When it receives the data it parses it to make sure the UoM is correct. It then sends that data to an internal web server. The web server uses the work order number to look up the stock code of the item, then records the date, weight, work order, and stock code into a database. It then checks the recorded weight against a table of predefined weights for the lower weight threshold, upper weight threshold, and the Not to Exceed Weight.If the weight is between the threshold values the web server sends a back an Ok response along with the stock code, and then a green light flashes to let the operator know everything is ok. If the recorded weight is outside of the threshold values or is higher than the Not to Exceed Weight, three red lights flash, and the particular error message is displayed to the user on a 20x4 LCD screen. The user then has to push a button on the box to acknowledge the error and continue weighing items.The reason I'm using a Raspberry Pi rather than an Arduino or similar is because it required network access.I have the code (in Python) on GitHub. This was my first ever experience with Python so it may be a little messy. The code can be found athttps://github.com/cverburgh/PythonScale.For recording your data, I would recommend using a comma delimited text file. It's plain text so it's easy to read and write to, and Excel will open it just fine.

author: Smokey
author_rank: Super Contributor
timestamp: March 06, 2017, 06:37:33 pm
content: The only way you could have made your request sound MORE like a class project would be to start the post off with:"Lab 4 - Data acquisition with Labview"Once you get the data (from Labview?!?) is the next requirement to analyze it with Matlab?

author: ebastler
author_rank: Super Contributor
timestamp: March 06, 2017, 07:53:03 pm
content: Quote from: Smokey on March 05, 2017, 11:12:25 pmMaybe that is because you are the only one here who is a little paranoid in this respect? ;-)

author: Nexo
author_rank: Regular Contributor
timestamp: March 07, 2017, 03:06:44 am
content: Quote from: Smokey on March 06, 2017, 06:37:33 pmI'd like to teach you how to read... Why would you think that I want to analyze the data with Matlab if I said at the beginning that I want to create a Spredsheet :SDude, if you have nothing to contribute just keep rolling. Is sad to just comment things that aren't helpful.

author: Smokey
author_rank: Super Contributor
timestamp: March 07, 2017, 07:44:53 am
content: Labview and Matlab are equally crazy to use for a project like this, but it's the exact combination a university lab would have you use. Throw in a little VHDL to code up your own processor to handle everything and now you are talking A+ type work!

author: Nexo
author_rank: Regular Contributor
timestamp: March 07, 2017, 06:40:13 pm
content: Quote from: Smokey on March 07, 2017, 07:44:53 amIn 3 years, when I study that software I'll come back and read your comment. Meanwhile, keep rolling Sent from my E2104 using Tapatalk