In early 2023 I was working on a plastic recycling project with my company during which I wanted to explore the options how to sort plastic to the respective plastic grades. Different plastics have different physical properties and melting points and that's why rigorous sorting is the most effective way to maintain the quality of the recycled plastic.
Unfortunately, it sounds way more easy to do, than it is in reality. On the first sight plastic seems to be plastic, as if there would be a single material called plastic. In fact there are hundreds of different plastic grades which include homopolymers, co-polymers, composites etc. So, how would you ever know what sort of plastic it is you're holding in your hand?
The simple answer is: you don't.
Ok, with some practice it is possible to identify some plastic by their appearance, haptics, smell, bending and burning characteristics, but in the bigger picture you'll need a method to measure the material's physical properties somehow. The common method to do this is NIR spectroscopy.
The Plastic Scanner Project has set a goal to develop a handheld NIR spectrometer which consists of the sensor part and the computing part. The latter one runs on an attached SBC which records the sensor readings in a database and analyzes them with a TensorFlow based software. As output you'll be given the plastic grade and it's probability, either on the desktop software or on a handheld's display. The use together with a smartphone is the logical next step.
Anyhow, I started the project by ordering the PCB's and sourcing the components. As the pandemic induced disturbances on the global semiconductor market were still on-going, it proved next to impossible to get the needed Texas Instrument components. The lead times were beyond of 52 weeks. So, I placed a bet and ordered cloned IC's on AliExpress and crossed my fingers.
Even though this was a development board with a relaxed component layout it was still challenging to solder the small surface mounted components. Soldering in a reflow oven would have been easier, but I wanted to get some training with my new hot air soldering station, so I went with that. It meant also I had the possibility to solder by functional groups and test them before continuing. There were some delicate components like the ADC and the expensive IR led's of which I toasted a few pieces. At the end I had a ready sensor board shield which was attached to an Arduino Uno. No magic smoke ;D
The plotter software connects to the Arduino Uno and after triggering the scan signal the board lits up each of the 8 IR led's at a time for a brief moment and receives the light reflection via the centrally placed wideband NIR diode. On the other hand each LED has only a narrow bandwidth and as a result we get 8 samples distributed on NIR spectrum of 850-1650 nm.
Not much, but it should be enough to differentiate the plastic grades with the help of some machine learning.
After initial testing I found out that the sensor board was not giving me consistent readings. Occasionally it worked as intended, but most of the time it didn't.
After confirming the software worked as planned, I needed shift focus on the sensor board for debugging.
I found some errors in the schematics and the LED current limiting resistor values. Some of them were simply limiting too much current with the result that the LED's didn't really shine at all. Which was difficult to confirm visually, because you can't see infrared light and also I didn't have a camera capable of picking up the longer end of the spectrum.
But this wasn't the source of the bug. At the end, it turned out to be a cold solder spot at one of the IC legs leading it to sporadically disconnect. I made a second board and paid closer attention to the soldering and this time it worked perfectly.