| View previous topic :: View next topic |
| Author |
Message |
BrunoG Site Admin
Joined: 22 Nov 2005 Posts: 636
|
|
| Back to top |
|
Ford
Joined: 15 Nov 2006 Posts: 6
|
Posted: Wed Nov 15, 2006 3:40 am Post subject: Sonar |
|
|
Hello,
I have build this sonar. Works well, and I tried some "improvements".
First, driving UST by transistor. I noticed, that the result is almost the same, if you drive it directly by 2 IO pins (without transistor nor any other components). Simply connect the UST between 2 pins and drive with 10-01 sequence. This applies full Vcc to UST, so the peak-to-peak voltage is about 10 Volts.
With only these 4 components (PIC, UST, USR, resistor) was its range 200 cm.
Second, I have tried to "throw out" UST buzzer and use only one USR as transductor for both beep & receive (there is only slight difference between UST/USR in directional diagram, but electrically are both the same).
I connect USR to pin+GND. In first step, pin was set as digital output and 300us beep of 40kHz transmitted. Then was pin switched to analog input and measured by A/D converter.
Unluckily, the range of this design was only 5 cm. The main reason was, imho, that the voltage still remains on USR short time after transmit (it's capacitor by principle), interfering with input signal.
Have anybody any advice to overcome this?
Ford |
|
| Back to top |
|
BrunoG Site Admin
Joined: 22 Nov 2005 Posts: 636
|
Posted: Wed Nov 15, 2006 10:11 am Post subject: |
|
|
Hi Ford, thanks for reporting your tests !
| Quote: | First, driving UST by transistor. I noticed, that the result is almost the same, if you drive it directly by 2 IO pins (without transistor nor any other components). Simply connect the UST between 2 pins and drive with 10-01 sequence. This applies full Vcc to UST, so the peak-to-peak voltage is about 10 Volts.
With only these 4 components (PIC, UST, USR, resistor) was its range 200 cm. |
Yes, but reverse voltage (there is a coil in the circuit) could damage the PIC outputs, did you measure the voltage between the coil pins
With a transistor, this voltage is around 20 volts peak to peak (at 40 Khz), it should be greater with differential driving.
For PIC safety, did you try to remove the coil ? do you get the same range ?
| Quote: | Second, I have tried to "throw out" UST buzzer and use only one USR as transductor for both beep & receive (there is only slight difference between UST/USR in directional diagram, but electrically are both the same).
I connect USR to pin+GND. In first step, pin was set as digital output and 300us beep of 40kHz transmitted. Then was pin switched to analog input and measured by A/D converter.
Unluckily, the range of this design was only 5 cm. The main reason was, imho, that the voltage still remains on USR short time after transmit (it's capacitor by principle), interfering with input signal.
Have anybody any advice to overcome this? |
Yes, the circuit coil + transducer is a resonnator (an inductance and a capacitor), and the A/D converter will measure this parasitic voltage.
Using differential driving as you suggest above, and removing the coil may work, just add a short delay between transmit & receive to avoid mechanical echoes.
Thanks ! _________________ BrunoG, Administrator |
|
| Back to top |
|
Ford
Joined: 15 Nov 2006 Posts: 6
|
Posted: Wed Nov 15, 2006 5:17 pm Post subject: |
|
|
> but reverse voltage could damage the PIC outputs
> (there is a coil in the circuit)
I wrote anything about coil in my circuit. I don't use coil, only 4 parts
Anyway, my sonar range is up to 200 cm, try it yourself.
Yes, differential driving results in lower (10 V) peak2peak voltage, but compared to transistor driving, sonar range was the same (200 cm).
> inductance and a capacitor... and the A/D converter will measure this parasitic voltage
There was parasitic voltage on USR itself (without coil), the USR has its own response close to 40kHz.
Of course i added short delay between transmit & receive, but it seemed to be not enough.
The voltage on USR drops too slow; echo from outside is faster . The parallel resistor (for ADC impedance adjust) doesn't help much in UST "discharge".
Regardless of this all, I tried WONDERFUL standing-wave effect . I didn't measure distance in this test, only beep continuously on UST and receiving echo with USR.
What happened? The control LED (indicating every echo) was flickering everytime i move with aparat.
Why? The emitted ultrasound wave reflected on wall, flying back, superpositing on new wave incomming from UST. This results in standing waves, with space-fixed "poles" and "zeros" (maximum / minimum of amplitude).
That's why the LED ever light with reach the MAX, snuff on every MIN.
Distance between two consecutive MAX was something about 4 mm (perfectly agreed with ultrasound wave length).
This effect may be used in "motion detector". Every change of MAX/MIN means motion of apparat against neigborhood (4 mm or more).
Electrical circuit for motion detector is the same as for distance meter (change is only in PIC program).
Ford |
|
| Back to top |
|
BrunoG Site Admin
Joined: 22 Nov 2005 Posts: 636
|
Posted: Wed Nov 15, 2006 6:29 pm Post subject: |
|
|
| Quote: | I wrote anything about coil in my circuit. I don't use coil, only 4 parts
Anyway, my sonar range is up to 200 cm, try it yourself.
Yes, differential driving results in lower (10 V) peak2peak voltage, but compared to transistor driving, sonar range was the same (200 cm). |
Yes I will try, do you use muRata cell too ?
| Quote: | There was parasitic voltage on USR itself (without coil), the USR has its own response close to 40kHz.
Of course i added short delay between transmit & receive, but it seemed to be not enough.
The voltage on USR drops too slow; echo from outside is faster . The parallel resistor (for ADC impedance adjust) doesn't help much in UST "discharge". |
You can try to short the ultra sonic transmitter by dropping its pins to same potential, this will discharge its capacitor
| Quote: | Regardless of this all, I tried WONDERFUL standing-wave effect . I didn't measure distance in this test, only beep continuously on UST and receiving echo with USR.
What happened? The control LED (indicating every echo) was flickering everytime i move with aparat.
Why? The emitted ultrasound wave reflected on wall, flying back, superpositing on new wave incomming from UST. This results in standing waves, with space-fixed "poles" and "zeros" (maximum / minimum of amplitude).
That's why the LED ever light with reach the MAX, snuff on every MIN.
Distance between two consecutive MAX was something about 4 mm (perfectly agreed with ultrasound wave length).
This effect may be used in "motion detector". Every change of MAX/MIN means motion of apparat against neigborhood (4 mm or more).
Electrical circuit for motion detector is the same as for distance meter (change is only in PIC program). |
You can try to measure motion speed too
I hope you have no pet at home
Thanks ! _________________ BrunoG, Administrator |
|
| Back to top |
|
Ford
Joined: 15 Nov 2006 Posts: 6
|
Posted: Wed Nov 15, 2006 8:52 pm Post subject: |
|
|
> Yes I will try, do you use muRata cell too ?
Not sure exact type. You can see it HERE:
http://www.gme.cz/dokumentace/643-004/pctdetail.643-004.1.jpg
> You can try to short the ultra sonic transmitter
Yes, I've done this before.
Because of the alone USR must be connected between ADC input and ground, driving it is done now only by Vcc ON/OFF. The last PWM state of beep was 0, kept as 0 for few next microseconds. This connects both pins together, but still looks like not enough. Range measured 5 cm anyway.
I keep two cells version, this works fine all the time.
> You can try to measure motion speed too
Good idea . I will try it.
> I hope you have no pet at home.
I'm sure AFTER my ultrasound tests here will be no pets any more .
(if yes, they might be fully deaf)
Ford |
|
| Back to top |
|
ceyranci
Joined: 14 Dec 2006 Posts: 3
|
Posted: Thu Dec 14, 2006 6:54 pm Post subject: |
|
|
hi everybody,i am new in electronics and new in this forum i want to work on this ultrasonic project,but i need your backup i think.and i also want to ask some questions to you:
1-first of all,can i use 16F877 in this project?is there a certain difference between 16F877 and 16F877A?
2-for ultrasonic receiver and transmitter,do you advice any brands?or is there any model that i have to buy?
thank you for your help,i ama waiting for your answers  |
|
| Back to top |
|
BrunoG Site Admin
Joined: 22 Nov 2005 Posts: 636
|
Posted: Thu Dec 14, 2006 9:21 pm Post subject: |
|
|
Hi ceyranci, welcome !
1/ Yes there are differences between PIC16F877 and 877A, mainly comparator module added on 877A. Since comparator module is not used in this example, either 877 or 877A will do the job
2/ Any matched ultrasonic transmitter and receiver should work, just take care they work on the same frequency _________________ BrunoG, Administrator |
|
| Back to top |
|
ceyranci
Joined: 14 Dec 2006 Posts: 3
|
Posted: Thu Dec 14, 2006 9:49 pm Post subject: |
|
|
thank you very much BrunoG!
i will work on this circuit,thank you again..
seee you later... |
|
| Back to top |
|
ceyranci
Joined: 14 Dec 2006 Posts: 3
|
Posted: Fri Dec 15, 2006 4:48 pm Post subject: |
|
|
dear brunog,
i am working on a project which consists of a robot or a car using ultrasonic module.when i was looking for an ultrasonic receiver and transmitter,i saw your example,and i want to use it in my project.
your circuit is very simple and i think it is easy to build.but i am afraid of using the LCD part; because of the connections of it.i think controlling the LCD is a difficult theme,and i am not sure that i can do it. If you have a full circuit diagram of your project,which consists of the connections of the LCD or full connections of PIC16F877, can you send it to me?
on the other hand,i am trying to drive 2 dc motors with 16F877. The car will move forever, if anything will be appear in front of it, it will turn right/left. the name of project is "ultrasonic controlled car".
i have build the circuit with L298N,and connectted all of the parts on the diagram. but it doesn't work. can you help me about the circuit?
thank you very much for your helps,
your friend,
ceyranci
 |
|
| Back to top |
|
BrunoG Site Admin
Joined: 22 Nov 2005 Posts: 636
|
Posted: Sun Dec 17, 2006 5:49 pm Post subject: |
|
|
Hi ceyranci ,
the full circuit diagram of LCD connection is in the mikroC manual :
http://www.mikroe.com/pdf/mikroc/mikroc_manual.pdf
see "LCD library (4 bits)"
and adapt software to your hardware with these lines :
| Code: | /*
* LCD PORT
* EasyPic2, EasyPic3 : PORTB
* EaspyPic4 : PORTD
*/
#define LCDPORT PORTD
#define LCDTRIS TRISD |
Please note that this circuit may be very sensitive to ultra sonic noises coming from mechanical parts, because ultra sonic signal is not pulsed.
I can't be helpful about motor control since it is out of this topic, but if you post a full circuit diagram maybe somebody will help  _________________ BrunoG, Administrator |
|
| Back to top |
|
blueroomelectronics
Joined: 31 Dec 2006 Posts: 1 Location: Toronto
|
Posted: Sun Dec 31, 2006 5:30 pm Post subject: |
|
|
Bruno, what is the purpose of the 1N4007 diode in the UltraSonic rangefinder schematic? Is it to drop voltage or an EMF clamp? _________________ Home of the
Inchworm ICD2
Firefly 16F88 Tutor & ZIF
http://www.blueroomelectronics.com |
|
| Back to top |
|
wowowee
Joined: 01 Jan 2007 Posts: 2
|
Posted: Mon Jan 01, 2007 6:32 am Post subject: |
|
|
| BrunoG, if i'm gonna use a breadboard instead of the easypic4 board, how am i gonna connect the lcd to the 16f877? are there any other changes to be made in the circuit? |
|
| Back to top |
|
BrunoG Site Admin
Joined: 22 Nov 2005 Posts: 636
|
Posted: Mon Jan 01, 2007 9:32 pm Post subject: |
|
|
| blueroomelectronics wrote: | | Bruno, what is the purpose of the 1N4007 diode in the UltraSonic rangefinder schematic? Is it to drop voltage or an EMF clamp? |
Yes, it is an EMF clamp to protect the transistor against reverse voltage
Happy new year ! _________________ BrunoG, Administrator |
|
| Back to top |
|
BrunoG Site Admin
Joined: 22 Nov 2005 Posts: 636
|
Posted: Mon Jan 01, 2007 9:36 pm Post subject: |
|
|
| wowowee wrote: | | BrunoG, if i'm gonna use a breadboard instead of the easypic4 board, how am i gonna connect the lcd to the 16f877? are there any other changes to be made in the circuit? |
No, there are no other changes to be made, you can use the circuit as it is described in the mikroC manual (see LCD library 4bits section) :
http://www.mikroe.com/pdf/mikroc/mikroc_manual.pdf
Happy new year ! _________________ BrunoG, Administrator |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|