pages
home
compiler logo
code compiler
electronics
notes about electronics
laboratory
laboratory
Processing logo
Processing code compiler
Theremino logo
Theremino code compiler
logggin Arduino
accedi o esci

tutorials Arduino

lights Arduino

my first led turns on

led's games

an electronic dice

traffic lights

candle effect

fading effect

red-green-blue 1

red-green-blue 2

7-segment display - Countdown

7-segment display bis

sensors

sensors

Sensor and serial port

sensor PIR

ultrasonic sensor

sound

Theremin

a melody

build a note

switches

buttons

keypad

input via serial port

input via serial port 2

input remote control

input remote control 2

use of variables

custom functions

servos

a robot

a remote-controlled robot

elettronica

mechanics

inglese Italian

handbook

pins

connections

resistors

Scarica Adobe Flash Player

remarkable sketches

remarkable circuits

Arduino pins

error messages

tables

colour's tables

electrical simbols

referenze on-line

reference Arduino

reference Processing

link

www.arduino.cc

fritzing.org/projects

processing.org

links

hardware

base kit

facilitated kits

advanced kits

Theremino

Arduino begins the workshop

review a workshop carried out

my account

info

link

contacts

sensore_ultrasuoni

introduction

Arduino
Ultrasound

Ultrasound is an oscillating sound pressure wave with a frequency greater than the upper limit of the human hearing range.
Bats use ultrasound to navigate. They can hear sounds with high frequency. By making sound and hearing echo they determine the distance of objects in their flying area. This is called echolocation.
Their ability to catch flying insects while flying full speed in pitch darkness is astounding. Their sophisticated echolocation permits them to distinguish between a moth (supper) and a falling leaf.
Arduino
Our ultrasonic sensor has a trigger Tx and a receiver Rx (a microphone). Often it is used, for its appearance, in the little robots as eyes.



Speed = Space / Time


then:

Space = Speed * Time


the speed of sound in air is 343.8 m/s

then, using microseconds and centimeters :
Space = 0,03438 * Time


divided by 2, because ultrasounds go and come back
distance = 0,03438 * Time / 2
then:
distance = 0,01719 * Time


program

Arduino apri il programma


Arduino inizia il laboratorio

algorithm


attrezzaggio

pin9˜ ultrasuoniE Arduino _trigger
pin8 ultrasuoniR Arduino _receiver

variabili

duration = 0
distance = 0

ciclo

SWITCH ON (5 Volt) switch on _trigger component
wait 10 milliseconds
SWITCH OFF   (0 Volt) switch off _trigger component
in the variable duration put the duration of the pulse on the pin: _receiver
the variable distance is equal to the formula duration*0.01720
USB Arduino write on the serial: distance:_cm distance
wait 100 milliseconds

Arduino code

Arduino

copy/past in Arduino

electrical connections

Arduino
Fritzing here Fritzing's file


indietro torna all'indice avanti esci logout Licenza Creative Commons

Ultima modifica: Agosto 2016