TOP Contributors

  1. MIKROE (2655 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136761 times)
  2. FAT32 Library (69969 times)
  3. Network Ethernet Library (55942 times)
  4. USB Device Library (46268 times)
  5. Network WiFi Library (41888 times)
  6. FT800 Library (41182 times)
  7. GSM click (28986 times)
  8. PID Library (26414 times)
  9. mikroSDK (26368 times)
  10. microSD click (25380 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Project

Code for measuring distance with HC SR04 Ultrasonic Sensor

Rating:

6

Author: Robinson Velasquez

Last Updated: 2016-02-21

Package Version: 1.0.0.0

Category: Measurement

Downloaded: 7715 times

Followed by: 2 users

License: MIT license  

This program displays the distance measured by the sensor HC SR04 on Display 2x16.
Includes MikroC files and details in the .c file.


* RA1 is TRIGGER


*It uses a 16F877A with HS 12MHz, but in MikroC config is necesary set HS 4MHz.
It works perfect if the connection is good.

//Read coments in C code for connection.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Code for measuring distance with HC SR04 Ultrasonic Sensor " changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Code for measuring distance with HC SR04 Ultrasonic Sensor " changes.

Do you want to report abuse regarding "Code for measuring distance with HC SR04 Ultrasonic Sensor ".

  • Information
  • Comments (3)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Project Blog

HC SR-04 PIN CONFIG

HC SR-04 PIN CONFIG

ULTRASONIC SENSOR

View full image
Testing 3 HC SR-04

Testing 3 HC SR-04

This circuit is based in this same project, but it uses three sensor at the same time.

View full image
LCD

LCD

zoom

View full image

 /*
  * Nombre del Proyecto:
      Ensayo del HC-SR04
  * Configuración del ensayo:
      MCU: PIC16F877A
      En el montaje usar Oscillator: HS, 12.0000 MHz
      En la configuracion del Programa Usar HS 4MHz
      Ext.  Modulos: Character LCD 2x16
                       HC-SR04
      Todo "Default". 
      Watch dog OFF
      Timer up OFF

      RA1= TRIGGER

      RC2= ECHO

      SW: mikroC PRO for PIC
 */

ALSO FROM THIS AUTHOR

Accelerometer MMA7260 with LCD y LabView RS232 Comunication Project.

0

This is a project based on the MMA7260 accelerometer that sends the data to the computer with RS232 protocol. Includes simulation in ISIS, files in excel, labview 2010 serial read virtual instrument, datasheet and MikroC for the PIC16F877A files.

[Learn More]