• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

massive help needed

Status
Not open for further replies.

hobby_85

New Member
hey, im in a fix here at the moment, trying to figure out how to solve this problem.

Im attempting to to a build a locationing device using ultrasound and rf signals. its a rather well researched topic, but im having difficulty understanding a certain aspect. heres just a general idea on what im attempting.

im placing pairs of RF&US (ultrasound) receivers on the ceiling beside one another. I was thinking of 9 pairs, in a systematic square like pattern. anyway, the concept is that I'm the object to be tracked, and im carrying a rf&us transmitter. i send out a pulse from each at the same time, and because RF travels much faster than US, the time difference of arrival (TDOA) of the two signals should tell me the time it takes for the US to travel to each receiver on the ceiling.

With the time known, the speed of US known, I can now find the distance from the transmitter to each receiver pair on the ceiling. With 3 or more accurate enough distances, I can now find my location through trilateration.

these are my questions, and i apologize if they are not all micro-controller related.

1) I'm attempting to this using PIC so anyone know of a PIC that can receive the first signal, and has a clock fast enough to measure the time it takes for the second to arrive?

2) If i have 1 PIC for each receiver pair, how on earth can i possibly connect all 9 pics together so i can play with the times. I need the times to eventually get into the computer so i can disregard bad ones and eventually find a location coordinate. I was thinking rs232 at first, but that wont work with 9 pics.

does any know how i can carry on from here. My knowledge on RF is limited so I'm learning as i go along.

Thanks in advance.
 

hobby_85

New Member
PIC's come with 100 pins or more and many analog inputs. Use 1 PIC.

If have no experiance use RF&US at the same time.

3v0
thanks 3v0

I thought of that but came across a number of constraints. even if the pic has multiple inputs, its not going to have the same number of timers. I the the timers to measure the TDOA of the two signals.
 

3v0

Coop Build Coordinator
Forum Supporter
thanks 3v0

I thought of that but came across a number of constraints. even if the pic has multiple inputs, its not going to have the same number of timers. I the the timers to measure the TDOA of the two signals.
You read and record all the data at once. You know how long it is between reads (or use a single timer to time the reads).
It is a very time dependent process but you can do it easier then coordination several PICs.
 

hobby_85

New Member
thanks 3v0,

thats a good point. I just realized something. how about I swap it around. will it make it easier?

I was thinking of putting in the ceiling: RF transmitter and receiver and US transmitter and receiver. these 4 on one board and ill have 5 or 6 of them around the ceiling.

Ill carry around one as well but this will be connected to the laptop using a rs232. each board will have its unique ID. i will 'chirp' each board in the ceiling one at a time to send me a RF & US pulse and ill measure the TDOA from each node one at a time. then I can send the info to the laptop.

you think its easier now?
 

ericgibbs

Well-Known Member
Most Helpful Member
hi hobby,
I would check the wavelength of ultrasound say 40KHz compared to the velocity of light [radio waves].

example:
say velocity of sound is 330m/sec and the freq is 40kHz, this gives a sound wavelength of approx 8.3mm and a time of 25uSec.

Radio waves travel at 300,000,000 m/sec, in 25uSec a radio wave will have travelled 7500mtrs.!

There is no way to use the resolution of a radio wave with a sound wave as a reference.;)
 
Last edited:

hobby_85

New Member
hi hobby,
I would check the wavelength of ultrasound say 40KHz compared to the velocity of light [radio waves].

example:
say velocity of sound is 330m/sec and the freq is 40kHz, this gives a sound wavelength of approx 8.3mm and a time of 25uSec.

Radio waves travel at 300,000,000 m/sec, in 25uSec a radio wave will have travelled 7500mtrs.!

There is no way to use the resolution of a radio wave with a sound wave as a reference.;)
hey eric, first off, thanks for the reply.

you make an interesting point. actually that was going to be my next question. The thing is, however, this is a tried and tested method. If you google in 'ultrasound cricket RF' theres alot of articles using this method. i just wanted to replicate it and see how good it was. so your saying that theres no way the PIC will be able to tell the differnce in the time because its just way too fast? the better pics operate at about 16 Mhz dont they? isnt that fast enough to poll the difference in time?

what do you think?

i attached the link i found this on. part 2.1
http://www.electro-tech-online.com/custompdfs/2009/08/cricket.pdf
 

ericgibbs

Well-Known Member
Most Helpful Member
hi,
I have just quickly scanned your pdf document.

My immediate reaction is sceptical, but I guess I should keep an open mind.:)
I will try and read the document more carefully over the next couple of days.

You mention a clock rate of 16MHz, thats divided by 4 by PIC for its internal clock, so thats 4MHz effective, which is a 250nSec period, radio travels 75mtrs in that time.
 
Last edited:

bobledoux

Member
I've experimented with the rf/us system.

If the moving "robot" and sensors are on a common plane only two sensor sets are required. If the robot is on the floor and the sensors are in the ceiling, a separate plane, then at least three sensors are required. The addition of an extra sensor in either scenario provides for redundant checking.

One issue with ultrasound is reflection. Sound waves allow multiple paths between transmitter and receiver. Bouncing waves can confuse calculations.

A PIC operating at 4mhz has an instruction period of one microsecond. In that period sounds travels about 1/1000th of a foot. High speed controllers would increase that resolution.

Triangulation of results requires math better performed in a microcomputer than in a microcontroller. Consider that your robot is dumb. It transmits an rf and ultrasonic signal at the same time. Receivers about the room share a common clock. One receives the rf signal and a computer counts the clock cycles to hear the ultrasound at each receiver. The computer performs the calculations in floating math. The number of counts between rf and sound will be in the hundreds and thousands.
 

Mr RB

Well-Known Member
I think your basic design is flawed. Instesd of using 9 ultrasound receivers AND a RF pulse, just use 3 ultrasound receivers in a equilateral triangle, or close to it.

Your beacon (you) sends an ultrasound pulse and position can be determined simply from relative time of flight to each receiver. ie if all 3 receive at the same time you are in the middle of the triangle, if one receiver gets the signal first you are closer to that receiver.

Since the time of flight will always be known (ie speed of sound) the relative function can be determined as you are X feet closer to one reciever than another so you can resolve position relatively without needing the RF system to signal the initial event.

Simplify the task itself!
 

hobby_85

New Member
it looks like it did though. thats the first version. they have a second one full with a demo video and everything. ofcourse, it hasnt been made into a proper product, but yeah, i just hope it works to an extent when i try.

just a quick question. i had a look at their parts list, and they are using the atmel 128l AVR chip. heres the link to the datasheet if you need it:
http://www.electro-tech-online.com/custompdfs/2009/08/2467SPDF.pdf

ive never used avr before, so im using the PIC 16f690. datasheet: http://www.electro-tech-online.com/custompdfs/2009/08/41262E.pdf

it should do the trick?
 

bobledoux

Member
My accuracy was good. However, changing objects in the room caused problems with reflections. I was working with a simple system so I didn't want to delve deeply into error correction techniques.

Ultrasonic systems can be very accurate; so accurate that they are used for scoring systems in the Olympics. The Swiss company, Sius Ascor, makes scoring systems for airgun competitions. As many as forty shooting stations are set up side by side, coordinated with a desk top computer. Each competitor has a screen that shows his scores and each shot.

The receiving end consists of a target with an ultrasound sensor on each target corner. An additional sensor points back at the shooter's firing point. When that sensor hears a gun discharge, it knows its time to score. When the pellet, traveling about half the speed of sound, strikes the target, each sensor records the times for sound to travel from the point where the pellet pierced the target. The target can even report when the shooter shoots at the wrong target.

The bullseye for rifle shooting is the size of a pencil point. For pistol shooting its less than half an inch across.

Ultrasonic wave are fairly directional. The signal strength drops rapidly as you move off to the side of the transducer. My sensors were good for a 90 degree wide area.

Give it a try by building a single transmitter and receiver pair.
 

hobby_85

New Member
well i was playing with the ultrasonic sensor today in the labs just to check how it worked. i didnt connect a circuit or anything. just a functions generator sending a sin wave at 40khz to the transmitter and the oscilloscope to the receiver. if i moved more than 1 meter, the reading was just crap. maybe i could have amplified the signal, but still, im worried if the system will work if the sensor was attached to the ceiling.
 

hobby_85

New Member
thanks bobledoux..

just wondering if you used a rs232 to grab the TDOA of signals form the PIC. Is it fast enough? What program did you use to collect the data and get coordinates for position?

thanks bud
 

bobledoux

Member
thanks bobledoux..

just wondering if you used a rs232 to grab the TDOA of signals form the PIC. Is it fast enough? What program did you use to collect the data and get coordinates for position?

thanks bud
Vary the frequency of the signal generator. You may find a frequency at which receiver sensitivity peaks. Also test for off-axis sensitivity.

I used an 8 pin 12F629 for the receiver. It includes a 16 bit timer that I started when it heard the RF signal. The timer stopped when it received the ultrasonic signal. I used the internal clock for my work.

The 16 bit result was passed out to a master PIC using two data lines, one as data and the other as a clock. This synchronous serial transmission proved very reliable.

It might be possible to simplify the process. One of the receivers, the master, would contain the RF receiver. The other receivers might simply be an ultrasonic transducer feeding an amplifier. A simple filter might be needed to ensure the 40khz signal is heard. The output of the amplifier could be sent to the master which counts the cycles from rf transmission until each of the inputs is heard.

One issue with 40Khz signals is that you want the receiver to stop on the first pulse of the signal. The PIC is working at 1 million clock cycles per second. The modulated signal is much slower.
 

hobby_85

New Member
buble, which method did you use.

1) were you the transmitter travelling around the room....with the receivers in the ceiling picking up the signals...or

2) were you the receiver, with the transmitters in the ceiling taking turns to transmit to you.

i was thinking of working in the first way, but i cant get a PC to connect to multiple receivers. i was told not to use a master pic to control the other pics.

i decided to go with the second option because it seems slightly simple. with me being the receiver, (though ill have a rf transmitter), i will be able to coordinate which node in the ceiling sends me info. what do you reckon? Each of the nodes will have a unique ID, and when i ping each node, itll release a RF/US signal. This way, i can control the whole system.

as for the filter, ill just have to amplify the hell out of the US signal i suppose?

also, what kind of program did you use to get the info from the rs232 and calculate and plot the coordinates. i know the method, but i just dont know how to display it.

and out of curiosity, if you remember, what kind of tdoa did you get? i suppose you used this info and with the height of the room know, you drew circles round each receiver and found point of intersection?

cheers.
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top