Imagine...
... you have got a high precision scale at your disposal, allowing you to weigh to four digits behind the decimal point (that is to 0.1 mg). But then you have to copy the results manually into a spread sheet. Not once or twice a day, but 100 or 200 times in a row. Almost every week.
As an employee I could say, ok, who cares, I will just do it. I get paid for the work, after all. As a scientist/engeneer I say: this can be done more efficiently, and less prone to error.
When I speak to my boss, she just shrugs her sholders, when I speak to the people at trade fairs, they talk about integrated lab systems, where the lab scale speak via bluetooth to every conceivable other piece of equipment, logging every event - at a cost of a couple of thousand euros. There has to be a way to do this easier and cheaper than that!
Why?
This is the first time I am entering a challenge on this platform, so I want to keep it simple. But why work on a solution for collecting data from a lab scale automatically? Am I not re-inventing the wheel?
Well, in a way, probably I am. But at least that gives me the confidence to say, it can be done. My motivation clearly lies in the fact, that I could speed up some of my work - and thus focus on the more interesing bits, instead. Economically speaking, what I am doing may be seen as a waste of time, if working solutions are on the market, already. The problem with them is, that they are a complete overkill for what I want to do. They would come with loads of features, which I would never need nor use. So why waste a lot of money on them? And then, after all, this is fun!
The challenge
So, what needs to be done? The lab equipment does have an old RS-232 interface in the back, so could I not simply plug it into a computer? Well, unfortunately that is next door, we are not allowed to move it, we are not allowed to run a long cable over there, which would block the lab door. But why not patch it up to a Raspberry Pi, right here in the lab? This could be used, to collect the data, do make it available on the LAN or to push it across the network to other devices - or one could even run the actual speadsheet on it. It doesn't take much space, is potentially portable, and could eventually even be replaced by a Pi Pico for a few bucks. And once I know, how that works, I am sure, my boss will be interested.
Requirements
What I need to build is a device that
- can read data from an RS-232 connection
- can be programmed to analyze the data (have the scales come to a standstill? has the sample been removed? / new sample been put on?)
- send data steram to application (eg local spreadsheet, a database somewhere in the local network etc)
- do all this with a minimum of floorspace and energy requirements
- work fully automatically (without much user intervention), in a stable sashion
- be cost effective.
It is clear that a Raspberry Pi would be the kind of candidate, that could do the job.
Steps
- quickly review RS-232 communication.
- Get manuals for the lab scales. Look at the options and settings for the serial interface.
- test with a legacy PC, featuring an RS-232 connector
- hook up to the Raspberry Pi 4 Model B
- come up with and implement a suitable data collection strategy
- test it! Does it work, is it reliable and does it really save time?
- extra: can I replace the SBC by e.g. the pico?
- all the time, produce some blog posts, when milestones are reached
Let's get this done!