Lab 02 - Ultrasound Distance Sensor Using Tinker CAD Arduino
Lab 02 - Ultrasound Distance Sensor Using Tinker CAD Arduino
Lab 02 - Ultrasound Distance Sensor Using Tinker CAD Arduino
Aim: To Interface following sensors such as Temperature or Ultrasonic or Gas sensors with
Raspberry-Pi/Beagle board/ TinkerCADArduino etc. and display readings on console.
Student may start editiong journal from here as per above listed journal content points……
1.List and state various sensors used in IoT systems
Temperature Sensor
Pressure Sensor
Proximity Sensor
Accelerometer and Gyroscope Sensor
IR Sensor
Optical Sensor
Gas Sensor
Smoke Sensor
Ultrasonic Sensor
Water quality Sensor
Level Sensor
Image Sensor
Gyroscope Sensor
Humidity Sensor
Optic Sensor
Motion detector Sensor
Chemical Sensor
Water quality sensor - Water quality sensors are used to detect the water
quality and Ion monitoring primarily in water distribution systems.
Chemical sensor - Chemical sensors are applied in a number of different
industries. Their goal is to indicate changes in liquid or to find out air chemical
changes. They play an important role in bigger cities, where it is necessary to
track changes and protect the population.
Gas sensor - Gas sensors are similar to the chemical ones, but are specifically
used to monitor changes of the air quality and detect the presence of various
gases. Like chemical sensors, they are used in numerous industries such as
manufacturing, agriculture and health and used for air quality monitoring,
detection of toxic or combustible gas, hazardous gas monitoring in coal mines,
oil & gas industries, chemical laboratory research, manufacturing – paints,
plastics, rubber, pharmaceutical & petrochemical etc.
Image sensors - Image sensors are instruments which are used to convert
optical images into electronic signals for displaying or storing files
electronically.
Optical sensors - A sensor which measures the physical quantity of light rays
and convert it into electrical signal which can be easily readable by user or an
electronic instrument/device is called optical sensor.
Now, to calculate the distance using the above formulae, we should know the
Speed and time. Since we are using the Ultrasonic wave we know the universal
speed of US wave at room conditions which is 330m/s. The circuitry inbuilt on the
module will calculate the time taken for the US wave to come back and turns on
the echo pin high for that same particular amount of time, this way we can also
know the time taken. Now simply calculate the distance using a microcontroller or
microprocessor.
Applications
Used to avoid and detect obstacles with robots like biped robot, obstacle
avoider robot, path finding robot etc.
Used to measure the distance within a wide range of 2cm to 400cm
Can be used to map the objects surrounding the sensor by rotating it
Depth of certain places like wells, pits etc can be measured since the waves
can penetrate through water
In the TinkerCAD, we have taken a Ardiuno Uno and ultrasonic sensor, we have
connected ground,vcc of ultrasonic sensor to ground,vcc of ardiunouno
respectively. We have attached trigger at 11 and echo at 12.
Distance = duration*0.034/2
Here we are dividing by 2 because the distance covered by it is twice: going
to the object and coming back from the object.
// Batch: H2
int cm = 0;
int inches = 0;
digitalWrite(triggerPin, LOW);
delayMicroseconds(2);
digitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin, LOW);
pinMode(echoPin, INPUT);
// Reads the echo pin, and returns the sound wave travel time in microseconds
void setup()
Serial.begin(9600);
void loop()
Serial.print(cm);
Serial.println("cm");
Serial.print(inches);
Serial.print("in");
6.Conclusions