Discussion in "General help Guidance and Discussion" started by    guitar    Aug 27, 2008.
Sun Aug 31 2008, 04:00 AM
ok thanks
Wed Sep 03 2008, 03:01 PM
i bought a pair module of ultrasonic sensors.
it works on 40khz frequency
each module has two pins.
can u tell me functioning of these pins.and how cud i generate a source of 40khz for it

[ Edited Wed Sep 03 2008, 03:27 PM ]
Wed Sep 03 2008, 06:35 PM
hi guitar,
u can generate a square wave of 40khz at any port pin using the AVR internal timer (use the PWM principle with a fixed 50% duty cycle.). Now, amplify the voltage level of the square wave according to the data sheet before feeding it to the transmitter.( if i remember correctly, the sensor can operate at more than 30V DC). this is neccesary because the range of the sound wave is dependent on the energy u transfer to it which is directly proportional to the operating voltage . u can achieve it using a simple NPN power transistor.
now the principle as i explained earlier is that u have to generate a limited train of pulses at that frequency (10~20 pulses is sufficient).simultaneously, start a internal timer inside the AVR. the next step would be to stop the timer as soon as u receive the first pulse from the receiver.the timer value would be directly proportional to the total distance travelled by the wave.
Wed Sep 03 2008, 06:44 PM
Circuit Description:

Ultrasonic Transmitter is based on a 4011 quad 2-input NAND gate. Two of the gates, IC1a and IC1b, are used as a conventional CMOS Astable circuit whose oscillation frequency is set by capacitor C1, resistors R6 and R7, plus preset VR2, which adjusts the frequency. Gates IC1c and IC1d buffer the outputs from IC1a and IC1b and drive the ultrasonic transmitter transducer, X1, in push-pull mode.

In the Receiver circuit, ultrasonic echo signal is received by transducer X2. It is first amplified by the 2-stage amplifier based on transistors TR1 and TR2. The output from TR2 is rectified by diode D1 and smoothed by capacitor C4. The result is a voltage level at inverting terminal of IC2 which varies between 1·4V and 2·7V when X2 is not receiving ultrasound echoes, but falls to 1·2V when a strong enough echo from an object is detected. The rectified signal goes to op amp comparator IC2's inverting input, pin 2. The signal is compared with a reference voltage set by preset VR3, and applied to IC2's non-inverting input, pin 3. The output at IC2 pin 6 is low when there is no echo, but swings high when an obstacle ahead of the system is detected.

Tags ultrasonic transmitter and receiver40Khz ultrasonic transmitter receiver circuits
Wed Sep 03 2008, 06:54 PM
here is a flowchart to explain the concept better:
note that in the receiver section, a clamping circuit is required to translate the signal level to +5V and to remove any distortions in the square pulse received .

@ ajay,
nice ckt, if used could take a load off the uC.
@ guitar
the only thing required in the ckt provided by ajay would be to give the output to the internal ADC of the AVR and monitor the voltage level for a valid reflection.

[ Edited Wed Sep 03 2008, 07:01 PM ]
Wed Sep 03 2008, 07:09 PM
you can also use a 555 timer IC to generate 40Khz wave in transmitter side, In the above circuit an RC circuit is used.

The circuit provided above is for obstacle detection not distance measurement. Guitar was asking how to use them, so i gave an idea.

for distance measurement, you need not to use the opamp IC, instead you can give the o/p of C4 to ADC, to measure the voltage level from 1.4 to 2.7V to measure how far the obstacle is.. for calibration you might need to work out a little.
Thu Sep 04 2008, 02:13 PM
actually i want distance measuring sensor concept.then want it to display distance on lcd
i found a circuit for 40khz frequency source but it is for infrared led so can i attach my sensor in place of that led ?

Thu Sep 04 2008, 04:27 PM
well, u can use anyof the above methods but the trick is that u have to send only a limited no. of pulses and not a continuous train. so, the transmission of pulses should be controlled by the uC. with a continuous emission of pulses, u cannot differentiate between which pulse was received from the transmitted pulses.
hope u understood the concept.
Fri Sep 05 2008, 04:17 AM
but can i use ultrasonic sensor in place of led in below pasted diagram

 seenivasan like this.
Fri Sep 05 2008, 08:12 AM
check this application note for ultrasonic sensors.

they have suggested about 6 circuits for transmitter design.

Get Social


Powered by e107 Forum System


Fri Nov 15 2019, 08:19 AM
Allison Wink
Want to submit your business on 1000's of Advertising sites monthly? For a small monthly payment you can get virtually unlimited traffic to your site forever!For details check out: http://www.submitmyadnow.tech
Sat Oct 12 2019, 10:23 PM
Log in.. then post your code in the 8051 forum
Sat Oct 12 2019, 10:18 AM
Bhadra Sajikumar
i am doing a countdown timer with 8051 for my project, unfortunately our professor had to take a leave of absence before he could teach us most of it.. can someone explain the .asm code of it for me?
Mon Sep 23 2019, 07:37 AM
I am doing a project for my schools wireless security system with cameras,sensors and spot lights using 8051 micro controller, could you help me out with the design and its source code.
Wed Sep 18 2019, 08:48 PM
Caryn Kover
Thank you for your time,
Mon Aug 05 2019, 07:09 PM
@Ismail ..post in forum, give details
Mon Aug 05 2019, 04:33 PM
Ismail balghmi
Hello. Please I won't download
Wed Jul 24 2019, 12:47 AM
@BUSTER123 Please post in the forum
Tue Jul 23 2019, 06:13 PM
hello! newbie here. i am kind of a guy who hates using ready - made existing libraries, so this helped a lot as i was trying to control and write to a character lcd display. however, i can't figure out how to set the cursor position. for example, i want to set it to the 5th column in the first row, so position 5. so according to the table, i am sending 10000101 on the 8 data lines of the lcd (register select pulled low). the cursor does not move there however. and i cant move the cursor left or right too. is it something wrong that i am doing? thank you.
Thu Jul 11 2019, 07:55 PM
@ramos https://www.theengineeringprojects.com/2017/09/l298-motor-driver-library-proteus.html



Wed Nov 13 2019, 06:25 AM
Mon Nov 11 2019, 01:31 PM
Sun Nov 10 2019, 04:42 AM
Sat Nov 09 2019, 03:41 PM
Fri Nov 08 2019, 10:06 AM
Fri Nov 08 2019, 07:28 AM
Tue Oct 15 2019, 04:32 PM
Tue Oct 15 2019, 02:27 AM


Guests: 85, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38103
Newest member: Casmir
Forum Activity
Jeanbusatta Avatar
Posted By Jeanbusatta
Sun Nov 10 2019, 04:43 AM
ty, really needed it
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Oct 22 2019, 05:18 AM
wimac Avatar
Posted By wimac
Mon Oct 21 2019, 09:18 AM
I’ve been following this thread and looking at the...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 03:09 PM
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 03:02 PM
sir, when i on display ,sometime 3rd display is no...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 02:53 PM
sir, when i on display ,sometime 3rd display is no...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Oct 20 2019, 12:21 AM
Your code seems okay on my simulationTry my code o...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sat Oct 19 2019, 07:13 PM
please find video attachment. 3rd & 4th displa...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sat Oct 19 2019, 07:05 PM
sir, 3rd and 4th dot matrix display flickering, ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Oct 18 2019, 09:18 PM
Hopefully you understand some of the program.Which...