Image Sensor For Filling Wine Bottles


A wine bottling company in New Zealand got in touch with [Boz] to solve a problem. They needed a way to automatically determine if a wine bottle was filled or not. What he came up with is a very simple yet very effective fill level sensor that can scan thousands of bottles an hour.

There were a few design decisions that went into the construction of this wine bottle sensor. [Boz] could have used a VGA camera sensor, but given the speed of the bottling line (half a meter per second), pushing all those pixels to a computer and doing real-time image analysis would be difficult. [Boz] settled on a much simpler solution – a 1×128 linear CCD analog image sensor. With a PIC microcontroller, this allows the device to check multiple bottles per second, calculate if the bottle is full or not (or overfilled), and send a ‘pass’ or ‘reject’ signal to the rest of the line.

The rest of the assembly is fairly straightforward with an LED backlight providing the illumination for the CCD and a Bluetooth transmitter for checking out the machine’s settings. On the bottling line, the device has 99% accuracy for both red wines in dark bottles and whites in green bottles. You can take a gander of this device in action on a New Zealand bottling line below.


22 thoughts on “Image Sensor For Filling Wine Bottles

  1. Haven’t seen those line sensors in a while. Used them a lot at AT&T.
    But you could do the same thing with a slit and a photo cell, like a solar cell. The voltage output is in direction relation to the fill level. Very similar set up.

    Cool setup though.

    1. The point is that the surface of the liquid casts a shadow on the cell when viewed from the side, so you detect the position of the shadow and the bottles and liquid can be of any color and pass any amount of light.

  2. Good work – I’ve done a lot of work with the packaging industry and this kind of stuff just makes everyone’s day go much more easily.

    The 1% of inaccuracies can be dealt with by diverting the rejects back for manual inspection or via an accumulator to go back into the inspection line and then looking for the ones that keep getting kicked out (genuine underfills) where the good fills will go through a second or third time. The system should be set up to err on the side of Type I errors (false positives – diverting properly filled packages) rather than Type II errors (failing to detect a genuine underfill if at all possible.

  3. Looks good. I’ve always wanted to do a bottle fill thing but sensing the audio frequency it emits when filling up. Unsure how accurate that would be, but seems like a fun project to do one day!

    1. On first look it sounds quite a simple problem, the water/air boundary in wine has a slight foam layer and produces a definite line you can see with the eye and a photo-diode could pick up as a darker band if light is shone through it. However there are a few gocha’s! This band is normally very narrow, different wines/bottles absorb different amounts of light, and also we also need to allow variable tolerances of up to 10cm (about 0.5 inch) either side of the normal fill level to pass, due to bottle movements, different foam levels and normal level tolerances in the bottling process.

      I could not work out how to achieve this using a single photo-detector or a point light source, though I’m sure there are some much more elegant solutions out there waiting to be found. (The audio frequency one suggested by Ned for example is something I would never have thought of)

      1. Ah all right… the method I proposed was a simple laser trip wire and it wouldn’t account for foaming. Another problem would also be deflection of the laser beam from the glass.

        Stray thought left for archiving:
        Maybe an electrode solution could be used? Connect an electrode set to the nozzle filling the bottles. if the electrodes pass enough current through the wine it’s filled. If the current transfer is low, it must be foam. On second thought that would require contact with the wine and possibly creating some sanitary issues.

  4. Well, yes, that’s a problem properly solved.
    But I’m kind of underwhelmed. That’s a pretty standard solution for a pretty standard problem. Nothing wrong with that and Boz has pretty obviously learned his craft, but where’s the point?
    This guy does this for a living!

    There’s not even much documentation. There’s no schematics, no source, just the concept of an industry standard solution to a common problem.

    Also, the problem of the movement speed of the bottles can these days easily be mitigated by flashing LEDs for lighting. If you use IR LEDs, you don’t even annoy anybody who’s around. With a run of the mill industrial camera, 0.1% false recognition is pretty easy to get. If the bottles all have the same shape or differ significantly, calculating the actual amount of liquid also works surprisingly well.

    1. Hi

      Sorry about that, all the schematics, board layouts, design details and source code are on the site and are available free for anyone to use, copy, criticize or whatever, I’m just a bit new to wordpress and my site layout and writing style is not really that good, but if you follow the next link at the bottom of my first page there are 3 other pages with the download links on the last one.

      I posted it at Hack-a-day as it helps the information come up in the search engine when someone else does something similar (my site normally gets about 4 hits a day otherwise), In many ways it’s also a pier review process, having lots of other engineers and hackers find faults or better ways to do something is very helpful to me and anyone thinking of doing something similar.

      I actually don’t get too many paid electronics projects these days and most of my work is boring desktop and SQL programming but it feels good when I get the opportunity to do something like this.

      1. in the spirit of review:

        Pier: noun, a vertical support for a bridge or walkway sunk into soft sediment in order to reach competent ground. Typically used around water.

        Peer: noun, person of comparable skill and experience.

    1. I thought about this too, but weighing them introduces a new set of issues like production speed, mechanical complexity, avoidance of nozzle pressure…heeey What if the nozzle went down on the bottle, lifted it onto a weighing hook and fills it. That would be quite snazzy :3

  5. Good stuff! I’ve used the TSL1401 to make a line camera on an Arduino:

    The TSL1401 is also sensitive to infra-red (IR) light, and can track an IR LED in a sort of one-dimensional location system (or a mobile TSL1401 can track a static IR beacon). However, according to my suppliers, the chip is no longer available. I’m sure there are alternatives, though.

  6. There are already companies dedicated to fill level inspection. I worked for one for years. They use radioactive sources (Americium 240) , x-rays and cameras. The systems do cans at 2600 a minute + or – a ml. The name of the company is filtec.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.