±¸ÀԾȳ» Àå¹Ù±¸´Ï ¹è¼ÛÁ¶È¸ ÀÚ·á½Ç °Ô½ÃÆÇ È¸»ç¾È³»
    ¡æ MCU,Avr,Arduino     ¡æ ÄÜÆ®·Ñ, ±â´É¼º¸ðµâ     ¡æ ŸÀ̸Ó,Ä«¿îÅÍ,¿Âµµ     ¡æ ½ë¼­¸ðµâ
    ¡æ µð½ºÇ÷¹ÀÌ     ¡æ µå¶óÀ̹ö     ¡æ Åë½Å,WiFi,ºí·çÅõ¾²     ¡æ ¾ÚÇÁ,POWER,±âŸ
ÃÊÀ½ÆİŸ®°ËÃâ¼¾¼­ [HC-SR04]

-> ÃÊÀ½ÆÄ °Å¸®½ë¼­¸ðµâÀÔ´Ï´Ù.
1. Induction angle: not more than 15 degrees
2. °Å¸® : 2 Cm - 2.4 Meter
3. ¹è¼±: VCC, trig (control side), echo (receiving end), GND
4. DC 5V
£ª°¡°Ý : 4,400 ¿ø    

Power - 5v, 30mA Typ.
Frequency - 40KHz.
Size - 43mm x 20mm x 17mm height.

The input Trigger is a 10uS Min. TTL level pulse
Echo Pulse is Positive TTL level signal, with the width proportional to the object range.

This project started after I looked at the Polaroid Ultrasonic Ranging module. It has a number of disadvantages for use in small robots etc.

The maximum range of 10.7 metre is far more than is normally required, and as a result
The current consumption, at 2.5 Amps during the sonic burst is truly horrendous.
The 150mA quiescent current is also far too high.
The minimum range of 26cm is useless. 1-2cm is more like it.
The module is quite large to fit into small systems, and
It¡¯s EXPENSIVE.
The SRF04 was designed to be just as easy to use as the Polaroid sonar, requiring a short trigger pulse and providing an echo pulse. Your controller only has to time the length of this pulse to find the range. The connections to the SRF04 are shown below:


The SRF04 Timing diagram is shown below. You only need to supply a short 10uS pulse to the trigger input to start the ranging. The SRF04 will send out an 8 cycle burst of ultrasound at 40khz and raise its echo line high. It then listens for an echo, and as soon as it detects one it lowers the echo line again. The echo line is therefore a pulse whose width is proportional to the distance to the object. By timing the pulse it is possible to calculate the range in inches/centimeters or anything else. If nothing is detected then the SRF04 will lower its echo line anyway after about 36mS.




The circuit is designed to be low cost. It uses a PIC12C508 to perform the control functions and standard 40khz piezo transducers. The drive to the transmitting transducer could be simplest driven directly from the PIC. The 5v drive can give a useful range for large objects, but can be problematic detecting smaller objects. The transducer can handle 20v of drive, so I decided to get up close to this level. A MAX232 IC, usually used for RS232 communication makes and ideal driver, providing about 16v of drive.

The receiver is a classic two stage op-amp circuit. The input capacitor C8 blocks some residual DC which always seems to be present. Each gain stage is set to 24 for a total gain of 576-ish. This is close the 25 maximum gain available using the LM1458. The gain bandwidth product for the LM1458 is 1Mhz. The maximum gain at 40khz is 1000000/40000 = 25. The output of the amplifier is fed into an LM311 comparator. A small amount of positive feedback provides some hysterisis to give a clean stable output.

The problem of getting operation down to 1-2cm is that the receiver will pick up direct coupling from the transmitter, which is right next to it. To make matters worse the piezo transducer is a mechanical object that keeps resonating some time after the drive has been removed. Up to 1mS depending on when you decide it has stopped. It is much harder to tell the difference between this direct coupled ringing and a returning echo, which is why many designs, including the Polaroid module, simply blank out this period. Looking at the returning echo on an oscilloscope shows that it is much larger in magnitude at close quarters than the cross-coupled signal. I therefore adjust the detection threshold during this time so that only the echo is detectable. The 100n capacitor C10 is charged to about –6v during the burst. This discharges quite quickly through the 10k resistor R6 to restore sensitivity for more distant echo¡¯s.

A convenient negative voltage for the op-amp and comparator is generated by the MAX232. Unfortunately, this also generates quite a bit of high frequency noise. I therefore shut it down whilst listening for the echo. The 10uF capacitor C9 holds the negative rail just long enough to do this.

In operation, the processor waits for an active low trigger pulse to come in. It then generates just eight cycles of 40khz. The echo line is then raised to signal the host processor to start timing. The raising of the echo line also shuts of the MAX232. After a while – no more than 10-12mS normally, the returning echo will be detected and the PIC will lower the echo line. The width of this pulse represents the flight time of the sonic burst. If no echo is detected then it will automatically time out after about 30mS (Its two times the WDT period of the PIC). Because the MAX232 is shut down during echo detection, you must wait at least 10mS between measurement cycles for the +/- 10v to recharge.

Performance of this design is, I think, quite good. It will reliably measure down to 3cm and will continue detecting down to 1cm or less but after 2-3cm the pulse width doesn¡¯t get any smaller.

Maximum range is a little over 3m. As and example of the sensitivity of this design, it will detect a 1inch thick plastic broom handle at 2.4m.
Average current consumption is reasonable at less than 50mA and typically about 30mA.

Download the source code and a ready assembled hex file.

Calculating the Distance
The SRF04 provides an echo pulse proportional to distance. If the width of the pulse is measured in uS, then dividing by 58 will give you the distance in cm, or dividing by 148 will give the distance in inches. uS/58=cm or uS/148=inches.

Changing beam pattern and beam width
You can't! This is a question which crops up regularly, however there is no easy way to reduce or change the beam width that I'm aware of. The beam pattern of the SRF04 is conical with the width of the beam being a function of the surface area of the transducers and is fixed. The beam pattern of the transducers used on the SRF04, taken from the manufacturers data sheet, is shown below.




*ȸ·Î¼³°è,ÁÖ¹®Á¦ÀÛ,°³¹ß¿ë ºÎÇ° ¹× ¸ðµâ Àü¹®Á¡

À¯Æ¿ÀüÀÚÁÖ½Äȸ»ç
¼­¿ï ¿ë»ê±¸ ÇÑ°­·Î 3°¡ 16-9 ÀüÀÚ·£µå º»°ü ±¤ÀåÃþ C31È£
02-706-7700 aproga@korea.com www.UTIL.co.kr
À¯Æ¿ÀüÀÚÁÖ½Äȸ»ç | ¼­¿ï½Ã ¿ë»ê±¸ ûÆÄ·Î74 ÀüÀÚ·£µåº»°ü ±¤ÀåÃþ C-31È£ | E-mail: aprogara@naver.com| »ç¾÷ÀÚ¹øÈ£: 106-86-72446
Tel:050-5500-4900 Hosting Server www.nexgeo.co.kr|°³ÀÎÁ¤º¸Ã¥ÀÓÀÚ:±è¿µÇö | Åë½ÅÆǸž÷ ¿ë»ê00261È£
¼¼°èÁ¤º¸ A-TEL ·Îµ©Å×Å©
AD AD AD AD AD
¢ÂÀڽŠÀÖ½À´Ï´Ù. ȸ·Î°³¹ß Å°ÆùÇìµå¼Â, ÀüÈ­Çìµå¼Â, »ó´ã¿ëÀüÈ­±â, ¹Ì´ÏÀüÈ­±â, RF¸®¸ðÄÜ, ¹«¼±¸®¸ðÄÜ, Ç÷£Æ®·Î´Ð½º, PLANTRONICS, º§ÄÚ, ÄËÆ®, µµ¾Æ, °æÁø, ´Ù»ê, ¾ÆÀ̾˸µÅ©, Æú¸®ÄÞ, »ïÁ¤Åë½Å, ¢ÂÁÖ¹®Á¦ÀÛ ¹× °³¹ßÇØ µå¸³´Ï´Ù. Åë½Å ¹× ÀüÀÚ±â±â Àýü±â, Áö·É´ë, º¸·ùÀ½, MOH, ÀÚµ¿ÀÀ´ä±â, ÀÚµ¿´ÙÀ̾ó·¯, ¹ß½Å¹øȣǥ½Ã, ¹«Àα³È¯, ¼±·Î½ÃÇè±â, Çãºê,°øÀ¯±â, ÀüȭȸÀÇ, »ç¿îµå½ºÅ×À̼Ç, SOUNDSTATION, ÀüÈ­³ìÀ½, ¢ÂÀç°í ÃæºÐ ÇÕ´Ï´Ù. ¿Ï¼º ¸ðµâ ¹× Å°Æ®Á¦Ç° ÅëÈ­³ìÀ½, ³ìÃë±â, ÀüÈ­¹æ¼Û, ARS, Åë½ÅÄÉÀ̺í, Àü¿ø¼±, ÀâÀÚÀç, µ¿ÃàÄÉÀ̺í, ´ÜÀÚÇÔ, ¸ôµù, ¾Æ¿ô·¿, ½ÃÇèź±â, ÇÇ·Úź±â, ¿øÅÙºí·°, À½¼º¸Þ¸ð¸®, ¸¶ÀÌÄÄ, ÅëÈ­Áß°ËÃâ, ÀÎÆ÷·º½º, ½ºÅ¸·º½º, ¢Â³³Ç°ÇÕ´Ï´Ù. ÀüÀÚ ºÎÇ° ¸ðŸÁ¦¾î, ¹«¼±¸ðµâ, PICBASIC, ½ºÀ§ÄªÆÄ¿ö, PABX, ±³È¯±â, Å°Æù, ÀÚµ¿Á¦¾î, ¿ø°ÝÁ¦¾î, ºñ»óÈ£Ãâ, À¯Æ¿ÀüÀÚ, ¾ÆÇÁ·Î°¡, APROGA, Åë½Å°³¹ß, ÁÖ¹®Á¦ÀÛ, Åë½Å±â±â, ÀüÀÚ±â±â, ÅÚ·¹¸¶ÄÉÆÃ, ÀüÀÚ·£µå, ¿ë»ê ¢Â¼³°è ¹× ±¸Ãà Çص帳´Ï´Ù. ÀÚµ¿Á¦¾î ¹× ÀüÀÚÆÄ