-
How to hack a weighing scale.
Posted by
Nexo
on 28 Feb, 2017 07:44
-
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!
-
#1 Reply
Posted by
CaptCrash
on 28 Feb, 2017 09:20
-
-
#2 Reply
Posted by
Nexo
on 28 Feb, 2017 09:32
-
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?
-
#3 Reply
Posted by
wraper
on 28 Feb, 2017 09:36
-
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?
That 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.
-
#4 Reply
Posted by
bktemp
on 28 Feb, 2017 09:44
-
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.
-
#5 Reply
Posted by
CaptCrash
on 28 Feb, 2017 09:45
-
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?
That 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.
100% 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
-
-
-
-
SCNR :-Þ
-
#8 Reply
Posted by
Brumby
on 28 Feb, 2017 10:37
-
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.
-
#9 Reply
Posted by
ebastler
on 28 Feb, 2017 13:27
-
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?
-
-
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.
-
#11 Reply
Posted by
james_s
on 28 Feb, 2017 18:01
-
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.
-
#12 Reply
Posted by
Nexo
on 01 Mar, 2017 02:57
-
Brumby, do you think you could share your notes and code?
I would be really helpful!
-
#13 Reply
Posted by
Nexo
on 01 Mar, 2017 03:07
-
-
#14 Reply
Posted by
Brumby
on 01 Mar, 2017 03:50
-
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.
-
#15 Reply
Posted by
Nexo
on 02 Mar, 2017 04:45
-
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!
-
#16 Reply
Posted by
Brumby
on 02 Mar, 2017 04:57
-
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?
Try 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.
xxxx commands.
-
#17 Reply
Posted by
Harvs
on 02 Mar, 2017 05:04
-
-
#18 Reply
Posted by
Nexo
on 02 Mar, 2017 06:37
-
-
#19 Reply
Posted by
Nexo
on 03 Mar, 2017 08:48
-
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.
-
#20 Reply
Posted by
Brumby
on 03 Mar, 2017 14:36
-
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.
-
#21 Reply
Posted by
Nexo
on 04 Mar, 2017 06:16
-
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!
-
#22 Reply
Posted by
ebastler
on 04 Mar, 2017 08:28
-
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!
I 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?
-
#23 Reply
Posted by
Brumby
on 04 Mar, 2017 13:40
-
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!
I 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.
Yes. Data transfer rate is not an issue.
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.
Absolutely 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.
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?
This 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.....
-
#24 Reply
Posted by
Nexo
on 04 Mar, 2017 17:33
-
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!
I 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?
Incredible info, again, thank you very much!
I´ll start reading all about the concepts you mentioned.
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!
I 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.
Yes. Data transfer rate is not an issue.
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.
Absolutely 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.
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?
This 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.....
You should do it! That way I could learn a lot about it
-
#25 Reply
Posted by
Brumby
on 05 Mar, 2017 01:23
-
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.
-
#26 Reply
Posted by
Nexo
on 05 Mar, 2017 05:01
-
I will mate! Thanks in advance!
-
#27 Reply
Posted by
bson
on 05 Mar, 2017 21:24
-
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 like
https://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.)
-
#28 Reply
Posted by
Smokey
on 05 Mar, 2017 23:12
-
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?
-
#29 Reply
Posted by
Nexo
on 06 Mar, 2017 13:59
-
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.
-
#30 Reply
Posted by
cverburgh
on 06 Mar, 2017 18:06
-
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 at
https://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.
-
#31 Reply
Posted by
Smokey
on 06 Mar, 2017 18:37
-
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?
-
#32 Reply
Posted by
ebastler
on 06 Mar, 2017 19:53
-
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?
Maybe that is because you are the only one here who is a little paranoid in this respect? ;-)
-
#33 Reply
Posted by
Nexo
on 07 Mar, 2017 03:06
-
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?
I'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 :S
Dude, if you have nothing to contribute just keep rolling. Is sad to just comment things that aren't helpful.
-
#34 Reply
Posted by
Smokey
on 07 Mar, 2017 07:44
-
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!
-
#35 Reply
Posted by
Nexo
on 07 Mar, 2017 18:40
-
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!
In 3 years, when I study that software I'll come back and read your comment. Meanwhile, keep rolling [emoji4]
Sent from my E2104 using Tapatalk