PDA

View Full Version : ultrasonic range meter problem



santamaria
- 27th February 2005, 09:59
i have problem to drive the tranduser.i saw in many circuits drive the tranduser direct from two ports with 180 degrees diference so they can take 10 volts in the tranduser.i try to do it with PBP but i can't do it.can anyone help me if i can do it with PBP and how.

thanks

mister_e
- 27th February 2005, 10:07
are you saying you want to drive 10Volts to your Sensor?!? in this case you can just add an external op-amp or a transistor circuit with a gain of 2.

Warrier
- 28th February 2005, 00:40
Hi,
driving both sides of the transducer alternatively will give you 2xVdd bipolar signal but make sure the xducer terminals are floating. I am assuming it's 40kHz unit - these present a high capacitance load and am not sure PIC can give you enough drive to get the full Vdd amplitude. Hopefully you don't have any tuning inductor across the xducer..

Like Steve says, use couple of transistors to buffer the PIC output.

As for code - you are looking at 12.5usec pulsewidth -so assembly would be the way - unless Steve can help you with generating such short pulses with PBP. Remember that these have narrow tuning range (no more than 1kHz or so or Hi Q) so you don't have much room for pulsewidth variation- may be you need to use HS clock... PBP, as far as I know, can only put out pulses in 1usec interval (pauseus) so you have to use 12usec for pulses and 1usec in between. And to get good acoustic power out you need a burst of few cycles ....

-warrier

anj
- 28th February 2005, 02:42
If you just want to generate a 40KHz tunable duty cycle pulse, use a chip that supports hardware PWM.
Though PBP doesnt allow you to set a PWM greater than 32767 ( using HPWM ), you can manually set the required registers ( without needing assembler ) and get it to fire off at a perfect 40KHz PWM ( 4MHz, 8MHz oscillators work perfectly for the arithmetic ).
Feed this into a set of OPAMps running as differential comparators, with the transducer across their outputs and bobs yr uncle.
If you need more power, then use the PWM to drive a transistor/mosfet on the supply to the transducer.
Andrew

lester
- 10th March 2005, 05:22
USEFUL INFORMATION ON ULTARSONIC RANGEFINDING:

http://users.picbasic.org/index.php?page=searchprojects

http://users.picbasic.org/projects/ultrasonic/ultrasonic_experiments.pdf

http://www.picbasic.org/forum/showthread.php?t=543&highlight=ultrasonic

the picbasic langauge used may have features that dont exist, yet, in PBP, but the underlying techiniques are valid and applicable as are the circuits and design principles.