hc sr04 interfacing with 8051 coding in c
#1

Hi,

Could you please mail me the working and tested C code for interfacing HC-SR04 ultrasonic sound sensor with 8051?I have one code with me but it is not working... please help me. My email ID is aneesh[at]tes-dst.com

Regards
Aneesh
Reply
#2
Ultrasonic range finder using 8051
ADMIN on December-18-201261 COMMENTS
Ultrasonic range finder using 8051.
Simple ultrasonic range finder using microcontroller 8051 presented in this article. This ultrasonic distance meter allows you to measure distances up to 2.5 m with an accuracy of 1 Centi meter. AT89S51 microcontroller and ultrasonic sensor module HC-SR04 forms the basis of this scheme. Ultrasonic module sends a signal to an object, then lifts her echo and the shape of the waves of time period which is proportional to distance. Microcontroller takes this signal, does any necessary processing and generates the corresponding distance on the seven-segment digital display 3. This scheme has many applications in projects, such as car parking sensors, obstacle warning system, terrain monitoring robots, industrial measuring distances, etc.
HC-SR04 ultrasound module.
HC-SR04 ultrasound module is designed for embedded systems from such projects. It has a resolution of 0.3 cm and to a distance of 2 cm up to 500 cm. It runs from the source 5 v DC and standby current is less than 2 Ma. The module transmits the ultrasonic signal raises it echo, measures the time elapsed between two events, and displays a time signal is modulated the measured time proportional to the distance. .The Photo module HC-SR04, shown below.
HC-SR-04 ultrasonic ranging module
HC-SR04 Ultrasonic ranging module (Figure 1)
Supporting schema, custom module makes it virtually alone, and what you need to do is to send an alert to trigger it to start transmitting and receiving the echo-signal from it to calculate the distance.HR-SR04 has four pins, namely, Vcc, GND, Echo, trigger, and they are described in detail below.
1 VCC): 5V DC voltage supply is connected to this conclusion.
2) start: trigger signal to start is given with this conclusion. Start-up tone to pulse with high 10us in time. When the module receives a valid start signal it emits 8 pulses of 40 kHz ultrasonic transmitter from the Echo sound. the receiver.
3) Echo: the output module produces a signal with high time proportional to the distance.
4) GND: ground is associated with this conclusion.
HC-SR04 timeline.

HC-SR04 timeline
HC-SR04 timeline
From the chart, you can see that the 40 kHz pulse is transmitted only after 10uS launching pulse and echo out after some time the next runs the momentum can only be given after the ECHO disappeared, and this period is called the period of the cycle. the period of the cycle for HC-SR04 shall not be less than 50 milliseconds. According to the spec, the distance can be calculated from the echo of the pulse duration using the following equations.
Distance in cm = echo pulse width in United States/58
The distance in inches = echo pulse duration in the United States/148
Reply
#3
please send me working code of hr sr04c in c language my id is arooba.iftikhar[at]yahoo.com
Reply
#4

hc sr04 interfacing with 8051 coding in c

Ultrasonic range finder using 8051
ADMIN on December-18-201261 COMMENTS
Ultrasonic range finder using 8051.
Simple ultrasonic range finder using microcontroller 8051 presented in this article. This ultrasonic distance meter allows you to measure distances up to 2.5 m with an accuracy of 1 Centi meter. AT89S51 microcontroller and ultrasonic sensor module HC-SR04 forms the basis of this scheme. Ultrasonic module sends a signal to an object, then lifts her echo and the shape of the waves of time period which is proportional to distance. Microcontroller takes this signal, does any necessary processing and generates the corresponding distance on the seven-segment digital display 3. This scheme has many applications in projects, such as car parking sensors, obstacle warning system, terrain monitoring robots, industrial measuring distances, etc.
HC-SR04 ultrasound module.
HC-SR04 ultrasound module is designed for embedded systems from such projects. It has a resolution of 0.3 cm and to a distance of 2 cm up to 500 cm. It runs from the source 5 v DC and standby current is less than 2 Ma. The module transmits the ultrasonic signal raises it echo, measures the time elapsed between two events, and displays a time signal is modulated the measured time proportional to the distance. .The Photo module HC-SR04, shown below.
HC-SR-04 ultrasonic ranging module
HC-SR04 Ultrasonic ranging module (Figure 1)
Supporting schema, custom module makes it virtually alone, and what you need to do is to send an alert to trigger it to start transmitting and receiving the echo-signal from it to calculate the distance.HR-SR04 has four pins, namely, Vcc, GND, Echo, trigger, and they are described in detail below.
1 VCC): 5V DC voltage supply is connected to this conclusion.
2) start: trigger signal to start is given with this conclusion. Start-up tone to pulse with high 10us in time. When the module receives a valid start signal it emits 8 pulses of 40 kHz ultrasonic transmitter from the Echo sound. the receiver.
3) Echo: the output module produces a signal with high time proportional to the distance.
4) GND: ground is associated with this conclusion.
HC-SR04 timeline.

HC-SR04 timeline
HC-SR04 timeline
From the chart, you can see that the 40 kHz pulse is transmitted only after 10uS launching pulse and echo out after some time the next runs the momentum can only be given after the ECHO disappeared, and this period is called the period of the cycle. the period of the cycle for HC-SR04 shall not be less than 50 milliseconds. According to the spec, the distance can be calculated from the echo of the pulse duration using the following equations.
Distance in cm = echo pulse width in United States/58
The distance in inches = echo pulse duration in the United States/148
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
Tagged Pages: c coding for ultrasonic hc sr04 for 8051, source c code of at89c51 for ultrasonic sensor hcsr04, interfacing 8051 with hcsr04,
Popular Searches: hc sr04 avr c pdf, at89c51 code for hc sr04, sr04 codevision, hc sr04 codevisionavr source code, code cvavr sr04, hc sr04 avr mega32, coding for hcsr04 in 8051,

[-]
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
  program code of solar tracking system using 8051 microcontroller 6 23,345 03-05-2018, 09:30 PM
Last Post: Guest
  travel agency vb6 0 project report with coding in pdf format 3 3,226 13-03-2018, 12:15 AM
Last Post: Guest
  railway ticket reservation form coding in gui 1 1,298 13-04-2017, 09:45 AM
Last Post: jaseela123d
  distance measurement using infrared sensor with adc0804 8051 microcontroller at89c51 1 2,115 12-04-2017, 12:57 PM
Last Post: jaseela123d
  8051 based automatic blind stick circuit diagram 1 964 10-04-2017, 04:02 PM
Last Post: jaseela123d
  pic16f877a interfaced with hc sr04 1 779 10-04-2017, 02:55 PM
Last Post: jaseela123d
  feature extraction from speech using mfcc matlab coding 1 946 07-04-2017, 12:06 PM
Last Post: jaseela123d
  code for interfacing 8051 with pir sensor 1 902 05-04-2017, 03:53 PM
Last Post: jaseela123d
  fault detection of optical fibre using 8051 1 780 04-04-2017, 05:01 PM
Last Post: jaseela123d
Thumbs Up 8051 microcontroller experiments lab manual pdf 1 1,048 04-04-2017, 04:12 PM
Last Post: jaseela123d

Forum Jump: