Lucky Resistor
Menu
  • Home
  • Learn
    • Learn C++
    • Product Photography for Electronics
      • Required Equipment and Software
    • Soldering for Show
  • Projects
  • Libraries
  • Applications
  • Shop
  • About
    • About Me
    • Contact
    • Stay Informed
  •  
Menu

Unexpected Fill Sensor Problems

Posted on 2021-03-312021-03-31 by Lucky Resistor

While testing the sensor panel, I ran into unexpected problems, requiring a small redesign.

  • The Circuit
  • Mode of Operation
  • First Tests
  • Analysing Responses
  • Searching the Problem
  • An Unexpected Cause for the Issues
  • Solutions that did not Work
  • Solutions Currently Investigated
    • Adding a Slot
    • Adjusting the Fill Pattern
  • Conclusion
  • More Posts

First, let me explain the simple working principle of the fill sensor circuit and what I tested so far.

The Circuit

The circuit for the fill sensors is straight forward. There are four input lines and one analogue output line. If a voltage is applied to one of the input lines, the IR LED for one compartment is lighting up.

Mode of Operation

If the compartment is empty, the light reflects from the white lid, back to the IR transistor in the middle. In this case, you read a higher voltage on the output line.

If there is food in the compartment, the light is blocked, and you read a lower voltage.

It is not a foolproof system, because it relies on the lid on top of the compartment and it will probably not work with every kind of food. Therefore, adding a visual feedback on the display will play an important part in the usability of the system.

First Tests

After the first tests, I realised the reflections from the lid were not distinctive enough – most likely because the lid is black. As a quick solution I designed a cap, which is inserted into the lid and provide a flat reflective surface for the sensor.

Each sensor is tested in turn and a number of readings from the ADC are interpolated. The resulting value is then compared to a reference value of a known empty compartment.

Here you can see how the sensor readings for four full compartments look like. After turning the power on for one channel, there is a spike until the phototransistor is stable. This is one point I have to investigate. After 50ms, I measure the voltage multiple times and switch to the next channel.

Analysing Responses

I took readings of the empty compartments and stored them as base values. This is a calibration, which has to be done manually or automatically over time.

Readings of empty compartments.
0:bc67
1:c028
2:bd9a
3:be01

After setting the base value, I am just interested in the difference.

import sensor

closed_ref = [0xbc6c, 0xc01f, 0xbda0, 0xbe01]

for i in range(4):
    value = sensor.read_fill_sensor(i)
    delta = (closed_ref[i] - value) / 100
    print('{:d}:{:04x}/{:0.2f}'.format(i, value, delta))
0:0.21
1:0.20
2:0.26
3:0.23

Next, I filled different compartments and read the delta values.

Compartment 1 Filled:
0:236.75
1:0.19
2:0.25
3:0.18

Compartment 2 Filled:
0:-0.24
1:1.93
2:0.29
3:0.25

Compartment 3 Filled:
0:-0.26
1:0.26
2:102.66
3:0.25

Compartment 4 Filled:
0:-0.21
1:0.38
2:0.11
3:76.44

So, while I get a distinctive difference for three compartments, the fill sensor for the second compartment read almost the same value. If you look at the initial readings, the second sensor has a higher value compared to the other sensors.

Searching the Problem

To eliminate a problem with the LEDs or IR Transistors, I assembled an identical sensor board and used this copy. Here I got exactly the same issue. After I eliminating all other problems, the issue must have beed caused by the turntable platform itself.

I carefully examined the locations of each sensor, but could not see any difference between them. Then, I had to idea to use visual light…

An Unexpected Cause for the Issues

The following photo montage illustrates the problem:

As you can see, the light follows the lines of the printed part. In slot one and four, the sensor is in the “shadow” of the light distribution. Also, the angle on slot three seems to be different enough to cause no problems. The sensor of slot two, in the path of the light distribution. This sensor seems to get light from the LED through the transparent surface of the platform.

Solutions that did not Work

  • Inserting an additional part into the sensor or LED holes to reduce the diameter of the input or output did not work.
  • Changing the distance of the LEDs and sensors from the transparent window did not work.
  • Using tape to reduce the output and/or input angle of the LED and sensor did not work.

It seems, the light is transported along the printed material so well, it outshines any actual input from the chamber.

Solutions Currently Investigated

So, the bad news is, if you already printed the turntable platform and like to use the fill sensor – most likely have to reprint it. My apologies about this! 😔

Adding a Slot

One of the simplest solutions seemed to add a slot between the sensor and LED. This slot has to be filled with something food-safe opaque. I am currently testing epoxy resin and acrylic paint. There are a number of disadvantages:

  • Not everyone is able to precisely fill this slots with epoxy or acrylic paint.
  • The surface isn’t perfectly flat anymore – harder to clean.

Adjusting the Fill Pattern

An even simpler solution could be adjusting the infill angle in each sensor area as shown above. It could have a positive effect on the sensor reading because each field has exactly the same amount of error. There are two disadvantages:

  • Adding custom infill directions requires advanced slicer knowledge. I can provide a slicer profile for the Prusa Slicer, but I have no clue if this is possible with other slicers as well.
  • Because of the different fill orientations, there will be a small gap between all the layers. I don’t know, how well the print will turn out using this technique.

Conclusion

At the moment I am printing the new platforms to compare the results. As soon I can do some tests, I can decide which solution is the best.

I hope you found this update about the tests and fill sensor problems interesting. If you have any questions, missed information, or simply want to provide feedback, feel free to comment below or contact me on Twitter. 😄

More Posts

The Importance of Wall Profiles in 3D Printing

The Importance of Wall Profiles in 3D Printing

In this post, I write about wall profiles in 3D printing, and I will explain why they are essential to creating stable parts with minimal filament use. Also, I will show common mistakes that result ...
Read More
The Hinges and its Secrets for Perfect PETG Print

The Hinges and its Secrets for Perfect PETG Print

A while ago, I published the models for three different strengths of print-in-place hinges. If these are printed with PETG or ASA, they are incredibly strong and durable. This post explains why these objects print ...
Read More
Logic Gates Puzzle 101

Logic Gates Puzzle 101

The message you got does not make any sense. Can you decypher it with the following logic puzzle? The circuit was not optimised for functionality but to create a challenging puzzle and gorgeous artwork. If ...
Read More
Better Bridging with Slicer Guides

Better Bridging with Slicer Guides

I got questions about a particular feature you find if some of my 3D models. In this short text, I will explain why I add it and why you should add features like this too ...
Read More
Build a Sustainable Refillable Active Coal Filter

Build a Sustainable Refillable Active Coal Filter

If you ever used air filters to keep smells, fumes and dust at a low level in your workshop, you for sure came in contact with these expensive throwaway active coal filters. While throwing-away the ...
Read More
The 3D Printed Modular Lantern

The 3D Printed Modular Lantern

I designed a very modular 19th-century-style lantern. You can print it in its simplest form as a simple candlelight to put on a table or a shelf. By printing additional elements, you create a wonderful ...
Read More

Leave a Reply Cancel reply

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

Stay Updated

Join me on Mastodon!

Top Posts & Pages

  • How and Why to use Namespaces
  • Storage Boxes System for 3D Print
  • Use Enum with More Class!
  • Circle Pattern Generator
  • Real Time Counter and Integer Overflow
  • Circle Pattern Generator
  • Logic Gates Puzzles
  • C++ Templates for Embedded Code
  • C++ Templates for Embedded Code (Part 2)
  • Logic Gates Puzzle 101

Latest Posts

  • The Importance of Wall Profiles in 3D Printing2023-02-12
  • The Hinges and its Secrets for Perfect PETG Print2023-02-07
  • Better Bridging with Slicer Guides2023-02-04
  • Stronger 3D Printed Parts with Vertical Perimeter Linking2023-02-02
  • Logic Gates Puzzle 1012023-02-02
  • Candlelight Emulation – Complexity with Layering2023-02-01
  • Three Ways to Integrate LED Light Into the Modular Lantern2023-01-29
  • The 3D Printed Modular Lantern2023-01-17

Categories

  • 3D Printing
  • Build
  • Common
  • Fail
  • Fun
  • Learn
  • Projects
  • Puzzle
  • Recommendations
  • Request for Comments
  • Review
  • Software
Copyright (c)2022 by Lucky Resistor. All rights reserved.
 

Loading Comments...