Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!


mz webbanner c askmake Ask MAKE: Simple proximity sensors




Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to
[email protected]
or drop us a line on
Twitter. We can’t wait to tackle your conundrums!

Aaron writes in with a question about short-range sensors:

My question is really more of a search for direction. I have exhausted
several approaches and could use advice. The goal is to create several
simple, cheap sensors that have only the ability to sense that there
is another one of them next to eachother. I need a range around 5
feet. It would need to have an id. For instance sensor 1 could see
sensor 2 and 3 within 5 feet but no other and sensor 2 could see
sensor 1 and 4, and so on.

I have considered rfid most intensly, but I find noise and cost go up
at this range and I have had issues with consistancy. Laser requires
line of site not be interrupted, blue tooth has too great a range, and
so on.

Interesting question! I’ve actually been thinking about this for a project as well. There are three types of signal that I can imagine using for this application: RF, audio, and optical. Because you mention that maintaining line-of-sight is an issue, let’s stick to a radio based solution. To make things simple, lets assume that each node is identical. Then, we need a protocol for each node to take turns transmitting their IDs to the other nodes. We also need to figure out how far away the transmitting node is, which we can estimate using the received signal strength if we make each node transmit at the same power. This is possible because radio waves follow the inverse square law.

Now, there are many different ways to build a radio system to do this, however a nice off-the-shelf part that will work is the xBee. Each node would then consist of a microcontroller (whichever you fancy) and an xBee radio. Program them so that they transmit their own ID at random intervals, and spend the rest of the time listening for other radio’s IDs. Measure the signal strength of the received ID using the RSSI indicator, and if it is above a certain value (determine experimentally), then add the ID and time of reception to a list. If the same ID is received again, update that entry with the latest time a signal was received. Then, go through the list periodically, and remove any ID that hasn’t been heard from in a while (longer than the longest time between random transmissions). This way, you will always have a list of devices that are nearby. By having them transmit their IDs at random intervals, you will minimize the chance that two transmit at the same time without having to deal with synchronization issues.

That’s the easiest way I can think of to do this, however it is still pretty complex. Have a better solution? Sound off in the comments!


Related
blog comments powered by Disqus
Follow

Get every new post delivered to your Inbox.

Join 26,143 other followers