You are on page 1of 18

Chapter Three

3.1 Development the electronic circuits


The last century was to designed and achieves electronic circuits should be specific
use or purpose then required a lot of cost and time to achievement rather than it
can’t modified on it ,then the revelation happen by development the electronic
circuit through Italians company by created a different kinds of electronic circuits
called (Arduino microcontroller).

3.2 Discretion of microcontroller


A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on
a single integrated circuit containing a processor core, memory, and
programmable input/output peripherals. Program memory in the form
of Ferroelectric RAM, NOR flash or OTP ROMis also often included on chip, as
well as a typically small amount of RAM. Microcontrollers are designed for
embedded applications, in contrast to the microprocessors used in personal
computers or other general purpose applications.

Microcontrollers are used in automatically controlled products and devices, such as


automobile engine control systems, implantable medical devices, remote controls,
office machines, appliances, power tools, toys and other embedded systems. By
reducing the size and cost compared to a design that uses a separate
microprocessor, memory, and input/output devices, microcontrollers make it
economical to digitally control even more devices and processes. Mixed
signal microcontrollers are common, integrating analog components needed to
control non-digital electronic systems.

Some microcontrollers may use four-bit words and operate at clock rate frequencies


as low as 4 kHz, for low power consumption (single-digit milliwatts or

9
microwatts). They will generally have the ability to retain functionality while
waiting for an event such as a button press or other interrupt; power consumption
while sleeping (CPU clock and most peripherals off) may be just nanowatts,
making many of them well suited for long lasting battery applications. Other
microcontrollers may serve performance-critical roles, where they may need to act
more like a digital signal processor (DSP), with higher clock speeds and power
consumption.

The heart of Adriano is a microcontroller. Practically everything else on the board


is concerned with providing the board with power and allowing it to communicate
with desktop computers, what exactly do get when buy one of these little
computers to use in the projects.
The answer is that really do get a little computer on a chip. It has everything and
more than the first home computers had. It has a processor, a kilobyte of random
access memory (RAM) for holding data, a few kilobytes of erasable programmable
read-only memory (EPROM) or Flash memory for holding our programs, and it has
input and output pins. These input/output pins are what link the microcontroller to
the rest of our electronics. Inputs can read both digital (is the switch on or off) and
analog (what is the voltage at a pin).

This enables us to connect many different types of sensors for light, temperature,
sound, etc. Outputs can also be analog or digital. So, you can set a pin to be on or
off (0V or 5V) and this can turn LEDs on and off directly, or you can use the output
to control higher-power devices such as motors. They can also provide an analog
output voltage. That is, you can set the output of a pin to some particular voltage,
allowing you to control the speed of a motor or the brightness of a light, for
example, rather than simply turning it on or off.

10
Figure (3.1) Types of microcontrollers

3.3 Introduction about arduino board


Arduino is an open-source platform used for building electronics projects. Arduino
consists of both a physical programmable circuit board (often referred to as
a microcontroller) and a piece of software, or IDE (Integrated Development
Environment) that runs on your computer, used to write and upload computer code
to the physical board.

The Arduino platform has become quite popular with people just starting out with
electronics, and for good reason. Unlike most previous programmable circuit
boards, the Arduino does not need a separate piece of hardware (called a
programmer) in order to load new code onto the board – you can simply use a USB
cable. Additionally, the Arduino IDE uses a simplified version of C++, making it
easier to learn to program. Finally, Arduino provides a standard form factor that
breaks out the functions of the micro-controller into a more accessible package.

11
Arduino is a tool for making computers that can sense and control more of the
physical world than your desktop computer. It's an open-source physical computing
platform based on a simple microcontroller board, and a development environment
for writing software for the board.

Arduino can be used to develop interactive objects, taking inputs from a variety of
switches or sensors, and controlling a variety of lights, motors, and other physical
outputs. Arduino projects can be stand-alone, or they can communicate with
software running on your computer (e.g. Flash, Processing, MaxMSP.) The boards
can be assembled by hand or purchased preassembled; the open-source IDE can be
downloaded for free.

The Arduino programming language is an implementation of Wiring, a similar


physical computing platform, which is based on the Processing multimedia
programming environment.

3.4 Arduino Board

There are many other microcontrollers and microcontroller platforms available for
physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's
Handyboard, and many others offer similar functionality. All of these tools take the
messy details of microcontroller programming and wrap it up in an easy-to-use
package. Arduino also simplifies the process of working with microcontrollers, but
it offers some advantage for teachers, students, and interested amateurs over other
systems:

1) Inexpensive - Arduino boards are relatively inexpensive compared to other


microcontroller platforms. The least expensive version of the Arduino module can

12
be assembled by hand, and even the pre-assembled Arduino modules cost less than
$50.
2) Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and
Linux operating systems. Most microcontroller systems are limited to Windows.
3) Simple, clear programming environment - The Arduino programming
environment is easy-to-use for beginners, yet flexible enough for advanced users to
take advantage of as well. For teachers, it's conveniently based on the Processing
programming environment, so students learning to program in that environment
will be familiar with the look and feel of Arduino
4) Open source and extensible software- The Arduino software is published as
open source tools, available for extension by experienced programmers. The
language can be expanded through C++ libraries, and people wanting to understand
the technical details can make the leap from Arduino to the AVR C programming
language on which it's based. Similarly, you can add AVR-C code directly into
your Arduino programs if you want to.
5) Open source and extensible hardware - The Arduino is based on
Atmel's ATMEGA8 and ATMEGA168 microcontrollers. The plans for the
modules are published under a Creative Commons license, so experienced circuit
designers can make their own version of the module, extending it and improving it.
Even relatively inexperienced users can build the breadboard version of the module
in order to understand how it works and save money.The Uno is one of the more
popular boards in the Arduino family and a great choice for beginners. 

Figure (3.2) shown Adriano UNO board

13
Figure (3.3) shown software of Arduino

3.5 In this chapter over line the following


 What projects can be accomplished using an Arduino.
 What is on the typical Arduino board and why.
 The different varieties of Arduino boards.
 Some useful widgets to use with board Arduino.

3.6 Construction of the board


There are many varieties of Arduino boards that can be used for different purposes.
Some boards look a bit different from the one below, but most Arduinos have the
majority of these components in common:

14
Figure (2.4) Shawn construction of Adriano

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 that is terminated in a barrel jack. In the picture above the USB
connection is labeled  and the barrel jack is labeled .

The USB connection is also how is will load code onto your Arduino board. More
on how to program with Arduino can be found in this chapter. 

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.

Pins (5V, 3.3V, GND, Analog, Digital, PWM, AREF)


The pins on Arduino are the places where is connect wires to construct a circuit
(probably in conjunction with a bread-board 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.

15
 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  but for now, think of these pins as being able to simulate
analog output (like fading an LED in and out).
 AREF (9): Stands for Analog Reference. Most of the time 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
the Arduino has a reset button . 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.

16
Power LED Indicator
Just beneath and to the right of the word “UNO” on your circuit board, there’s a
tiny LED next to the word ‘ON’ . 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 .
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 .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.

Voltage Regulator
The voltage regulator  is not actually something 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
17
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.

3.7 The Arduino Family


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.

1) Arduino Uno (R3)


The Uno is a great choice for 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.

2) 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.

18
Figure (3.5) shown arduino Lily Pad

3) RedBoard
At SparkFun use many Arduinos and it is always looking for the simplest, most
stable one. Each board is a bit different and no one board has everything we want –
so decided to make 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
projects. Just plug in the board, select “Arduino UNO” from the board menu and
you’re ready to upload code. can power the RedBoard over USB or through the
barrel jack. The on-board power regulator can handle anything from 7 to 15VDC.

Figure (3.6) shown read board

19
4) 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 (like lots of LEDs or buttons).

Figure (3.7) shown Arduino mega board

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). 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 40 mA and has an internal pull-up resistor (disconnected by default)
of 20-50 kOhms. In addition, some pins have specialized functions.

20
5) Arduino Leonardo
The Leonardo is Arduino’s first development board to use one microcontroller with
built-in USB. This means that it can be cheaper and simpler. Also, because the
board is handling USB directly, code libraries are available which allow the board
to emulate a computer keyboard, mouse, and more.

Figure (3.8) shown Arduino Leonardo

3.8 The Extended Family


While Arduino board sure is multi uses, it can’t do a whole lot on its own –should
got to hook it up to something. There are lots of sources to learn, but rarely do we
talk about the general kinds of things can easily hook into. In this section we’ll
introduce basic sensors as well as Arduino shields, two of the handiest tools to use
in bringing projects to life.

21
Sensors
With some simple code, the Arduino can control and interact with a wide variety
of sensors - things that can measure
light, temperature, pressure, proximity, acceleration, carbon,monoxide, radioactivit
y, humidity, barometric.

Figure (3.9) shown types of Arduino sensors

Shields
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.

Figure (3.10) shown Arduino shields

22
3.9 DHT11 humidity and temperature sensor
The DHT11 Temperature & Humidity Sensor features a temperature &
humidity sensor complex with a calibrated digital signal output. By using the
exclusive digital-signal-acquisition technique and temperature & humidity sensing
technology, it ensures high reliability and excellent long-term stability. This sensor
includes a resistive-type humidity measurement component and an NTC
temperature measurement component, and connects to a high- performance 8-bit
microcontroller, offering excellent quality, fast response, anti-interference ability
and cost-effectiveness.

Figure (3.11) Represent DHT11 sensor

Single-bus data format is used for communication and synchronization between


MCU and DHT11 sensor. One communication process is about 4ms. Data consists
of decimal and integral parts. A complete data transmission is 40bit, and the sensor
sends higher data bit first. Data format: 8bit integral RH data + 8bit decimal RH
data + 8bit integral T data + 8bit decimal T data + 8bit check sum. If the data
transmission is right, the check-sum should be the last 8bit of "8bit integral RH
data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data”. When
MCU sends a start signal, DHT11 changes from the low-power-consumption mode
to the running-mode, waiting for MCU completing the start signal. Once it is
completed, DHT11 sends a response signal of 40-bit data that include the relative
23
humidity and temperature information to MCU. Users can choose to collect (read)
some data. Without the start signal from MCU, DHT11 will not give the response
signal to MCU. Once data is collected, DHT11 will change to the lowpower-
consumption mode until it receives a start signal from MCU again.

Figure (3.12) Represent DHT11 sensor response for data

3.10 Rain sensor model


A rain sensor or rain switch is a switching device activated by rainfall. There are
two main applications for rain sensors. The first is a water conservation device
connected to an automatic irrigation system that causes the system to shut down in
the event of rainfall. The second is a device used to protect the interior of an
automobile from rain and to support the automatic mode of windscreen wipers. An
additional application in professional satellite communications antennas is to
trigger a rain blower on the aperture of the antenna feed, to remove water droplets
from the molar cover that keeps pressurized and dry air inside the wave-guides.

Rain sensors for irrigation systems are available in both wireless and hard-wired
versions, most employing hygroscopic disks that swell in the presence of rain and
shrink back down again as they dry out — an electrical switch is in turn depressed
or released by the hygroscopic disk stack, and the rate of drying is typically
adjusted by controlling the ventilation reaching the stack. However, some electrical

24
type sensors are also marketed that use tipping bucket or conductance type probes
to measure rainfall. Wireless and wired versions both use similar mechanisms to
temporarily suspend watering by the irrigation controller — specifically they are
connected to the irrigation controller's sensor terminals, or are installed in series
with the solenoid valve common circuit such that they prevent the opening of any
valves when rain has been sensed.

Some irrigation rain sensors also contain a freeze sensor to keep the system from
operating in freezing temperatures, particularly where irrigation systems are still
used over the winter.

Figure (3.13) Represent rain sensor connection to arduino

3.11 Soil sensor model


Soil moisture sensors measure the volumetric water content in soil.[1] Since the
direct gravimetric measurement of free soil moisture requires removing, drying,
and weighting of a sample, soil moisture sensors measure the volumetric water
content indirectly by using some other property of the soil, such as electrical
resistance, dielectric constant, or interaction with neutrons, as a proxy for the
moisture content. The relation between the measured property and soil moisture

25
must be calibrated and may vary depending on environmental factors such as soil
type, temperature, or electric conductivity. Reflected microwave radiation is
affected by the soil moisture and is used for remote sensing in hydrology and
agriculture. Portable probe instruments can be used by farmers or gardeners.

Soil moisture sensors typically refer to sensors that estimate volumetric water
content. Another class of sensors measure another property of moisture in soils
called water potential; these sensors are usually referred to as soil water potential
sensors and include densitometers and gypsum blocks.Soil moisture sensors are
used in numerous research applications, e.g. in agricultural
science and horticulture including irrigation planning, climate research,
or environmental science including solute transport studies and as auxiliary sensors
for soil respiration measurements.

Measuring soil moisture is important for agricultural applications to help farmers


manage their irrigation systems more efficiently. Knowing the exact soil moisture
conditions on their fields, not only are farmers able to generally use less water to
grow a crop, they are also able to increase yields and the quality of the crop by
improved management of soil moisture during critical plant growth stages.

Figure (3.13) Represent soil sensor connection to arduino

26

You might also like