A Project Based Lab Report WATER LEVEL I
A Project Based Lab Report WATER LEVEL I
On
SUBMITTED BY:
180069018 K.JANARDHAN
180069017 K.HARSHA
180069019 K.NITISH
IN
(SEMESTER-IV)
CERTIFICATE
Signature of HOD
Dr.S.V.N.L.Lalitha
ii
ACKNOWLEDGEMENTS
180069018 K.JANARDHAN
180069017 K.HARSHA
180069019 K.NITISH
iii
ABSTRACT
technologies like sensors ,arduino. the main aim of the project is to calculate the water level
at any instant of time and to buzz the buzzer if the tank is filled completely.i would like to use
arduino and ultrasonic sensor to make it possible. this may be useful to conserve water and
iv
INDEX
1 INTRODUCTION vi
3 APPARATUS viii
4 BLOCK DIAGRAM ix
5 PROCEDURE x-xxxvii
6. CODE xxxvii-xl
7 OUTPUT xli-xliii
8 CONCLUSION xliv
v
INTRODUCTION
the facility requirements in many industries, farms, hostels, hotels, offices include an overhead
tank for water, which is usually fed through an electric pump that is switched off when the tank is filled
up and switched on when it is empty. so, the most common way of knowing when the tank is filled is by
observing when it overflows the brim. depending on the type of liquid being handled, overfilling of such
a tank could lead to a great liquid material losses ranging in the order of thousands of naira per week
depending on the extent of such application. these losses can be prevented if the tank is monitored
automatically by incorporating a feedback.
water level indicator using ultrasonic sensor &arduino is an amazing and very useful project. the
objective of this project is to notify the user the amount of water that is present in the overhead water
tank. this project can be further enhanced to control the water level in the tank by turning it on, when the
water level is low, and turning it off when the water level is high. thus, the arduino water level indicator
helps in preventing wastage of water in overhead tank.
a transmitter circuit and a receiver circuit. the transmitter circuit makes use of an
ultrasonic sensor to measure the water level in terms of distance. this data is sent to the receiver circuit
using rf communication.
vi
AIM
The objective of this project is to notify the user the amount of water that is present in the
overhead water tank and don‟t waste water.
vii
APPARATUS
3.resistor
4.jumper wires
5.led
6. Water tank
7.bread board
viii
BLOCK DIAGRAMS
ix
PROCEDURE
looking at the board from the top down, this is an outline of what you will see
(parts of the board you might interact with in the course of normal use are
highlighted):
x
in-circuit serial programmer (blue-green)
analog in pins 0-5 (light blue)
power and ground pins (power: orange, grounds: light orange)
external power supply in (9-12vdc) - x1 (pink)
toggles external power and usb power (place jumper on two pins closest to desired
supply) - sv1 (purple)
usb (used for uploading sketches to the board and for serial communication between
the board and the computer; can be used to power the board) (yellow)
Digital Pins:-
in addition to the specific functions listed below, the digital pins on an arduino board can be
usedforgeneralpurposeinputandoutputviathe pinmode(), digitalread(),and digitalwrite() comm
ands. each pin has an internal pull-up resistor which can be turned on and off using
digitalwrite() (w/ a value of high or low, respectively) when the pin is configured as an input.
the maximum current per pin is 40 ma.
.serial: 0 (rx) and 1 (tx). used to receive (rx) and transmit (tx) ttl serial data. on the arduino
diecimila, these pins are connected to the corresponding pins of the ftdi usb-to-ttl serial chip.
on the arduino bt, they are connected to the corresponding pins of the wt11 bluetooth module.
on the arduino mini and lilypad arduino, they are intended for use with an external ttl serial
module (e.g. the mini-usb adapter).
external interrupts: 2 and 3. these pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. see the attachinterrupt() function for
details.
pwm: 3, 5, 6, 9, 10, and 11. provide 8-bit pwm output with the analogwrite() function. on
boards with an atmega8, pwm output is available only on pins 9, 10, and 11.
bt reset: 7. (arduino bt-only) connected to the reset line of the bluetooth module.
spi: 10 (ss), 11 (mosi), 12 (miso), 13 (sck). these pins support spi communication, which,
although provided by the underlying hardware, is not currently included in the arduino
language.
led: 13. on the diecimila and lilypad, there is a built-in led connected to digital pin 13. when
the pin is high value, the led is on, when the pin is low, it's off.
xi
ANALOG PINS:-
in addition to the specific functions listed below, the analog input pins support 10-bit analog-
to-digital conversion (adc) using the analogread() function. most of the analog inputs can also
be used as digital pins: analog input 0 as digital pin 14 through analog input 5 as digital pin
19. analog inputs 6 and 7 (present on the mini and bt) cannot be used as digital pins.
i2c: 4 (sda) and 5 (scl). support i2c (twi) communication using the wire
library (documentation on the wiring website).
POWER PINS:-
vin (sometimes labelled "9v"). the input voltage to the arduino board when it's using an
external power source (as opposed to 5 volts from the usb connection or other regulated
power source). you can supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin. note that different boards accept different input voltages
ranges, please see the documentation for your board. also note that the lilypad has no vin pin
and accepts only a regulated input.
5v. the regulated power supply used to power the microcontroller and other components on
the board. this can come either from vin via an on-board regulator, or be supplied by usb or
another regulated 5v supply.
3v3. (diecimila-only) a 3.3 volt supply generated by the on-board ftdi chip.
gnd. ground pins.
OTHER PINS:-
aref. reference voltage for the analog inputs. not currently supported by the arduino software.
reset. (diecimila-only) bring this line low to reset the microcontroller. typically used to add a
reset button to shields which block the one on the board.
xii
the text of the arduino getting started guide is licensed under a creative commons attribution-
sharealike 3.0 license. code samples in the guide are released into the public domain.
arduino board designs use a variety of microprocessors and controllers. the boards are
equipped with sets of digital and analog input/output (i/o) pins that may be interfaced to
various expansion boards ('shields') or breadboards (for prototyping) and other circuits. the
boards feature serial communications interfaces, including universal serial bus (usb) on some
models, which are also used for loading programs from personal computers. the
microcontrollers can be programmed using c and c++ programming languages. in addition to
using traditional compiler toolchains, the arduino project provides an integrated development
environment (ide) based on the processing language project.
the arduino project started in 2005 as a program for students at the interaction design institute
ivrea in ivrea, italy, aiming to provide a low-cost and easy way for novices and professionals
to create devices that interact with their environment using sensors and actuators. common
examples of such devices intended for beginner hobbyists include
simple robots, thermostats and motion detectors.
the name arduino comes from a bar in ivrea, italy, where some of the founders of the project
used to meet. the bar was named after arduin of ivrea, who was the margrave of the march of
ivrea and king of italy from 1002 to 1014
APPLICATIONS:-
xiii
c-stem studio, a platform for hands-on integrated learning of computing, science,
technology, engineering, and mathematics (c-stem) with robotics.
data loggers for scientific research.
obduino, a trip computer that uses the on-board diagnostics interface found in most
modern cars
openevse an open-source electric vehicle charger
xod, a visual programming language for arduino
SOFTWARE:-
a program for arduino hardware may be written in any programming language with compilers
that produce binary machine code for the target processor. atmel provides a development
environment for their 8-bit avr and 32-bit arm cortex-m based microcontrollers: avr studio
(older) and atmel studio (newer)
IDE:-
the arduino integrated development environment (ide) is a cross-platform application
(for windows, macos, and linux) that is written in the programming language java. it
originated from the ide for the languages processing and wiring. it includes a code editor with
features such as text cutting and pasting, searching and replacing text, automatic
indenting, brace matching, and syntax highlighting, and provides simple one-
click mechanisms to compile and upload programs to an arduino board. it also contains a
message area, a text console, a toolbar with buttons for common functions and a hierarchy of
operation menus. the source code for the ide is released under the gnu general public license,
version 2.
the arduino ide supports the languages c and c++ using special rules of code structuring. the
arduino ide supplies a software library from the wiring project, which provides many
common input and output procedures. user-written code only requires two basic functions, for
starting the sketch and the main program loop, that are compiled and linked with a program
stub main() into an executable cyclic executive program with the gnu toolchain, also included
with the ide distribution. the arduino ide employs the program avrdude to convert the
executable code into a text file in hexadecimal encoding that is loaded into the arduino board
by a loader program in the board's firmware.
pro ide:-
xiv
on october 18th, 2019, arduino pro ide (alpha preview) was released. the system still uses
arduino cli (command line interface), but improvements include a more professional
development environment, autocompletion support, and git integration. the application
frontend is based on the eclipse theia open source ide. the main features available in the alpha
release are:
SKETCH[EDIT]:-
a sketch is a program written with the arduino ide sketches are saved on the development
computer as text files with the file extension .ino. arduino software (ide) pre-1.0 saved
sketches with the extension .pde.
setup(): this function is called once when a sketch starts after power-up or reset. it is used
to initialize variables, input and output pin modes, and other libraries needed in the
sketch. it is analogous to the function main()
loop(): after setup() function exits (ends), the loop() function is executed repeatedly in the
main program. it controls the board until the board is powered off or is reset. it is
analogous to the function while(1)
blink example
xv
power led (red) and user led (green) attached to pin 13 on an arduino compatible board
most arduino boards contain a light-emitting diode (led) and a current limiting resistor
connected between pin 13 and ground, which is a convenient feature for many tests and
program functions.[63] a typical program used by beginners, akin to hello, world!, is "blink",
which repeatedly blinks the on-board led integrated into the arduino board. this program uses
the functions pinmode(), digitalwrite(), and delay(), which are provided by the internal
libraries included in the ide environment. this program is usually loaded into a new arduino
board by the manufacturer.
void setup() {
pinmode(led_pin, output); // configure pin 13 to be a digital output.
}
void loop() {
digitalwrite(led_pin, high); // turn on the led.
delay(1000); // wait 1 second (1000 milliseconds).
digitalwrite(led_pin, low); // turn off the led.
delay(1000); // wait 1 second.
}
LIBRARIES[EDIT]
the open-source nature of the arduino project has facilitated the publication of many free
software libraries that other developers use to augment their projects.
xvi
This is an Arduino Uno
the uno is one of the more popular boards in the arduino family and a great choice for
beginners. we'll talk about what's on it and what it can do later in the tutorial.
xvii
This is a screenshot of the Arduino IDE.
believe it or not, those 10 lines of code are all you need to blink the on-board led on your
arduino. the code might not make perfect sense right now, but, after reading this tutorial and
the many more arduino tutorials waiting for you on our site, we'll get you up to speed in no
time!
xviii
the different varieties of arduino boards
some useful widgets to use with your arduino
suggested reading
arduino is a great tool for people of all skill levels. however, you will have a much better time
learning along side your arduino if you understand some basic fundamental electronics
beforehand. we recommend that you have at least a decent understanding of these concepts
before you dive in to the wonderful world of arduino.
xix
Power (USB / Barrel Jack)
every arduino board needs a way to be connected to a power source. the arduino uno can be
powered from a usb cable coming from your computer or a wall power supply (like this) that
is terminated in a barrel jack. in the picture above the usb connection is labeled (1) and the
barrel jack is labeled (2).
the usb connection is also how you will load code onto your arduino board. more on how to
program with arduino can be found in our installing and programming arduino tutorial.
note: do not use a power supply greater than 20 volts as you will overpower (and thereby
destroy) your arduino. the recommended voltage for most arduino models is between 6 and
12 volts.
the pins on your arduino are the places where you connect wires to construct a circuit
(probably in conjuction with a breadboard and some wire. they usually have black plastic
„headers‟ that allow you to just plug a wire right into the board. the arduino has several
different kinds of pins, each of which is labeled on the board and used for different functions.
gnd (3): short for „ground‟. there are several gnd pins on the arduino, any of which
can be used to ground your circuit.
5v (4) & 3.3v (5): as you might guess, the 5v pin supplies 5 volts of power, and the
3.3v pin supplies 3.3 volts of power. most of the simple components used with the
arduino run happily off of 5 or 3.3 volts.
analog (6): the area of pins under the „analog in‟ label (a0 through a5 on the uno) are
analog in pins. these pins can read the signal from an analog sensor (like
a temperature sensor) and convert it into a digital value that we can read.
digital (7): across from the analog pins are the digital pins (0 through 13 on the uno).
these pins can be used for both digital input (like telling if a button is pushed) and
digital output (like powering an led).
pwm (8): you may have noticed the tilde (~) next to some of the digital pins (3, 5, 6,
9, 10, and 11 on the uno). these pins act as normal digital pins, but can also be used
for something called pulse-width modulation (pwm). we have a tutorial on pwm, but
for now, think of these pins as being able to simulate analog output (like fading an led
in and out).
xx
aref (9): stands for analog reference. most of the time you can leave this pin alone. it
is sometimes used to set an external reference voltage (between 0 and 5 volts) as the
upper limit for the analog input pins.
RESET BUTTON
just like the original nintendo, the arduino has a reset button (10). pushing it will temporarily
connect the reset pin to ground and restart any code that is loaded on the arduino. this can be
very useful if your code doesn‟t repeat, but you want to test it multiple times. unlike the
original nintendo however, blowing on the arduino doesn't usually fix any problems.
just beneath and to the right of the word “uno” on your circuit board, there‟s a tiny led next to
the word „on‟ (11). this led should light up whenever you plug your arduino into a power
source. if this light doesn‟t turn on, there‟s a good chance something is wrong. time to re-
check your circuit!
TX RX LEDS
tx is short for transmit, rx is short for receive. these markings appear quite a bit in electronics
to indicate the pins responsible for serial communication. in our case, there are two places on
the arduino uno where tx and rx appear -- once by digital pins 0 and 1, and a second time next
to the tx and rx indicator leds (12). these leds will give us some nice visual indications
whenever our arduino is receiving or transmitting data (like when we‟re loading a new
program onto the board).
MAIN IC
the black thing with all the metal legs is an ic, or integrated circuit (13). think of it as the
brains of our arduino. the main ic on the arduino is slightly different from board type to board
type, but is usually from the atmega line of ic‟s from the atmel company. this can be
important, as you may need to know the ic type (along with your board type) before loading
up a new program from the arduino software. this information can usually be found in writing
on the top side of the ic. if you want to know more about the difference between various ic's,
reading the datasheets is often a good idea.
xxi
VOLTAGE REGULATOR
the voltage regulator (14) is not actually something you can (or should) interact with on the
arduino. but it is potentially useful to know that it is there and what it‟s for. the voltage
regulator does exactly what it says -- it controls the amount of voltage that is let into the
arduino board. think of it as a kind of gatekeeper; it will turn away an extra voltage that might
harm the circuit. of course, it has its limits, so don‟t hook up your arduino to anything greater
than 20 volts.
arduino makes several different boards, each with different capabilities. in addition, part of
being open source hardware means that others can modify and produce derivatives of arduino
boards that provide even more form factors and functionality. if you‟re not sure which one is
right for your project, check this guide for some helpful hints. here are a few options that are
well-suited to someone new to the world of arduino:
the uno is a great choice for your first arduino. it's got everything you need to get started, and
nothing you don't. it has 14 digital input/output pins (of which 6 can be used as pwm
outputs), 6 analog inputs, a usb connection, a power jack, a reset button and more. it contains
everything needed to support the microcontroller; simply connect it to a computer with a usb
cable or power it with a ac-to-dc adapter or battery to get started.
xxii
LILYPAD ARDUINO
this is lilypad arduino main board! lilypad is a wearable e-textile technology developed
by leah buechley and cooperatively designed by leah and sparkfun. each lilypad was
creatively designed with large connecting pads and a flat back to allow them to be sewn into
clothing with conductive thread. the lilypad also has its own family of input, output, power,
and sensor boards that are also built specifically for e-textiles. they're even washable!
xxiii
REDBOARD
at sparkfun we use many arduinos and we're always looking for the simplest, most stable one.
each board is a bit different and no one board has everything we want -- so we decided to
make our own version that combines all our favorite features.
the redboard can be programmed over a usb mini-b cable using the arduino ide. it'll work on
windows 8 without having to change your security settings (we used signed drivers, unlike
the uno). it's more stable due to the usb/ftdi chip we used, plus it's completely flat on the
back, making it easier to embed in your projects. just plug in the board, select "arduino uno"
from the board menu and you're ready to upload code. you can power the redboard over usb
or through the barrel jack. the on-board power regulator can handle anything from 7 to 15vdc.
xxiv
ARDUINO MEGA (R3)
the arduino mega is like the uno's big brother. it has lots (54!) of digital input/output pins (14
can be used as pwm outputs), 16 analog inputs, a usb connection, a power jack, and a reset
button. it contains everything needed to support the microcontroller; simply connect it to a
computer with a usb cable or power it with a ac-to-dc adapter or battery to get started. the
large number of pins make this board very handy for projects that require a bunch of digital
inputs or outputs (
xxv
RESISTOR:-
xxvi
WATERTANK:-
uses
sensors
with some simple code, the arduino can control and interact with
awidevarietyof sensors thingsthatcanmeasure light, temperature, degreeofflex, pressure, proxi
mity, acceleration, carbon monoxide, radioactivity, humidity, barometric pressure, you name
it, you can sense it!
xxvii
just a few of the sensors that are easily compatible with arduinoshields
additionally, there are these things called shields -- basically they are pre-built circuit boards
that fit on top of your arduino and provide additional capabilities -- controlling
motors, connecting to the internet, providing cellular or other wireless
communication, controlling an lcd screen, and much more.
xxviii
HC-SR04 Ultrasonic Sensor
xxix
ULTRASONIC SENSOR HC SR04 PIN DIAGRAM
3 ECHO ECHO PIN IS AN OUTPUT PIN. THIS PIN GOES HIGH FOR
A PERIOD OF TIME WHICH WILL BE EQUAL TO THE
TIME TAKEN FOR THE US WAVE TO RETURN BACK TO
THE SENSOR.
xxx
equivalent distance measuring sensors
us transmitter receiver pair, ir sensor module, ir sensor pair, ir analog distance sensor,
as shown above the hc-sr04 ultrasonic (us) sensor is a 4 pin module, whose pin names are
vcc, trigger, echo and ground respectively. this sensor is a very popular sensor used in many
applications where measuring distance or sensing objects are required. the module has two
eyes like projects in the front which forms the ultrasonic transmitter and receiver. the sensor
works with the simple high school formula that
the ultrasonic transmitter transmits an ultrasonic wave, this wave travels in air and when it
gets objected by any material it gets reflected back toward the sensor this reflected wave is
observed by the ultrasonic receiver module as shown in the picture below
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.
xxxi
how to use the hc-sr04 ultrasonic sensor
hc-sr04 distance sensor is commonly used with both microcontroller and microprocessor
platforms like arduino, arm, pic, raspberry pie etc. the following guide is universally since it
has to be followed irrespective of the type of computational device used.
power the sensor using a regulated +5v through the vcc ad ground pins of the sensor. the
current consumed by the sensor is less than 15ma and hence can be directly powered by the
on board 5v pins (if available). the trigger and the echo pins are both i/o pins and hence they
can be connected to i/o pins of the microcontroller. to start the measurement, the trigger pin
has to be made high for 10us and then turned off. this action will trigger an ultrasonic wave at
frequency of 40hz from the transmitter and the receiver will wait for the wave to return. once
the wave is returned after it getting reflected by any object the echo pin goes high for a
particular amount of time which will be equal to the time taken for the wave to return back to
the sensor.
the amount of time during which the echo pin stays high is measured by the mcu/mpu as it
gives the information about the time taken for the wave to return back to the sensor. using
this information the distance is measured as explained in the above heading.
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
xxxii
BREAD BOARD:-
What is Breadboard?
Breadboard Basics:
A breadboard is a circuit which if of a temporary nature used for the purpose of testing
and prototyping circuits. It is easy to prototype circuits with the help of breadboards
because it is fast and easy. Breadboards are generally used to test circuits. As this device
have holes in it. In order to form a circuit, wires are inserted simply inside the holes. An
advantage of using a breadboard is that the positions of the wires can be changed if they
are placed in a wrong order. In the below diagram you can see alphabets are used in order
to identify vertical columns and numbers are used in order to identify vertical columns.
xxxiii
.
Breadboard Connections:
A breadboard as mentioned before is used to make temporary circuit for testing and other
purposes. The advantage of using a breadboard for testing is that connection can be
changed if they are wrong. Also the parts of the circuit do not get damaged and can easily
be reused. A breadboard generally consists of lots of holes so that wires can easily be
pushed in. testing for almost every electronic projects starts from the breadboard. The
breadboard has many tiny sockets likes holes arranged in a 0.1 grid. The leads that most
elements have can easily be pushed inside these holes. The ICs are pushed inside across to
the gap with their dot on the left. Standard wires cannot be used for breadboard as they get
damaged easily and hence they require single core plastic coated wires that have 0.6mm
diameter. Standard wires if used can also lead to damage of the board .
xxxiv
JUMPER WIRES
jumper wires are used for making connections between items on your breadboard and your
arduino‟s header pins. use them to wire up all your circuits!
USB CABLE
xxxv
this is a standard a-b usb cable. it can be used to connect your computer to arduinos that use a
full-sized b-type usb connection, such as the uno and mega2560.
9V BATTERY
use a 9v battery with your arduino projects to provide a higher-current power supply for
things like motors. you can also feed 9v power into your arduino‟s dc barrel jack using 9v
battery clip with a jack to get a regulated 5v from the internal regulator.
9V BATTERY CLIP
xxxvi
use a 9v battery clip to easily connect your 9v battery to your arduino. use one with leads to
connect your battery directly to a breadboard or the vin pin on the arduino. you can also buy
a clip with a barrel jack for plugging directly into the arduino‟s barrel jack (shown above)
buy a 9v battery clip with a barrel jack connector from amazon, adafruit or sparkfun.
buy a 9v battery clip with leads from newark.
RED LED
an average 5mm red led has a 2v forward voltage drop, and a forward current of 20ma. don‟t
forget to use a current-limiting resistor when you connect an led to your arduino!
xxxvii
CODE
// Arduino programming
#define trigpin 7
#define echopin 6
int led1 = A0;
int led2 = A1;
int led3 = A2;
int led4 = A3;
int led5 = A4;
void setup()
{
Serial.begin(9600);
pinMode(trigpin, OUTPUT);
pinMode(echopin, INPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
delay(1000);
}
void loop()
{
int duration, distance;
digitalWrite(trigpin, HIGH);
delayMicroseconds(1000);
digitalWrite(trigpin, LOW);
duration = pulseIn(echopin,HIGH);
distance = ( duration / 2) / 29.1;
Serial.println("cm:");
Serial.println(distance);
if( (distance > 0) && (distance <= 10) )
{
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
} else
if( (distance > 10) && (distance <= 20) )
{
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
xxxviii
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
} else
if( (distance > 20) && (distance <= 30) )
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
} else
if( (distance > 30) && (distance <= 40) )
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
} else
if( (distance > 50) && (distance <= 60) )
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, HIGH);
} else
if( distance > 60 )
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
}
xxxix
CONNECTIONS
ULTRA SONIC SENSOR CONNECTION WITH AURDINO
1. Vcc 5v pin
xl
OUTPUT
1. AFTER CONNECTIONS ARE COMPLETED
xli
xlii
xliii
CONCLUSION
xliv