HC-SR04 Datasheet – Distance Measuring Sensor – Ultrasonic

Part Number: HC-SR04

Function: Ultrasonic Ranging Module

Dimension : 45*20*15mm

Manufacturer: Cytron Technologies, ELECFreaks


HC-SR04 pdf arduino


The HC-SR04 is an ultrasonic ranging sensor that uses sonar technology to detect objects and measure distances. It consists of a transmitter and a receiver that emit and receive ultrasonic waves, respectively. The time taken for the waves to travel to an object and back is used to calculate the distance to the object.

Ultrasonic ranging module HC – SR04 provides 2cm – 400cm non-contact measurement function, the ranging accuracy can reach to 3mm. The modules includes ultrasonic transmitters, receiver and control circuit.

The basic principle of work :

(1) Using IO trigger for at least 10us high level signal,

(2) The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back.

(3) IF the signal back, through high level , time of high output IO duration is the time from sending ultrasonic to returning. Test distance = (high level time×velocity of sound (340M/S) / 2,

Wire connecting direct as following :

1. 5V Supply

2. Trigger Pulse Input

3. Echo Pulse Output

4. 0V Ground

Attention :

The module is not suggested to connect directly to electric, if connected electric, the GND terminal should be connected the module first, otherwise, it will affect the normal work of the module.

When tested objects, the range of area is not less than 0.5 square meters and the plane requests as smooth as possible, otherwise ,it will affect the results of measuring.



HC-SR04 PDF Datasheet

GP2Y0A21YK0F Datasheet – IR Distance Sensor – Sharp

Part Number: GP2Y0A21YK0F

Function: Distance Measuring Sensor Unit

Measuring distance : 10 to 80 cm Analog output type

Manufacturer: Sharp Electronics

Image :

GP2Y0A21YK0F datasheet



The GP2Y0A21YK0F is a distance measuring sensor unit, composed of an integrated combination of PSD (position sensitive detector) , IRED (infrared emitting diode) and signal processing circuit.

The variety of the reflectivity of the object, the environmental temperature and the operating duration are not influenced easily to the distance detection because of adopting the triangulation method.

This device outputs the voltage corresponding to the detection distance. So this sensor can also be used as a proximity sensor.

Block diagram

GP2Y0A21YK0F block diagram


1. Distance measuring range : 10 to 80 cm

2. Analog output type

3. Package size : 29.5×13×13.5 mm

4. Consumption current : Typ. 30 mA

5. Supply voltage : 4.5 to 5.5 V


GP2Y0A21YK0F datasheet pinout


1. Touch-less switch (Sanitary equipment, Control of illumination, etc. )

2. Robot cleaner

3. Sensor for energy saving (ATM, Copier, Vending machine)

4. Amusement equipment (Robot, Arcade game machine)

Reference Site: https://github.com/DrGFreeman/SharpDistSensor


Other data sheets are available within the file:


GP2Y0A21YK0F Datasheet PDF Download


GP2Y0A21YK0F pdf