Fill Level Sensor

This is a sensor for a fast moving wine bottling line which detects the fill level of the wine before the cap is placed on the bottle and produces a reject signal should the level fall outside of a pre-determined range. It is intended to be connected to a PLC and provides two Open Collector (Well Open-Drain technically as we are using 2700 MOSFETS) outputs, one for bottle count and another for Bottle Reject.

A couple of approaches were considered for this task, the first one relies on loose capacitive coupling where a small RF generator sends a signal from the top or neck of the bottle, this signal is coupled to / or grounded and attenuated (depending upon the design) and picked up by a receiver.  The bottle and liquid act as a very small capacitance and if the level of the liquid is low the capacitance increases and the strength of the signal falls off. This approach is in many ways the simplest and best (as it could be used when the bottle cap was on and thus anywhere in the line) but was not used due to the complexity of the mechanical sensor positioning.

The second approach is simply to look through the bottle as it passes and look for the liquid/air barrier which produces a fairly constant and readable signal, the disadvantages are we do need some real time image processing (a lot more simple than it sounds) and we have to accommodate changes in bottle opaqueness and wine varieties which are irrelevant to the capacitance method . This second approach is used in this sensor.

The image sensor used is a TAOS, TSL1401,  128 x 1 pixel chip which is an 8-Pin DIP package, has no configuration and is quite simple to use once you’ve got the hang of it. I have noticed the DIP part has been superseded by a SMD part which is a bit of a shame, however there still seem to be DIP parts out there and on eBay for under US$10.

Parallax systems provided the development sensor and most of this work is derived from the information provided on their site and their very helpful forum. The parallax development boards (of which I have a nice propeller one) were not used and the bottom end PIC32 DIP device is used as the controller for the system. The source code can be built using Microchips freely available MPLABX IDE and XC32 compiler.

Note: Although the software is described as demo, in practice it is free. The restrictions on the optimisations after the 30 day limit expires is unnoticeable in practice and tend to add a few extra KB to the code size. It is the version I use to compile the code on all my projects.

A Bluetooth module was included in the project as the bottling line was in a sealed area and difficult to get access to to debug and set-up, you will need this to debug the system (ie adjust focussing and setting up exposures etc) but is not essential to production. The total BOM for the project should be under US$25

Note, the sensor is not plug and play, there will likely be small changes required for different back-lights and different production lines or bottle types. The general principles will be described on what changes may be required for different circumstances.

Here is the original concept of the sensor.

bottle fill detector plan

The original plan has also moved the controller and image sensor into the same enclosure and same PCB to keep noise low and to simplify building and the RS-485 (Modbus) output wasnt required in the end by the PLC so I used a bluetooth module to read, diagnose, setup and configure the system via a PC Program

The current prototype is now installed on the production line and is working well subject to more tweaking to get the false positive rejection rate to under 0.1%

Next >> Prototypes and Design Thinking