working principle of sr04 ultrasonic sensor with 89c51
#1

Dear sir..
I know d working principle of ir sensor but its range is vry low so I cannote use it in some project...
So pls give me some idea about ultrasonic sensor..
1.how to interface with AT89c51/52
2.assembly language prog to glow an led when any body infront of the sensor...
Kindly help me sir
Reply
#2
HC-SR04 based Distance Finder gives the distance of an obstacle in centimeters. It has a range of 2cms to 400cms. The project is built around AT89S52 which is a microcontroller of the 8051 family. The distance is shown in seven segment screens.


Components:

  • AT89S52
  • Three of 7 sec. Disp. (Type of common anode)
  • HC-SR04 (ultrasonic sensor module)
  • Connectors, PCB, etc.

The code is written in the Assembly and is easily understandable.
The project can be used in obstacle avoidance robots, etc.

Working:

The operation of the ultrasonic sensors is quite simple and they are easy to connect with the microcontroller. The sensor module has 4 pins of which Pin-1 and Pin-4 are respectively + Vcc and Gnd respectively. Pin-2 is Trigger and Pin-3 is Eco pin. The operation of the sensors can be described from the following figure:

[Image: 1_0.png]

When a 10us High pulse is applied to the TRIG pin, the ultrasonic transmitter sends 8 consecutive 40kHz frequency pulses. When the eighth pulse is sent, the ECHO pin on the sensor becomes HIGH. Now, when the ultrasonic waves are reflected from any surface and are received by the Receiver, the ECHO pin becomes LOW. The time it takes to exit and return to the sensor is used to find the distance from the reflecting surface.
Distance in centimeters = (Time / 58) cms
In inches = (Time / 148)
The distance can also be calculated taking into account the speed of sound (= 340m / s).

[Image: 2_10.jpg]

Explanation of CODE:
• The data lines of the seven segment screens are interconnected in Port-0
• Port-1, Pin-0,1 and 2 are selection line for SSDs
• P3.0 is connected to Trig
• P3.1 is connected to the Echo pin of the sensor module
• In the main part of the program, the timer-1 is initialized in mode 2 (8-bit automatic recharge)
When P3.0 is set high, the DELAY1 subroutine is called. After 10us P3.0 is reset to 0
• P3.1 is now checked for a high signal. As P3.1 becomes high, timer 1 starts and every time it overflows, register A increments.
• The count value loaded must be 58 (mentioned in the data sheet). So after 58 cycles A increases once.
But since the delay caused by the instructions has to be compensated, the count value I used is 45 (=> 255D-210D).
• The value stored in A is used to extract the measured distance. This is done by the Division instruction.
• The 8-bit data value is sent sequentially to the respective 7-segment screen selected through the selection lines.

[Image: Distance-Finder---1.jpg]

[Image: Distance-Finder---2.jpg]
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: working principle of 89c51 in ppt, hc sr04 interfacing with vhdl, ring sensor working principle, bascom hc sr04 sensor code, mq5 gas sensor working principle pdf, ultrasonic sensor hc sr04 with 8051, rangkaian atmega8535 dengan hc sr04**on ceremony in school,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
Video frequency counter using ic 74c926 diagram working 1 4,273 02-01-2019, 09:35 PM
Last Post:
  coca cola company applied henri fayol principle 2 3,435 29-12-2018, 11:23 AM
Last Post:
  working login id of kirtu 2 3,577 27-01-2018, 01:26 PM
Last Post: Guest
  principle of a listening bug using ic 741 2 1,620 19-09-2017, 01:06 PM
Last Post: jaseela123d
  fayol principle followed by dominos 3 4,807 16-09-2017, 05:32 PM
Last Post: Afifa
  automatic paper cutting machine by using geneva mechanism working 2 6,937 14-08-2017, 01:09 PM
Last Post: Guest
  project report on electronic dice using 89c51 1 1,912 03-07-2017, 06:35 AM
Last Post: lalithamarothu
  how haldirams follow fayol s principle 10 5,036 19-05-2017, 10:16 AM
Last Post: jaseela123d
  ppt of automatic speed control of vehicle at school zones using ir sensor 4 1,559 15-04-2017, 02:20 PM
Last Post: jaseela123d
  working principle of stacker reclaimer pdf 1 1,313 13-04-2017, 03:20 PM
Last Post: jaseela123d

Forum Jump: