20 x 20 x 10 ft max is what I am looking at. I am considering starting with 300bps.
20 x 20 x 10 ft max is what I am looking at. I am considering starting with 300bps.
Then I would do what I suggested. Use an AND gate to combine your 40Khz (or whatever freq) and SEROUT2 (idle low).
On the receive end, use a rail-rail output op-amp to filter and amplify the signal to past the clipping level. Use a 12F675
sitting in a tight loop that does nothing else but watches for an input pin to be high for half the period and then low for half the period of the ultrasonic signal.
It then sets an output pin high and goes back to sampling. When it fails the test, it sets the output bit low. Use SERIN2 to decode the output of the 12F675.
Charles Linquist
Hello Nick,
I had good success at up to 50 metres in fresh water with frequency shift keying. My transducers were smoke alarm piezo benders which were air backed and had a resonant frequency around 3000 Hz. Frequency separation was about 200 Hz. The transmitter driver was a MAX232 which gave +/- 8.5 volts of drive from a 5 volt rail. A PIC16F877 generated the two tones. A 4046 phase locked loop detected the two tones. Data rates were up to about 25 bps but typically under 5 bps depending on echoes, background noise, etc. Real world lakes gave much better range than hard walled pools. Hard wall swimming pools have standing waves and give strong signal or zero signal as the sensor is moved only a few hundred millimetres. Sea water has about 10 times the attenuation of fresh water. This is due to magnesium sulphate and boron salts. Add epsom salts and borax to a freshwater tank to simulate sea water. The sodium chloride appears to hardly matter and just causes corrosion.
HTH
BrianT
Last edited by BrianT; - 23rd September 2011 at 22:49. Reason: factual correction
That is reallly neat! Did you have to protect the smoke alarm peizos with any coating?
I have used 4046's to multiply up the frequency from a shaft encoder so that I could get good more resolution. I always found them a bit difficult to work with.
I just wrote a little routine for a PIC that does a good job of detecting frequecies around 3Khz. It can be changed for other freqs. It should be able to detect the change in 2 cycles or less.
It is running in a 40Mhz PIC, so the values would have to be changed if you ran it slower.
Code:define PULSIN_MAX 400 Top: pulsin PORTD.1,0,LowVal Pulsin PortD.1,1,HighVal Period = LowVal+HighVal ; just in case the duty cycle isn't 50% ; period in uSec Select case Period Case is > 350 Hserout [CR,LF,"Too Low"] case is > 310 hserout[CR,LF,"Just Right"] case 0 hserout[CR,LF,"No Signal"] case else hserout [CR,LF,"Too High"] end select goto top
Charles Linquist
Bookmarks