EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #97 background imageLoading...
Page #97 background image
Parallax PING))) ultrasonic sensor
1
because its easy to use, comes with
excellent documentation, and has a nice feature set. It can detect objects in
a range between 2 centimeters and 3 meters, and we use it directly with a
breadboard, so we dont have to solder. Its also a perfect example of a sensor
that provides information via variable-width pulses. (More on that in a few
paragraphs.) With the PING))) sensor, we can easily build a sonar or a robot
that automatically finds its way through a maze without touching a wall.
As mentioned earlier, ultrasonic sensors usually
dont return the distance to the nearest object.
Instead, they return the time the sound needed
to travel to the object and back to the sensor.
The PING))) is no exception, and its innards are
fairly complex. Fortunately, they are hidden
behind three simple pins: power, ground, and
signal.
This makes it easy to connect the sensor to the
Arduino. First, connect Arduinos ground and
5V power supply to the corresponding PING)))
pins. Then connect the PING)))s sensor pin to
one of the Arduinos digital IO pins. (Were using
pin 7 for no particular reason.) For a diagram and for a photo of our circuit,
see Figure 15, PING))) basic circuit, on page 80 and Figure 16, Photo of PING)))
basic circuit, on page 81.
To bring the circuit to life, we need some code that communicates with the
PING))) sensor:
InputDevices/Ultrasonic/Simple/Simple.ino
const unsigned int PING_SENSOR_IO_PIN = 7;
Line 1
const unsigned int BAUD_RATE = 9600;
-
-
void setup() {
-
Serial.begin(BAUD_RATE);
5
}
-
-
void loop() {
-
pinMode(PING_SENSOR_IO_PIN, OUTPUT);
-
digitalWrite(PING_SENSOR_IO_PIN, LOW);
10
delayMicroseconds(2);
-
-
digitalWrite(PING_SENSOR_IO_PIN, HIGH);
-
delayMicroseconds(5);
-
1.
http://www.parallax.com/product/28015
report erratum discuss
Measuring Distances with an Ultrasonic Sensor 79
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals