Detecting objects with Arduino [closed]
Want to improve this question? Update 开发者_如何学Pythonthe question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this questionIs there any way to detect different types of objects/surfaces with an Arduino board + some sensor?
An example is maybe the difference between wood / metal, or say a bot driving outside could detect if it's on grass, sand or tarmac.
Edit: For the benefit of others wanting to do this, here is a link to the electronics site one, https://electronics.stackexchange.com/questions/9751/detecting-the-type-of-ground/9771.
I don't know of any sensor that, alone, is capable of detecting the types of material you mention. (Hence my comment suggesting you ask on the robotics and electronics SE site.)
That said, you should be able to detect conductive/non-conductive (metal/wood) by use of a simple conductivity sensor, something that completes a circuit when touching metal but does not when touching an insulator like wood. A better option may be a capacitive sensor like those used in stud-finder devices.
To detect surface types, like vegetation, sand, or pavement, you will likely have to employ some creative thinking and a combination of sensors.
Here is an example to detect, to a small degree, the relative hardness of the terrain: if this device were mounted on a mobile vehicle of some sort, one such sensor might be a potentiometer attached to a spring-loaded armature of some sort, which drags the ground. The idea would be that the armature attempts to align straight down, perpendicular to the vehicle travel, by spring tension. Grass, sand, and pavement would cause the armature to deflect differing amounts based on the ability for the spring to push against the surface.
To bring this more into a programming realm, you would have to write an algorithm to compute the angles of deflection (by measuring the resistance on the potentiometer) and determine the type of surface. The armature would not create a static value (it's going to be moving all the time), so you would have to compute averages and probably factor in distance traveled.
Consider that these surfaces have other properties which may be of value in detection: light reflectance, moisture level, acoustic echo profile... I leave it as an exercise to you to design a sensor array that can accurately identify surfaces and materials to the degree of precision that you desire. Ultimately, you'll have to rely on sensors (and some programming to juggle the data) that are attuned to specific properties.
Think like a human.
We use all our senses to arrive at an answer (and it is sometimes the wrong answer). Some substances can be apparently solid or liquid depending on other ambient effects, e.g. if you hit water at 600mph, it would seem to be as hard as steel.
So, you'd need to collate the input from various sensors. There are hardness sensors and stress gauges that you can use to measure surface hardness. Some sort of deflection gauge as suggested by JYelton to discover the depth of a surface (grass, deep-pile carpet). Sensing the colour and reflectivity, combined with other senses will enable other decisions.
When you're thinking like this, ask why your device would need to know certain things and how it will react to them. Then you'll be better able to taylor the sensing to fit those needs.
精彩评论