In early 2023 I was working on a plastic recycling project during which I wanted to explore the options on how to sort plastic to the respective plastic types. 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 recycled plastic.
Unfortunately, it sounds much easier to do, than it is in reality. On the first sight plastic seems to be plastic, as if there would be only a single material called plastic. In fact there are hundreds of different plastic types which include homopolymers, co-polymers, composites etc. So, how would you ever be sure what type of plastic you're holding in your hands?
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. The common method to do this is by 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 type and it's probability, either on the desktop software interface or on the handheld's display. Binding the sensor to a smartphone via Bluetooth could be the 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 chips on AliExpress and crossed my fingers.
PCB under the microscope
PCB under the microscope
Testing circuit by circuit
Testing circuit by circuit
Finished assembly
Finished assembly
Internals of the scanner
Internals of the scanner
Assembled scanner
Assembled scanner
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. 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 fried a few units. At the end I had a ready sensor board shield which was attached to an Arduino Uno. No magic smoke ;D

Plastic Scanner plotting software

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 types 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. It was difficult to confirm visually, because you can't see infrared light and I didn't have a camera capable of picking up the longer end of the wavelength 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 soldering and this time it worked perfectly.

Debugging sensor board

Scanning different plastic specimens

Back to Top