2018
April Sunday 22

Bookmark and Share

Related Articles...

MILWAUKEE WI Arduino Meet Up Make Space

WANTED: CORE TEAM MEMBER TO HELP START NON-PROFIT GROUP.

WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Arduino Make Space Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Raspberry Pi Meet Up Make Space

WANTED: CORE TEAM MEMBER TO HELP START NON-PROFIT GROUP.

WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Raspberry Pi Make Space Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Internet of Things (IoT) Meet Up Make Space

WANTED: CORE TEAM MEMBER TO HELP START NON-PROFIT GROUP.

WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Make Space Acquired!

Full Advanced Fabrication Facility, machine Shop, Welding, Electronics Lab Equipment Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Machine Repair, & Installation  - Tier 1 Business Support

Machine Technician Mechanic 20+ Years  Personal Experienced In Industrial Factory Machine Servicing, Rebuilding, Installation And Repair - Plus A 35+ Years Experienced Computer Engineer Service Technician Team Ready For Your Outsourced Market Advantage Needs!

Hartung Industrial - Member - CGI Science & Technology Group

Email :

COASMailBox @ gmail.com

2018 April REVIEW

 

Arduino & HC-SR04 Sensor
| Gene's Quick Lab Ref

EMBEDDED COMPUTING

2017 NOVEMBER | by Gene Casanova

Senior Systems/Network/Internet Engineer


HC-SR04 - Ultrasonic Ranging Module

Information provided was obtained from data-sheets published on the Internet.

"Ultrasonic ranging module HC - SR04", is an open source circuit board device, spefified to be providing a 2cm - 400cm non-contact measurement function, with a ranging accuracy up to 3mm.  The module includes an ultrasonic transmitter, receiver, crystal, and control circuit in the form of two IC devices.


The Basic Principle of Work

  1. Using I/O trigger for at least 10us high level signal.
  2. The Module automatically sends eight 40 kHz and detects whether there is a pulse signal back.
  3. If a back signal, through high level , time of high output I/O duration is the time from sending ultrasonic to returning.
  4. Test distance = (high level time×velocity of sound through air (340M/S) / 2.

HC-SR04 Pinouts


Electric Parameters

ParameterValue
Working Voltage 15 mA
Working Current 5 VDC
Working Frequency 40 Hz
Max Range 4m
Min Range 2m
Measuring Angle15 Degrees
Trigger INPUT Signal10uS TTL-Pulse
Echo OUTPUT SignalINPUT TTL Level Signal And The Range In Proportion
Dimension45 x 20 x 15 mm

Arduion & HC-SR04

The following is a basic experimental and test circuit for a HC-SR04 Ultrasonci Module and an Arduino systemboard.

Parts List

  1. Arduino UNO (Other Arduino model systemboards can be used)
  2. 1 HC-SR04 Ultrasonci Module
  3. 1 LED, RED
  4. 1 LED, GREEN
  5. 2 x 560 Ohm (Green, Blue, Brown) Resistor
  6. Breadboard
  7. Eight Leads
  8. Ruler

Arduino Sketch

The Arduino Sketch (the computer-program source code).

/* 2017
 * HC-SR04 Ultrasonic Ranging Program for Arduino UNO
 * 
 * Circuit:
 *
 * VCC to Arduino Pin 5v
 * GND to Arduino Pin GND
* Echo to Arduino Pin 13 * Trig to Arduino Pin 12 *
* LED Red Postive Lead to Arduino Pin 11
* LED Green Postive Lead to Arduino Pin 10 * 560 ohm Resistor to both LED negative lead and GRD power rail
*/

#define trigPin 13
#define echoPin 12
#define led 11
#define led2 10

void setup() {
  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
}

void loop() {
  long duration, distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1; if (distance < 4) {
    digitalWrite(led,HIGH);
  digitalWrite(led2,LOW);
}else{
    digitalWrite(led,LOW);
    digitalWrite(led2,HIGH);
  }
  if (distance >= 200 || distance <= 0){
    Serial.println("Out of range");
  }else{
    Serial.print(distance);
    Serial.println(" cm");
  }
  delay(500); // half secsond delay in sampling routine.
}

Tutoring

Private tutoring in Milwaukee WI may be available.

Contact to continue the conversation.


reference: https://www.arduino.cc, http://www.i2c-bus.org


Use The Technology Wisely & Keep It Simple

- Cheers!

Gene Casanova


Need More?   Need Help? ........Software, Network, System & Data Center Builder & Developer | Development Services Available - Freelance Small Jobs; To Outsourced Long Term Service Provider Contract Labor Available.

CGI Computer Wares | EST 1979

Send E-MailCONTACT: [click]@CGIComputerWares.com