LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ultrasonic Range Finder - SRF02

Hello,

 

I'm fairly new with Labview, and I am doing an experiment where I am to control the height of the ball in two cylinder tubes. The balls are forced into the air using two fans down the bottom (I am powering them through labview using PWM signals - no problems here), and I am to measure the height of the ball with the provided SRF02 sensors.

 

http://www.robot-electronics.co.uk/htm/srf02tech.htm

 

From what I understand they require a 40kHz burst sent to the transmitter pin in order to send out a signal, and then the received signal can be measure on the RX pin. However I don't get anything being received, nor do I have any idea about how to hook it up to labview. I currently have a circuit built on breadboard which is made of two 555 timers to produce my 40kHz burst wave.

 

I am using an NI 6221 module.

 

Thankyou in advance for any assistance,

 

Nick.

0 Kudos
Message 1 of 9
(3,703 Views)

@nicklijic wrote:

 

From what I understand they require a 40kHz burst sent to the transmitter pin in order to send out a signal, and then the received signal can be measure on the RX pin.


 

Why do you believe this?

 

The link you posted says you communicate with the device through a serial port.

 

0 Kudos
Message 2 of 9
(3,700 Views)

Thankyou for a quick reply,

 

Yes, serial communication needs to be used, how do I implement this with labview though? Also, does this mean that RS232 connection with the computer is required, or can I somehow do this through the NI 6221 module?

 

Cheers,

Nick.

0 Kudos
Message 3 of 9
(3,696 Views)

Yes. You need an RS-232 port.  If you don't have that, than you can use a USB-RS-232 convertor.  No you can't use the NI-6221 and I still don't understand why you thought that is what you should use or that you should generate the 40kHz signal.

 

Look in the example finder for NI-VISA serial communication examples.

0 Kudos
Message 4 of 9
(3,694 Views)

I got the information from an assessor, who remembered a project similar to this in the past. Apparently the transducers of the SRF02 work by sending a 40kHz signal to the crystal of the sensor and that's what propagates the sound wave through the air or something..The received sound wave then causes the crystal in the receiver to produce a voltage at the RX pin..

He did all his own circuitry for the transmitter and receiver, so he connected (as I understand) a circuit which generated a 40kHz signal to the TX pin, and a gain/filter circuit to the RX pin. And this signal was then fed input labview using one of the analog inputs of the 6221.

 

Therefore I wasn't aware any serial comm would be needed.

 

Nick.

0 Kudos
Message 5 of 9
(3,692 Views)

Maybe this "assessor" just used the heart of the system and did his own manipulation of it.  But you'll have to get information from him as to how he did it.  But  wouldn't trust the memory of a person who just "remembered a project similar to this."

 

Without that, you'll have to use the methods that the sensor manufacturer provides and read their manual on how to communicate using the serial port.

0 Kudos
Message 6 of 9
(3,690 Views)

You have to measure the time of flight (TOF) of the ultrasound wave (40KH) and use it determine the  height of the balls. If your sensor SRF02 did this mesurement all you have to do is read the range data from the sensor using RS232 or I2C 

0 Kudos
Message 7 of 9
(3,675 Views)

Thankyou both for your responses.

 

Another question (i'm very new with this kind of stuff), how would I use ths serial interface with two sensors? I'm using two sensors (two tubes and balls), but the computer only has the one RS232 input. How would I go about fixing that?

 

Would this mean I have no choice but to use i2c? How does this connect to the computer? Is that something I use the NI PCI 6221 for?

 

Thanks heaps,

 

Nick.

0 Kudos
Message 8 of 9
(3,669 Views)

Get 2 USB-RS-232 adapters.

 

I'm not going to recommend an i2c interface as that would be more complicated to implement, and if you aren't familiar with RS-232, you will really have trouble with i2c.

 

Just forget about using the PCI-6221.

0 Kudos
Message 9 of 9
(3,661 Views)