Metal detection using Leds or Laser. - Page 1
Forum section: electronics / projects

author: SirDan
author_rank: Contributor
timestamp: June 29, 2017, 12:19:53 am
content: Hello,Is it possible to scan a piece of lumber ( say 2x4 or 2x6) with a laser or led of some type, and when the light passes over a metal plate attached to the lumber to be able to detect that by a change in the reflection? Presumably there would be different light reflection off of wood than there would be off on a metal surface but that is a guess on my part. I am looking for ideas and off the shelf (digikey) parts suggestions on how to do thatif possibleusing light waves instead of a mechanical feeler or magnetic metal detection circuit.Thank you,Dan

author: jeroen79
author_rank: Frequent Contributor
timestamp: June 29, 2017, 12:40:02 am
content: Can you tell us more about your specific application?Is the wood and/or metal painted or bare? Clean or dirty?What kind of metal do you wish to detect?How large is it?What is the purpose of the metaldeetction? To identify something? To find leftover nails?For optical detection you could use a combination of a LED (illuminator) and phototransistor (detector).You would have to find out the reflective spectrum of the wood and metal, including near IR, and pick a suitable wavelength LED/phototransistor.Or perhaps an RGB sensor with white LED for illumination.

author: SirDan
author_rank: Contributor
timestamp: June 29, 2017, 01:25:00 am
content: Hello,Thank you for the reply.QuoteThe application is building trusses. The wood is new kiln dried bare wood. The metal is some type of galvanized (possibly) plate that holds the trusses together. The size of the plate varies depending on the width of the boards, 2x4, 2x6, etc. Approximately a 3.5 x 6 inch plate in the case of a 2x4. The idea is to scan the lumber as it comes out of a press and to detect whether a fastening plate is missing or not.The LED and photo transistor is a good first lead. I will do some research on those.Thank you,Dan

author: LabSpokane
author_rank: Super Contributor
timestamp: June 29, 2017, 04:51:42 am
content: Reflective detection under *controlled lighting* should be possible with off the shelf solutions from Keyence, Banner and the like.A better solution may be a proximity sensor as it will detect the metal under any lighting conditions. It will just depend on the range you are able to permit the sensor.All of these solutions are off the shelf, industrial sensors that can be wired into your PLC or DCS. There is absolutely no reason to roll your own solution unless you want the fun of doing it.You will find most prox sensors to be much less expensive to implement than optical solutions.

author: LabSpokane
author_rank: Super Contributor
timestamp: June 29, 2017, 05:13:45 am
content: Example of Keyence laser sensor:http://www.keyence.com/products/sensor/photoelectric/lr-z/index.jspThe smarts that are able to be put in sensors these days may make the above a very solid solution with the addition of a means to register the start and end of a truss.Automation Direct is frequently more budget friendly, but decidedly less plush products. That doesn't mean bad, just fewer features with a lower price tag. If you don't have a PLC yet, one of the DL105 units might do nicely.https://www.automationdirect.com/adc/Shopping/Catalog/Sensors_-z-_Encoders

author: Someone
author_rank: Super Contributor
timestamp: June 29, 2017, 05:17:01 am
content: Quote from: LabSpokane on June 29, 2017, 04:51:42 amAll great answers, its possible to exploit the material sensitivity of common capacitive proximity sensors to discriminate between metal and wood (at a known position) so the OPs application should be easy if they can get the sensor close enough. If they can't the optical solutions at those distances are not simple.

author: Kelbit
author_rank: Regular Contributor
timestamp: June 29, 2017, 07:03:06 am
content: Quote from: LabSpokane on June 29, 2017, 04:51:42 amThis should be achievable under uncontrolled conditions with a little signal processing. Use an emitter-detector pair (an IR LED and a photodiode, for example), and modulate the emitter at a known frequency, say a few tens of kHz. Apply a synchronous detector to the signal from the photodiode, and you can essentially remove the effect of ambient light, even under harsh flickering conditions.You can do this in analog using a few opamps and a SPDT analog switch, as per thisADI appnote. I've made a little LTSpice simulation showing this approach:Here's the signal we expect to see, which is constant light that varies due to reflectivity (I used a sinusoid for this because I'm unimaginative):Note that because there wasn't an easy way to vary the gain across the optocoupler in the sim (which is what the reflectivity would be doing in real life), I just stuffed that sinusoid on top of the LED supply. In a real situation, that rail is constant and you're just transmitting a square wave with the LED.Here's what we would expect to see coming out of the photodiode in a noiseless situation:In this case, I've added a whole ton of low-frequency noise to the signal, in order to simulate the effect of random room light:This may look a bit hopeless, but because we've chopped up our signal, we can easily demodulate it using the exact same carrier it was chopped with, lowpass it, and yank the original signal back out:LTSpice file is attached to this message if you want to give it a try. I stuck to models that ship with LTSpice XVII, so you should be able to use it with the default install.To improve this situation further, I would stick to infrared LEDs and get a photodiode with an IR bandpass window, so that you physically remove the influence of visible light.While the analog solution I've detailed above is certainly fun, there's no reason you couldn't do it in DSP instead on a microcontroller. There are also chips you can buy which do the job for you - here's aclassic ADI part.If you wanted to get *really* fancy, you could do something totally nuts like modulate the LED using a direct-sequence spread spectrum chip code and then perform synchronous detection in software to detect it. That would slightly increase your susceptibility to wideband noise (depending on how much you spread) but would also make you essentially immune to light that flickers at your carrier frequency.

author: LabSpokane
author_rank: Super Contributor
timestamp: June 29, 2017, 07:33:19 am
content: Sirdan,Just so we're all on the same page, are you interested in developing the electronics to perform this task for the sake of learning how ... or are you interested in solving this problem commercially on an industrial controls basis?Both are equally legitimate and worthwhile endeavors, but will get very different answers from Dave's interweb oracle.

author: SirDan
author_rank: Contributor
timestamp: June 30, 2017, 12:02:04 am
content: Hello,Thank you for all the replies and LT Spice diagrams!QuoteThis is for a friend that has a commercial truss company. I am not sure this will go past the "can it be done" phase, but now I have gotten some good ideas from the forum and can bread board and test a few of them.The metal plates that hold the trusses together for whatever reason sometimes do not get attached either on the top or bottom side. So when the trusses come out of the press they wanted a way to scan and alarm if a plate was missing. Sometimes the MK1 eyeball fails apparently.Thanks again,Dan

author: LabSpokane
author_rank: Super Contributor
timestamp: June 30, 2017, 03:45:48 am
content: Please realize that it is very unlikely that you can invent a solution that will be better, more adjustable, or less expensive than an existing off the shelf sensor. What is available today is the result of well over three decades of continuous development by very talented engineers. By all means, have fun, but my experience in fielding these devices is that the industrial implementation is plenty of work without having to also perform low-level design. I realize this is blasphemy on an electronics forum, but you have plenty of work ahead of you just buying the sensor and integrating it into an industrial-grade solution.

author: Kelbit
author_rank: Regular Contributor
timestamp: June 30, 2017, 05:36:51 am
content: Quote from: LabSpokane on June 30, 2017, 03:45:48 amIt's not blasphemy at all. If this is a one-off commercial installation where cost and time factor in and (ie: not a hobby project), then an inductive proximity sensor with a transistor output from somebody like Omega fed into a PLC would easily do the trick.(Synchronous detection is still fun, though).

author: Paul Moir
author_rank: Frequent Contributor
timestamp: June 30, 2017, 06:28:22 am
content: Proximity sensors have limited range but otherwise they're ideal. If that won't work and I were going with the laser system, I probably would try to detect the wood rather than the reflection of the metal plate with a beam oblique to the sensor.While I truly love those DL05s, the new Click ones have no-price software and far better features and expandability. Watch out for the gotcha that the basic models loose their variable memory after a few days(! yes in this day and age) while the higher up ones take a battery.It doesn't take much experience in mass manufacture to figure out that humans are very good at many things, but they are very poor for repetitive tasks where an unlikely exception is to be found such as in inspections. It is very hard to see what you don't expect to see.

author: Kalvin
author_rank: Super Contributor
timestamp: June 30, 2017, 02:20:51 pm
content: Webcam and simple optical recognition?

author: MosherIV
author_rank: Super Contributor
timestamp: June 30, 2017, 02:25:53 pm
content: QuoteNow you are into industrial image processing. Very common now a days.Cost is moderate (now as expensive as it use to be).It can do some pretty amazing things. I have been away from industrial image processing for over 18 years now, so I am pretty out of it now.I only know about stuff I see about it on TV now a days.

author: LabSpokane
author_rank: Super Contributor
timestamp: June 30, 2017, 09:16:19 pm
content: Quote from: Kalvin on June 30, 2017, 02:20:51 pmVery possible, particularly with OpenCV, but this goes back to lighting. I haven't worked with these systems in a long time either(I implemented the same application here: vision for missing components), but controlled lighting used to be essential for reliability. You'd think lights would be cheap, but illuminating something that overpowers all competing light sources and evenly light the target is not inexpensive. Today, computer vision has a lot more horsepower behind it so that may be less important, but I doubt that the requirement has gone away altogether.That said, if the inspection process involves evaluating more than one assembly configuration, then image processing is an excellent solution and worth the expense and hassle of contolled lighting.If the process just involves joining two boards in the same configuration, then a fixed prox sensor would be my best, first bet just because of the simplicity and repeatability. I'm not against optical solutions, but they are nearly always fussier to setup and maintain than other means.==================I'll throw out a couple last thoughts about automation and process control theory without knowing much about the application.Just examining production work for failures really isn't the most productive use of one's time and resources. It falls squarely under "inspecting in the quality." All the costs of bad quality remain, with the only benefit of the customer or downstream processes not receiving the defective material.The best, first line of attack in these matters is to closely examine the process that is creating the defect in the first place. Once that issue is addressed, be it human, machine, supplier, etc., THEN one implements the inspection process to validate the correction to the process that was creating the defects. I'll grant you that not every process can be optimized, or perhaps the cost of optimization exceeds budgets or doesn't pass a cost-benefit analysis, but without examining and addressing the process where the defect occurs, one will never achieve the true benefit which is comes in the form of improved profitability. The end goal of manufacturing should not be to merely detect defects and throw money into a dumpster.