Sie sind auf Seite 1von 9

CHAPTER THREE

TECHNOLOGY USED

In this chapter, all the components used to design the system are explained, giving details of all
the specifications, technologies and particulars about each of them.

3.1 ARDUINO
Arduino is a small microcontroller board with a USB plug to connect to computer. It has number
of connection sockets that can be wired up to external electronics, such as motors, relays, light
sensors etc. They can either be powered through the USB connection from the computer or from
a 12V battery. They can be controlled from the computer or programmed by the computer and then
disconnected and allowed to work independently.

3.1.1 TYPES OF ARDUINO


There are several Arduino models available depending on the features and I/O
ports available. The most interesting ones are:
(i) Arduino Uno: It is the standard Arduino member, which uses 8 bit
microcontroller ATmega328. It has 32 kb Flash memory, 2 kb RAM, 16 MHz,
1 serial port, 6 analog I/O ports and 13 digital ports.
(ii) Arduino Ethernet: It has the same functionality as that of the normal one
but also includes Ethernet connectivity as an additional feature.
(iii) Arduino Nano: It has a bit less features but its greatest advantage is that it
is so small.
(iv) Arduino BT: It has the same functionality as that of the normal one but also
includes Bluetooth connectivity as an additional feature.
(v) Arduino Mega: It is the one of the biggest one of the Arduino family, and is
based on ATmega2560. It has 54 digital input/output pins (of which 16 can be
used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports) and
a 16MHz crystal oscillator.

3.1.2 ARDUINO MEGA 2560


The Arduino Mega 2560 is a microcontroller board based on the ATmega 2560. It has 54 digital
input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs
(hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP
header and a reset button. It contains everything needed to support the microcontroller. It is simply
connected to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get
started. A typical Arduino mega board is shown in Fig. 3.1 and its technical specifications are
described in Table 3.1.

Fig. 3.1
Arduino
Mega

Microcontroller Development Board

Table 3.1 Technical Features of Arduino Mega 2560

FEATURES DESCRIPTION
Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 54 (of which 15 provide PWM output)
Analog Input Pins 16
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB of which 8 KB used by boot loader
SRAM 8 KB
EEPROM 4 KB
Clock Speed 16 MHz
3.1.2.1 Pin Description
Arduino Mega has 54 digital input/output pins 16 analog pins. Different pins classified according
to their function are shown in Fig. 3.2.

ATmega
2560

Fig. 3.2 Pin out Description of Arduino Mega 2560

3.1.2.2 Power
The Arduino Mega can be powered via USB connection or with an external power supply. The
power source is selected automatically. External (non-USB) power can be given either from an
AC-to-DC adapter or battery. The adapter can be connected by plugging a 2.1 mm centre-positive
plug into the board's power jack. Leads from a battery can be inserted in the GND and Vin pin
headers of the POWER connector. The board can operate on an external supply of 6 to 20 volts. If
supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may
be unstable. If using more than 12V, the voltage regulator may overheat and damage the board.
The recommended range is 7-12 volts.

The power pins are as follows:


(i) VIN: It is the input voltage to the Arduino board when it is using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source). Voltage
can be supplied through this pin.
(ii) 5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7-12V), the USB connector (5V), or
the VIN pin of the board (7-12V).
(iii) 3V3: A 3.3 volt supply is generated by the on-board regulator. Maximum current drawn is
50 mA.
(iv) GND: Ground pins.
(v) IOREF: This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs for working
with 5V or 3.3V.

3.1.2.3 Memory
The ATmega2560 has 256 KB of flash memory for storing code (of which 8 KB is used for the
boot loader), 8 KB of SRAM and 4 KB of EEPROM (which can be read and written with the
EEPROM library).

3.1.2.4 Input and Output


Each of the 54 digital pins on the Mega can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive
a maximum of 40mA and has an internal pull-up resistor (disconnected by default) of 20-50 kΩ.
In addition, some pins have specialized functions as listed below:
(i) Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and 16 (TX);
Serial 3: 15 (RX) and 14 (TX) are used to receive (RX) and transmit (TX) TTL serial data.
Pins 0 and 1 are also connected to the corresponding pins of the ATmega16U2 USB-to-
TTL Serial chip.
(ii) External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20
(interrupt 3), and 21 (interrupt 2). These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge or a change in value.
(iii) PWM: 2 to 13 and 44 to 46, provide 8-bit PWM output with the analogWrite()function.
(iv) SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication
using the SPI library. The SPI pins are also broken out on the ICSP header which is
physically compatible with the Uno, Duemilanove and Diecimila.
(v) LED13: 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.
(vi) TWI: 20 (SDA) and 21 (SCL) support TWI communication using the Wire library.
The Mega2560 has 16 analog inputs, each of which provides 10 bits of resolution (i.e. 1024
different values). By default they measure from ground to 5 volts, though it is possible to change
the upper end of their range using the AREF pin and analogReference() function.

There are a couple of other pins on the board:


(i) AREF: It is Reference voltage for the analog inputs, Used with analogReference().
(ii) Reset: Bring this line LOW to reset the microcontroller. It is typically used to add a reset
button to shields which block the one on the board.

3.1.2.5 Communication
The Arduino Mega2560 has a number of facilities for communicating with a computer, another
Arduino or other microcontrollers. The ATmega2560 provides four hardware UARTs for TTL
(5V) serial communication. The Arduino software includes a serial monitor which allows simple
textual data to be sent to and from the board. The RX and TX LEDs on the board will flash when
data is being transmitted via the ATmega8U2/ATmega16U2 chip and USB connection to the
computer (but not for serial communication on pins 0 and 1). A software serial library allows for
serial communication on any of the Mega 2560 digital pins. The ATmega2560 also supports TWI
and SPI communication. The Arduino software includes a Wire library to simplify use of the TWI
bus.

3.1.2.6 Programming
The Arduino Mega can be programmed with the Arduino software. The ATmega2560 on the
Arduino Mega comes pre burned with a boot loader that allows to upload new code to it without
the use of an external hardware programmer. It communicates using the original STK500 protocol.
One can also bypass the boot loader and program the microcontroller through the ICSP (In-Circuit
Serial Programming) header using Arduino ISP.

3.1.2.7 Automatic (Software) Reset


Rather than requiring a physical press of the reset button before an upload, the Arduino Mega2560
is designed in a way that allows it to be reset by software running on a connected computer. One
of the hardware flow control lines (DTR) of the ATmega8U2 is connected to the reset line of the
ATmega2560 via a 100nF capacitor. When this line is low, the reset line drops long enough to
reset the chip. The Arduino software uses this capability to allow one to upload code by simply
pressing the upload button in the Arduino environment. This means that the bootloader can have
a shorter timeout, as the lowering of DTR can be well-coordinated with the start of the upload.

3.1.2.8 USB Over Current Protection


The Arduino Mega2560 has a resettable poly fuse that protects computer's USB ports from shorts
and over current. Although most computers provide their own internal protection, the fuse provides
an extra layer of protection. If more than 500mA is applied to the USB port, the fuse will
automatically break the connection until the short or overload is removed.

3.2 POWER SUPPLY


It is an electronic device which supplies electrical energy to electrical load. In this work, dc power
supply from bridge rectifier is used as power source for all components. The input to the circuit is
applied from the regulated power supply. The ac input i.e., 230V from the mains supply is step
down by the two transformer to 12V 1amp (for servo driving) and 12 volt .5 amp (Arduino and
Sensors) is fed to a rectifier. To overcome problem of overload two different power supply 5V, 1
Amp and 5V, 0.5 Amp is used in the project. The output obtained from the rectifier is a pulsating
dc voltage in order to get a pure dc voltage, the output voltage from the rectifier is fed to a filter to
remove any ac components present even after rectification. Now, this voltage is given to a voltage
regulator (IC 7805) of 5 volt to obtain a pure constant dc voltage of 5 volt.

3.6 ULTRASONIC SENSOR


The HC-SR04 ultrasonic sensor uses sonar waves to determine distance to an object like bats do.
It offers excellent non-contact range detection with high accuracy and stable readings in an easy-
to-use package (from 2cm to 400cm or 1” to 13ft). Its operation is not affected by sunlight or black
material like Sharp rangefinders are (although acoustically soft materials like cloth can be difficult
to detect). It is an assembly of ultrasonic transmitter and receiver module as shown in Fig. 3.8.

TRANSMITTER RECEIVER
(a)
(b)
Fig. 3.8
HC-
SR04 Ultrasonic Sensor (a) Top View (b) Bottom View
The main features of HC-SR04 are listed as follows:
 Power Supply : +5V DC
 Quiescent Current : <2mA
 Working Current: 15mA
 Effectual Angle: <15°
 Ranging Distance : 2cm – 400 cm/1" - 13ft
 Resolution : 0.3 cm
 Measuring Angle: 30 degree
 Trigger Input Pulse width: 10uS
 Dimension: 45mm x 20mm x 15mm

The pin description of the ultrasonic sensor HC-SR04 is:


 VCC: +5VDC
 Trig : Trigger (INPUT)
 Echo: Echo (OUTPUT)
 GND: GND

This system typically uses a transducer which generates sound waves in the ultrasonic range, above
18 kHz, by converting electrical energy into sound known as a chirp. Then upon receiving the
echo, converts the sound waves into electrical energy which can be measured and displayed as
shown in Fig. 3.9.
Fig. 3.9 Working of Ultrasonic Sensor

3.6 SOFTWARE USED


ARDUINO SOFTWARE

The Arduino developers provide the Arduino integrated development environment (IDE), which
is a cross-platform application written in the programming language Java. It originated from the
IDE for the languages processing and Wiring. It is designed to introduce programming to artists
and other newcomers unfamiliar with software development. It includes a code editor with features
such as syntax highlighting, brace matching, and automatic indentation, and provides simple one-
click mechanism to compile and load programs to an Arduino board. A program written with the
IDE for Arduino is called a "sketch".

The Arduino IDE supports the languages C and C++ using special rules to organize code. The
Arduino IDE supplies a software library called Wiring from the Wiring project, which provides
many common input and output procedures. A typical Arduino C/C++ sketch consists of two
functions that are compiled and linked with a program. Arduino IDE employs the
program avrdude to convert the executable code into a text file in hexadecimal coding that is
loaded into the Arduino board by a loader program in the board's firmware.

After making deep study about the controller, components, sensors and modules the
hardware and software implementation part is designed which are needed for the proposed system.
The detailed step by step procedure for development of hardware and software with Arduino mega
2560 microcontroller board, sensor modules and circuitry will be explained in the next chapter.

Das könnte Ihnen auch gefallen