Discussion in "Project Doubts" started by    akshaydusane    Sep 10, 2012.
Mon Sep 10 2012, 05:44 PM
I want to use Ultrasonic sensor for measuring the distance between the obstacle and the sensor....
My sensor model is GH-311.Is it possible?If yes how?
Mon Sep 10 2012, 06:58 PM
This this a strange one.
In the data sheet the description of how it works sounds like a 'Ping' sensor, which can be used
to measure distance.
But there is also a diagram that suggests it just warns that something is in range.

On the net are several threads asking about how it works.
Some say it can be used to measure distance, others that it cant.

You can test it by applying a 10 microsecond positive pulse to the sense pin and looking at the response.
Use an oscilloscope if possible.

Similar distance measuring units are very cheap from China these days. Check ebay.

Tue Sep 11 2012, 07:04 AM
This same sensor is there on ebay for measuring distance...
Wed Sep 12 2012, 03:29 PM
Can timers of Mc be useful for this ?
Thu Sep 13 2012, 04:39 AM
we already have a complete thread dedicated to similar sensor from parallax Ping))
take a look at this thread. It has all the pseudo code and information on distance measurement sensor.
Tags ultrasonic distance measurement sensorparallax ping)) sensor 80518051 distance measurement
Thu Nov 08 2012, 03:54 AM
I want to show the value(integer) I have got from calculating distance....
I need to place that value in SBUF..
I have seen many examples,I observed that only char is sent through SBUF
How I can place in integer in SBUF ? Same as it like a char ??
Thu Nov 08 2012, 08:51 PM

How I can place in integer in SBUF ? Same as it like a char ??


You can as long as it is an 8 bit integer.
 pravin_35 like this.
Sat Nov 10 2012, 10:24 AM
@Ajay Bhargav
I read the article which you suggested to me but I am just confused with a couple of things

My sensor has 3 pins gnd, vcc, sig
1. Sensor is activated
2. TR0=1
3. If obstacle detected --> TR0=0 --> int temp = TH0 --> further calculations
4. If not detected --> reset the timer
Is it correct algo?
Is his "sonar0" pin is my "sig" pin ?

[ Edited Sat Nov 10 2012, 10:24 AM ]
Thu Nov 22 2012, 03:55 PM
Sir, I have constructed following code from the project which you suggested..
But Sir I am facing problem while running this code..
1. When the program waits for the port to be low (while(P32)) Here as far I understood it should automatically become low. But that port becomes low when I remove the obstacle front of the sensor. Till then the timer runs. I do not want that extra time to be included.
for (i=0;i<=10;i++)


a=temp3*0.00000108; //secs
dist=(343*time)*100; //cm
countf(dist); //sending calculated dist value to serial port

Thank you.
Sun Dec 02 2012, 07:15 PM
tout pulse should be 2-5uS and you are giving a lot of delay there. so I guess your sensor is not able to understand what is going on. reduce time..


and try again. Use a CRO for better understanding of what is going on.

Get Social


Powered by e107 Forum System


Sun Oct 13 2019, 02:02 AM
Aline Hutchinson
Hey there,
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



Tue Oct 15 2019, 04:32 PM
Tue Oct 15 2019, 02:27 AM
Sat Oct 05 2019, 02:38 PM
Thu Oct 03 2019, 09:53 AM
Thu Oct 03 2019, 07:37 AM
Fri Sep 20 2019, 04:53 PM
Thu Sep 19 2019, 11:57 AM
Tue Sep 17 2019, 04:21 AM


Guests: 46, Members: 0 ...

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

Members: 38097
Newest member: ilylily07
Forum Activity
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...
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...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Thu Oct 17 2019, 09:38 PM
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Oct 17 2019, 08:35 PM
Do you understand how this code works?If so, addin...