Let's Make Robots!

Cheap yet relative accurate signal sensors

Thanks for visiting the nuthouse!
Anyhow, I'm trying to figure out a relatively cheap, yet accurate, distance-sensative sensor.

So, the end question is, does anyone know of a sensor type that can be mounted on an arm,
that moves from 0 degrees to 180, 6 inches apart, to detect my location by something I'm carrying?

-From what I've read, the standard RFID chips don't usually even cover 5 feet.
-I've tried bluetooth, but the sensor strength fluctuates too much for a clear reading,
unless you're right on top of it, and anything in the room pretty much returns around "10".
-I know there are other RFID chips out there, but I don't want to buy one, just to find it's accuracy lacks between a certain key range... so I hope someone may be able to tell me a reasonably priced chip I can carry,
that it can tell from just moving 6" if I'm far left or right.

An IR Sensor/Beacon combo IS a consideration, but I'd like something that could find me through people.
If you know of a cheap yet reliable set for that though, I'd like that recommendation, as well.
Something simple I can just connect to the analog input pins on my Picaxe,
yet is barely noticable to others if I'm wearing it, hopefully.

_____

You can skip this part if you understand, but I included it for a better visual of what I need.
Scenario:
Let's say I have a slow rolling ball with the required transmitter in it.
With a remote control firetruck, with the "ladder" on a servero, holding the sensor, moving left and right, looking for the ball, within a range of 2ft to feet to maybe down a hallway or across the room. What sensor would be the most accurate way to have it find that ball, considering interference of people walking and the like? 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Unfortunately, I never learned trig lol.
Though I'm naturally math-inclined... I just never learned how to do equations.

What you said helps, though I wanted to clarify on something there:
I don't actually need to know the distance, I was just wanting the range more or less, so I could figure out which way to go by moving the sensor left and right 6" apart, to find what direction the beacon is in... unless I use IR, which would just rotate to look.
Also, using the 2 antennas and finding my exact angle... turning that precisely on the fly...
I honestly think it a bit above my current ability level at this point...
but it's definately something to look forward to try in the future, once I'm better!

For the oddbot IR eye, when you said it can't look through a crowd, does that mean less than other IRs for some reason, or are you just saying that other people can get in the way? Because I can have it keep moving forward in the direction of the last place the beacon was seen, rotating to look for it until it finds it... which can help in areas with corners and people, right?
Which also seems to be a little more in my current ability level, to be honest. $30 is a bit steep for me too.

How do you suppose I could get an accurate angle in Linux/Debbian?
That would probably be my much preferred method, if you had experience or concepts there?
All  I could get was a reasing, -6 to -11 from moving close to it in my living room.
So I don't think moving it 6" would make much of a difference to measure distance... >_< 

Is there an actual method to get bluetooth angle? 

The compound eye/wiicam/any other IR source isn't suited to a crowd simply because of people passing between the sensor(s) and beacon.

 

There is an actual method to get an angle for radio signals which in theory would cover bluetooth, in practise not so easily. I presume your used to the idea of an antenna being a pointy stick, well thats all well and good, they are capable of transmitting and receiving a signal in all directions. But you can build a directional antenna, this would be like your TV remote where the transmitter and receiver have to face each other, I don't know how well that would work for a bluetooth module but its a common hack for people to make one for boosting wifi ranges (does work, instead of using 5W transmission power to broadcast 360 degrees your using 5W to broadcast straight ahead of you or whatever). Its also what was used in my WW2 example below, the antenna would only pick up a signal if there was something straight ahead of it transmitting, namely a german ship. Only thing is, I think where bluetooth devices have to be paired, you can't pair them and then start scanning, you would have to move the antenna, try to pair (takes time), then move, scan, then move, scan, repeat until found, would be slow. Regular FM radio or whatever you don't have to pair so its not an issue (you can buy FM modules on sparkfun actually), wifi again it isn't an issue as the expectation is that you don't move your wireless router and once you've sat down somewhere you can leave the antenna alone and use the computer as normal. So I dont think it will be effective for bluetooth. Turning the 2 antenna is easy enough though. Take a 1 metre long stick, glue a servo upright on each end. Stick antennas on the servos.

 

The dagu/oddbot compound eye is a ring of 8 IR sensors. They are analogue sensors, they give a differing voltage dependant on the infrared light level infront of them which normally would be reflected by the 3 IR LED's in the middle of the board, but there is no reason why it couldnt detect a bright IR light source externally. With it being analogue it gives a higher voltage the brighter the light is (I think, it may be inverted, in which case just invert what I say :P ). If your in a room, the IR source is left of where the eye is facing, then the 2 sensors on the left side of the eye will give a much higher signal than the right, so you know to turn the eye left. Same applies for right, up and down (and the diagonals too if you want). Dunno if you play first person shooters, but sometimes when you get shot in some FPS games you get the little red arrow pointing in the rough direction the shot came from, think of it like that, its telling you to aim up and left, thats what we are doing with the compound eye, only its IR light not the back of your brain being plastered across a wall. Eventually all sensors will give a roughly similar light level and you can assume that you are probably facing directly at the target assuming your sensor is nicely squared up.

The wii camera is similar in purpose to the compound eye. The wii sensor bar is not a sensor bar at all, its actually just 2 IR LED's a set distance apart. The wii camera is in the end of the remote, its a small device which sees the IR light and over i2c coughs up the co-ordinates of the brightest IR sources ahead of it (I thought 2 but according to gareth in the shoutbox its 4). If the only source is the beacon, then it will spit out the co-ordinates for the beacon in the cameras image, you can then check if the co-ordinates are centred in the camera's vision or if they are slightly left/right/up/down as with the compound eye. So they do a similar job, only the wiicam uses less pins and is a digital sensor capable of tracking 4 beacons whereas the compound eye does 1, but the wiicam cannot distinguish between the different beacons on its own. You can construct something like the sharp sensor with a wiicam, stick an IR laser facing ahead and use the returned co-ords and some trig again to get the range.

The sharp IR sensors were mentioned in the shoutbox. These are entirely different. They fire a small narrow IR beam at a slight angle, they then have some sort of trickery with multiple sensors or something (no one seems to know, DanM had a good go at guessing though I think) to detect roughly where this beam is within the sensor, does a bit of trig, kicks out an analogue voltage for range. It is not useful for tracking an IR beacon, you'll just confuse the sensor and won't get any meaningful data from it. If you do need a rangefinding sensor near IR sources, use an ultrasound sensor.

Thanks for the response, but I think I got a better idea of the differences now...
For your statements:

"you can't pair them and then start scanning, you would have to move the antenna, try to pair (takes time), then move, scan, then move, scan, repeat until found"

Actually, the HCI command I was mentioning before works when it's paired, to get the signal strength.
However, this only seems to range very minorly for me. 5-6 being right on it, 10-11 being about 4 foot away. This also fluctuates some, when I had my phone on bluetooth, just sitting on my chest and nothing moving.

 

"they give a differing voltage dependant on the infrared light level infront of them which normally would be reflected by the 3 IR LED's in the middle of the board, but there is no reason why it couldnt detect a bright IR light source externally"

Well, comparing to SHARPs, they don't have to be modulated to pick up the wavelength SENT from the IR LED?
My thoughts were that they all send a certain modulated signal, and look for that signal like a SHARP: But are you saying they just emit "an IR frequency", and the sensors don't care WHICH frequency they pick up? That's my concern, it still being like 4 SHARPs, rather than is being like the Wii sensor, that just looks for "an IR frequency", per your "whereas the compound eye does 1" statement?

 

"only its IR light not the back of your brain being plastered across a wall"
ROFL


Lastly, on the note of how SHARPs work, I'm pretty sure most of what you said is correct. Except there's no trigonometry involved in it: it simply sends am IR output, modulating the sensor to the same frequency. It then uses a very accurate timer to see how long it takes the IR to reflect off the forward surface. I believe it's not actually aimed at an angle, but rather the the IR sent forward like a laserpointer, through a lens to keep it mostly focused, but allow it to spread more upon reflection on an object, to which the sensor in the SHARP detects the delay between the laser out and return time.

It then uses a very accurate timer to see how long it takes the IR to reflect off the forward surface. I believe it's not actually aimed at an angle, but rather the the IR sent forward like a laserpointer, through a lens to keep it mostly focused, but allow it to spread more upon reflection on an object, to which the sensor in the SHARP detects the delay between the laser out and return time.

Time of flight range finders are in a different leage from Sharp distance sensors. The Sharp sensors just do the trig for you and return an analog voltage of the distance. 

This reply box doesn't let me see the earlier post but the post you were attempting to correct was pretty close to how they work. (Though I'm inclined to agree the IR is aimed straight ahead.) The parallax between IR source and sensor cause the reflected light to fall on a different portion of the sensor based on the distance of the object being detected. You can do something similar with a Wii camera and laser (or focused IR). With the Wii camera you need to do the trig yourself.

Trig as taught in high school and college is kind of hard IMO. But learning a few trig priciples is easy. Just look up what sine, cosine, tangent and their inverse functions do. It's imensely useful in robotics. A function called ATAN2 is very useful for finding angles when you know the coordinates of a location.

I've seen projects using multiple ultrasound sensors do what you're trying to do. I don't have the links handy though I'm pretty sure I've seen one on LMR.

The ultrasound concept is a good one.

The same 'beacon' approach used with the IR sensors can be applied by building a wide-angle ultrasound emitter and a pair of ultrasonic sensors. The ultrasonic emitter on the beacon simply spits out end endless stream of pulses which are detected by the pair of sensors. The sensors can be made more or less directional with some shielding, but you can also apply the time-of-flight difference to determine the direction of the source.

Main advantage over IR is that the ultrasound can travel around obstacles. As long as you can filter out any weaker reflections that are bouncing around, you should still be able to detect some ultrasound coming from the beacon even if it's obscured. If the beacon is around a corner for example, the sensors may indicate that the strongest reading is actually coming from a reflection at the corner, but if the robot travels towards the apparent source it should eventually get back to a position where it was line of sight to the beacon.

"you can also apply the time-of-flight difference to determine the direction of the source."
I'm sorry, but I'm not really understanding this termonology... how can I detect the direction?

And what would be a budget example of what you're talking about be,
if you wouldn't mind posting a resource or link to a well-priced one? 

This is easier to explain with an example, so let's imagine you have two ultrasonic sensors that are 6" (152.4mm) apart, one on the left of the robot and one on the right. Let's also say that the sensors are covered at the back and will only detect ultrasound coming from roughly in front of them.

If the left and right sensor both 'hear' a pulse from the beacon at exactly the same time, the beacon must be straight ahead.

If the left sensor hears the pulse first, and then the right sensor hears the pulse shortly afterwards, the beacon must be closer to the left side than the right.

Knowing the speed of sound in air, we can work back to the angle (sorry, trig is the easiest way):

Speed of sound in dry air, room temperature ~= 343.2m/s (metres per second)
Distance between sensors   = 6" = 152.4mm
Maximum time difference between hearing pulses   = 152.4mm / 343.2m/s = 444us (microseconds)

If the left sensor hears the pulse 444us before the right sensor, the beacon is directly left.
If the right sensor hears the pulse 444us before the left sensor, the beacon is directly right.

If the left sensor hears the pulse 250us before the right sensor, the beacon is (90° - arccos(250us/444us)) = 34° left of center.
If the right sensor hears the pulse 100us before the left sensor, the beacon is (90° - arccos(100us/444us)) = 13° right of center.

The equation used above can be written as:
θ = 
(90° - arccos(ΔT/H))
...where '
θ' is the angle you want to find, 'ΔT' is the time difference between hearing the pulse on one sensor vs the other, and 'H' is the maximum time difference that was calculated earlier.
The trig part: 'arccos' is also called 'inverse cos' or 'inverse cosine' and also can be written as 'cos‾¹'. It's the trig function we're using to transform the time values into angle values.

This method assumes that the beacon is somewhat far away... any closer than a few feet and it will become less accurate, but it'll still point you in the right direction.

The first place that comes to mind for buying sensor parts is: http://futurlec.com/Ultrasonic_Sensors.shtml, but there are plenty of other choices out there. You might be better off buying some pre-made modules and splitting them up.

Does this robot need to know the distance to the target, or is the direction really the important part so the robot can follow?

This thread/tutorial by DanM and the earlier one OddBot started associated with/linked to in it explain how sharp IR sensors actually work (and includes some great macro photography of a disassembled unit.)
http://letsmakerobots.com/node/35068
I think through subsequent thread links you also get to OddBot's "Make your own compound eye" post (it was kind of open hardware at that point, though its probably just as cheap and easier to buy a Dagu ready made via the slow boat.)

Best I can think of is what we did in WW2 along the coast of britain to locate german naval fleets. Take 2 radio receivers with DIRECTIONAL antennas, ie they will only receive the signal straight ahead. Turn them until they both pick up a signal. The 2 receivers are in a known location, you now know the angles to the target, bit of trigonometry, you know where the target is. I've actually stood in one of the old nests used for those receivers.

You could attempt 1 receiver but at short range the signal strength will perhaps go between 100 and 90% or something and fluctuate too much to be of use so 1 reciever won't nicely rangefind for you.

 

As for 1 thing you hold on you, IR would get an angle. Bluetooth feasibly could do the same. Neither one will give an accurate range if thats required. If you were to use IR, I would recommend looking at oddbots IR compound eye as that could easily track a moving beacon (just not through a crowd).