BLOCK DIAGRAM AND DISCRIPTION
BLOCK DIAGRAM :
HARDWARE DISCRIPTION
INTRODUCTION TO AURDINO UNO
ARDUINO
KEYBOARD
UNO
DHT-11
LCD
TEMPERATURE
SENSOR
MOISTURE
SENSOR
Arduino is an open-source electronics platform based on easy-to-use hardware
and software. Arduino boards are able to read inputs - light on a sensor, a
finger on a button, or a Twitter message - and turn it into an output - activating
a motor, turning on an LED, publishing something online.
The Arduino UNO has only 32K bytes of Flash memory and 2K bytes of
SRAM. That is more than 100,000 times LESS physical memory than a low-end
PC! And that's not even counting the disk drive! Working in this minimalist
environment,you must use your resources wisely.
Arduino Uno has 14 digital input/output pins (out of which 6 can be used as
PWM outputs), 6 analog input pins, a USB connection, A Power barrel jack, an
ICSP header and a reset button.
ARDUINO UNO PIN DIAGRAM
Arduino can input and output analog signals as well as digital signals. An
analog signal is one that can take on any number of values, unlike a digital
signal which has only two values: HIGH and LOW The function used to output
a PWM signal is analog Write (pin, value). pin is the pin number used for the
PWM output.
Arduino Uno Pinout Configuration
Pin Category Pin Name Details
Power Vin, 3.3V, 5V, Vin: Input voltage to Arduino when using an external power source.
GND
5V: Regulated power supply used to power microcontroller and other
components on the board.
3.3V: 3.3V supply generated by on-board voltage regulator. Maximum
current draw is 50mA.
GND: ground pins.
Reset Reset Resets the microcontroller.
Analog Pins A0 – A5 Used to provide analog input in the range of 0-5V
Input/Output Digital Pins 0 - Can be used as input or output pins.
Pins 13
Serial 0(Rx), 1(Tx) Used to receive and transmit TTL serial data.
External 2, 3 To trigger an interrupt.
Interrupts
PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.
SPI 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK) Used for SPI communication.
Inbuilt LED 13 To turn on the inbuilt LED.
TWI A4 (SDA), A5 (SCA) Used for TWI communication.
AREF AREF To provide reference voltage for input voltage.
Arduino Uno Technical Specifications
Microcontroller ATmega328P – 8 bit AVR family microcontroller
Operating Voltage 5V
Recommended Input Voltage 7-12V
Input Voltage Limits 6-20V
Analog Input Pins 6 (A0 – A5)
Digital I/O Pins 14 (Out of which 6 provide PWM output)
DC Current on I/O Pins 40 mA
DC Current on 3.3V Pin 50 mA
Flash Memory 32 KB (0.5 KB is used for Bootloader)
SRAM 2 KB
EEPROM 1 KB
Frequency (Clock Speed) 16 MHz
How to use Arduino Board
The 14 digital input/output pins can be used as input or output pins by using pinMode(),
digitalRead() and digitalWrite() functions in arduino programming. Each pin operate at 5V
and can provide or receive a maximum of 40mA current, and has an internal pull-up resistor
of 20-50 KOhms which are disconnected by default. Out of these 14 pins, some pins have
specific functions as listed below.
• Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL serial
data. They are connected with the corresponding ATmega328P USB to TTL serial chip.
• External Interrupt Pins 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.
• PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using
analogWrite() function.
• SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI
communication.
• In-built LED Pin 13: This pin is connected with a built-in LED, when pin 13 is HIGH –
LED is on and when 13 pin is LOW, it’s off. Along with 14 Digital pins, there are 6 analog
input pins, each of which provides 10 bits of resolution, i.e. 1024 different values. They
measure from 0 to 5 volts but this limit can be increased by using AREF pin with
analogReference() function.
Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using Wire library.
Arduino Uno has a couple of other pins as explained below:
• AREF: Used to provide reference voltage for analog inputs with analogReference()
function.
• Reset Pin: Making this pin LOW, resets the microcontroller
COMMUNICATION
The Arduino/Genuino Uno has a number of facilities for communicating with a computer,
another Arduino/Genuino board, or other microcontrollers. The ATmega328 provides UART
TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX).
An ATmega16U2 on the board channels this serial communication over USB and appears as a
virtual com port to software on the computer. The 16U2 firmware uses the standard USB
COM drivers, and no external driver is needed. However, on Windows, a.inf file is required.
Arduino Software (IDE) 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 USB-to-serial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1). A Software Serial library allows serial communication on
any of the Uno's digital pins.
Arduino is an open-source electronics platform based on easy-to-use hardware and software.
Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter
message - and turn it into an output - activating a motor, turning on an LED, publishing
something online.
Functions allow structuring the programs in segments of code to perform individual tasks.
The typical case for creating a function is when one needs to perform the same action
multiple times in a program. Functions help the programmer stay organized.
KEYBOARD
A keyboard used to connect with an Arduino in a hardware project typically refers to a
physical input device that allows users to send commands or data to the Arduino
microcontroller. Here's a breakdown of its components and functionalities:
The keyboard could be a standard computer keyboard or a keypad specifically designed for
Arduino projects. It consists of keys arranged in rows and columns, each representing a
specific character, number, or function.
To connect the keyboard to the Arduino, you would typically use one of the digital or analog
input/output pins on the Arduino board. Keyboards can be connected using various interfaces
such as USB, PS/2, or even through serial communication depending on the type of keyboard
you're using.
Depending on the type of keyboard, you might need to implement a specific communication
protocol to interpret the signals sent by the keyboard. For example, USB keyboards require
decoding USB HID (Human Interface Device) protocol, while PS/2 keyboards use a different
protocol.
When a key is pressed on the keyboard, it sends a signal to the Arduino indicating which key
was pressed. The Arduino then processes this input and performs the desired actions based on
the programmed logic.
The Arduino microcontroller processes the input from the keyboard using the code you've
written. This could involve tasks such as reading which key was pressed, debouncing (if
necessary), and executing corresponding actions or sending data to other components of your
hardware project.
The keyboard input can be integrated into various types of hardware projects. For example,
you could use it to control a robot, enter data into a digital display, or interact with a game or
application running on the Arduino.
DHT-11 TEMPERATURE SENSOR
Connecting a DHT11 temperature and humidity sensor to an Arduino is a straightforward
process. The DHT11 sensor typically has four pins: VCC, Data, Not Connected (NC), and
Ground (GND).
VCC (POWER):Connect the VCC pin of the DHT11 to a 5V pin on the Arduino. This
provides power to the sensor.
DATA: Connect the Data pin of the DHT11 to any digital input/output pin on the Arduino.
This pin is used for data communication between the sensor and the Arduino.
NET CONNECTED (NC): This pin is not used, so you can leave it unconnected.
GROUND (GND): Connect the GND pin of the DHT11 to a ground (GND) pin on the
Arduino. This completes the circuit and provides a common ground reference.
The DHT11 is a basic, low-cost digital temperature and humidity sensor. In hardware terms,
it's a small module typically featuring a black rectangular housing with four pins for
connection: VCC, data out, not connected (NC), and ground (GND).
Inside the module, there's a sensor chip responsible for measuring both temperature and
humidity. It consists of a humidity sensing component and a thermistor (temperature sensor).
The module incorporates a microcontroller or a custom ASIC (Application-Specific
Integrated Circuit) responsible for handling communication protocols and converting the
analog signals from the sensors into digital data.
The sensor outputs analog signals proportional to the temperature and humidity. Signal
conditioning circuitry is used to amplify and stabilize these signals for accurate readings.
The DHT11 is a straightforward sensor module suitable for basic temperature and humidity
monitoring applications in various projects. Its simplicity, low cost, and ease of use make it
popular among hobbyists and enthusiasts.
MOISTURE SENSOR
A moisture sensor is a device used to measure the moisture content in a material, such as soil,
air, or building materials. These sensors are essential tools in agriculture, weather monitoring,
construction, and various other fields where monitoring moisture levels is crucial.
COMPONENTS
PROBE AND SENSOR ELEMENT: The main component of a moisture sensor is the
sensing element, which comes in direct contact with the material being measured. This
element may consist of conductive or resistive materials that change their electrical properties
based on moisture levels.
WIRING AND CONNECTORS: Moisture sensors typically have wires or connectors for
interfacing with measurement devices, such as microcontrollers or data loggers. These
connections facilitate the transfer of electrical signals generated by the sensing element.
ENCLOSURE: Some moisture sensors may come with an enclosure or protective housing to
shield the sensing element from environmental factors such as dust, moisture, and mechanical
damage. Enclosures can help prolong the sensor's lifespan and ensure accurate measurements.
LCD
LCD (Liquid Crystal Display) is a type of flat panel display which uses liquid crystals in its primary form
of operation. LCD (Liquid Crystal Display) is a type of flat panel display which uses liquid crystals in its
primary form of operation.
LEDs have a large and varying set of use cases for consumers and businesses, as they can be
commonly found in smartphones, televisions, computer monitors and instrument panels.
LCDs were a big leap in terms of the technology they replaced, which include light-emitting diode
(LED) and gas-plasma displays. LCDs allowed displays to be much thinner than cathode ray tube (CRT)
technology. LCDs consume much less power than LED and gas-display displays because they work on
the principle of blocking light rather than emitting it. Where an LED emits light, the liquid crystals in
an LCD produces an image using a backlight.
As LCDs have replaced older display technologies, LCDs have begun being replaced by new display
technologies such as OLEDs.
Sr.
Pin No. Pin Name Pin Type Pin Description Pin Connection
No
Connected to the
This is a ground pin of
1 Pin 1 Ground Source Pin ground of the MCU/
LCD
Power source
Connected to the
This is the supply voltage
2 Pin 2 VCC Source Pin supply pin of Power
pin of LCD
source
Connected to a variable
Adjusts the contrast of the
3 Pin 3 V0/VEE Control Pin POT that can source 0-
LCD.
5V
Connected to a MCU
pin and gets either 0 or
Toggles between 1.
4 Pin 4 Register Select Control Pin
Command/Data Register
0 -> Command Mode
1-> Data Mode
Connected to a MCU
pin and gets either 0 or
Toggles the LCD between 1.
5 Pin 5 Read/Write Control Pin
Read/Write Operation
0 -> Write Operation
1-> Read Operation
Must be held high to
Connected to MCU and
6 Pin 6 Enable Control Pin perform Read/Write
always held high.
Operation
In 4-Wire Mode
Only 4 pins (0-3) is
Pins used to send connected to MCU
Data/Command
7 Pin 7-14 Data Bits (0-7) Command or data to the
Pin In 8-Wire Mode
LCD.
All 8 pins(0-7) are
connected to MCU
Normal LED like
8 Pin 15 LED Positive LED Pin operation to illuminate the Connected to +5V
LCD
Normal LED like
operation to illuminate the
9 Pin 16 LED Negative LED Pin Connected to ground
LCD connected with
GND.
PIN CONFIGURATION
Features of 16×2 LCD module
• Operating Voltage is 4.7V to 5.3V
• Current consumption is 1mA without backlight
• Alphanumeric LCD display module, meaning can display alphabets and numbers
• Consists of two rows and each row can print 16 characters.
• Each character is build by a 5×8 pixel box
• Can work on both 8-bit and 4-bit mode
• It can also display any custom generated characters
• Available in Green and Blue Backlight
6x2 Display Equivalents
Dot Matrix LED Display, 7-Segment LED Display, OLED Display, TFT LCD Screen Display
Brief Description on LCD modules
LCD modules are very commonly used in most embedded projects, the reason being its cheap
price, availability and programmer friendly. Most of us would have come across these
displays in our day to day life, either at PCO’s or calculators. The appearance and the pinouts
have already been visualized above now let us get a bit technical.
16×2 LCD is named so because; it has 16 Columns and 2 Rows. There are a lot of
combinations available like, 8×1, 8×2, 10×2, 16×1, etc. but the most used one is the 16×2
LCD. So, it will have (16×2=32) 32 characters in total and each character willbe made of 5×8
Pixel Dots. A Single character with all its Pixels is shown in the below picture.
Now, we know that each character has (5×8=40) 40 Pixels and for 32 Characters we will have
(32×40) 1280 Pixels. Further, the LCD should also be instructed about the Position of the
Pixels. Hence it will be a hectic task to handle everything with the help of MCU, hence an
Interface IC like HD44780is used, which is mounted on the backside of the LCD Module
itself.
The function of this IC is to get the Commands and Data from the MCU and process them to
display meaningful information onto our LCD Screen. You can learn how to interface an
LCD using the above mentioned links. If you are an advanced programmer and would like to
create your own library for interfacing your Microcontroller with this LCD module then you
have to understand the HD44780 IC is working and commands which can be found its
datasheet.
2D model of 16×2 LCD modul
Component Datasheet
16x2 LCD Datasheet
SOFTWARE DESCRIPTION
Arduino IDE
The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a
text editor for writing code. It connects to the Arduino and Genuine hardware to upload
programs and communicate with them.
Programs written using Arduino Software (IDE) are called sketches. These sketches are
written in the text editor and are saved with the file extension.
The editor has features for cutting and forsearching/replacing text. The message area gives
feedback while saving and exporting and also displays errors.
The console displays text output by the Arduino Software (IDE), including complete error
messages and other information.
Libraries provide extra functionality for use in sketches, e.g. working with hardware or
manipulating data. #include statements will insert one or more at the top of the sketch and
compiles the library with your sketch.
Because libraries are uploaded to the board with your sketch, they increase the amount of
space it takes up. If a sketch no longer needs a library, simply delete its #include statements
from the top of your code. If you want to program your Arduino Uno while offline you need
to install the Arduino Desktop (IDE)
The Uno is programmed using the Arduino Software (IDE), our Integrated Development
Environment common to all our boards.Before you can move on, you must have installed the
Arduino Software (IDE) on your
The serial monitor displays serial sent from the Arduino or Genuine boardover USB or serial
connector. To send data to the board, enter text and click on the "send" button or press enter.
Note that on Windows, Mac or Linux the board will reset (it will rerun your sketch) when you
connect with the serial monitor.
Please note that the External terminal program and connect it to the COM port assigned to
your Arduino board Serial Monitor does not process control characters; if your sketch needs a
complete management of the serial communication with control characters, you can use an
SERIAL MONITOR
ARDUINO
Arduino was born at the Interaction Design Institute as an easy tool for fast prototyping,
aimed at students without a background in electronics and programming. As soon as it
reached a wider community, the Arduino board started changing to adapt to new needs and
challenges, differentiating its offer from simple 8-bit boards to products for IOT applications,
wearable, 3D printing, and embedded environments.
All Arduino boards are completely open-source, empowering users to build them
independently and eventually adapt them to their particular needs.
ARDUINO SETUP AND INSTIALLISATION
The Uno is programmed using the Arduino Software (IDE).Connect your Uno board with an
USB cable.
If you want to program your Arduino Uno while offline you need to install the Arduino
Desktop IDE. The Uno is programmed using the Arduino Software (IDE), our Integrated
Development Environment common to all our boards.
Before you can move on, you must have installed the Arduino Software (IDE) on your PC, as
explained in our introduction.
Connect your Uno board with an A B USB cable; The USB connection with the PC is
necessary to program the board and not just to power it up. The Uno automatically draw
power from either the USB or an external power supply. Connect the board to your computer
using the USB cable.
arduino uno and usb cable
If you used the Installer, Windows from XP up to 10 will install drivers automatically as soon
as you connect your board. If you downloaded you need to follow the procedure step by step
• Click on the Start Menu, and open up the Control Panel.
While in the Control Panel, navigate to System and Security. Next, click on System. Once the
System window is up, open the Device Manager.
• Look under Ports (COM & LPT). You should see an open port named "Arduino UNO
(COMxx)". If there is no COM & LPT section, look under "Other Devices" for "Unknown
Device".
• Right click on the "Arduino UNO (COMxx)" port and choose the "Update Driver Software"
option. • Next, choose the "Browse my computer for Driver software" option.
• Finally, navigate to and select the driver file named "arduino.inf", located in the "Drivers"
folder of the Arduino Software download not the "FTDI USB Drivers" sub-directory. If you
are using an old version of the IDE older one, choose the Uno driver file named
"ArduinoUNO.inf"
• Windows will finish up the driver installation from there.
Open your first sketch
Open the LED blink example sketch: File > Examples >01.Basics > Blink.
UNO blink
Select your board type and port
UNO board type port
You’ll need to select the entry in the tools>board menu that corresponds to your arduino
board.
Select the serial device of the board from the Tools | Serial Port menu. This is likely to be
COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find
out, you can disconnect your board and re-open the menu; the entry that disappears should be
the Arduino board. Reconnect the board and select that serial port Upload the program.
A few seconds after the upload finishes, you should see the pin 13 (L) LED on the board start
to blink (in orange). If it does, congratulations. You've gotten Arduino up-and-running. If you
have problems on uploading programs to the Arduino.
Here are some specific suggestions for troubleshooting each of the pieces. They include: the
drivers for the board, the board and serial port selections in the Arduino software, access to
the serial port, the physical connection to the board, the firmware on the Uno and Mega 2560,
the boot loader on the main microcontroller on the board.
Some specific suggestions for troubleshooting each of the pieces are as follows:
Arduino software, drivers, Access to the serial port, physical connection, auto-reset, boot
loader are some of the trouble shooters.
Arduino Software
Make sure you have the right item selected in the Tools>Board menu. If you have an Arduino
Uno, you'll need to choose it. Also, newer Arduino boards come with an ATmega328, while
older ones have an ATmega168.
To check, read the text on the microcontroller (the larger chip) on your Arduino board Then,
check that the proper port is selected in the Tools>SerialPort menu (if your port doesn't
appear, try restarting the IDE with the board connected to the computer) On Windows, it will
be a COM port but you'll need to check in the Device Manager (under Ports) to see which
one.
If you don't seem to have a serial port for your Arduino board, see the following information
about drivers.
Drivers
Drivers provide a way for software on your computer (i.e. the Arduino software) to talk to
hardware you connect to your computer (the Arduino board). The Arduino on Windows, if the
software is slow to start or crashes on launch, or the Tools menu is slow to open, you may
need to disable Bluetooth serial ports or other networked COM ports in the Device Manager.
The Arduino software scans all the serial (COM) ports on your computer when it starts and
when you open the Tools menu, and these networked ports can sometimes cause large delays
or crashes.
Physical Connection
First make sure your board is on (the green LED is on) and connected to the computer.
The Arduino Uno and Mega 2560 may have trouble connecting to a Mac through a USB hub.
If nothing appears in your "Tools > Serial Port" menu, try plugging the board directly to your
computer and restarting the Arduino IDE.
Disconnect digital pins 0 and 1 while uploading as they are shared with serial
communication with the computer Try uploading with nothing connected to the board Make
sure the board isn't touching anything metallic or conductive.
Auto-Reset
If you have a board that doesn't support auto-reset, be sure that you are resetting the board a couple of
seconds before uploading However, on some computers, you may need to press the reset button on the
board after you hit the upload button in the Arduino environment.
Try different intervals of time between the two, up to 10 seconds or more.
DEVELOPING THE CODE