Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

UNDERSTANDING ARDUINO

A Beginner's Guide With Realtime Insights


And Tricks To Learn Arduino
Programming

By. John C. Richards


TABLE OF CONTENTS
WHY IS IT ADVANTAGEOUS TO USE ARDUINO

ARDUINO BOARDS (TYPES)

HOW TO CONNECT YOUR ARDUINO TO A COMPUTER

THE ARDUINO MEGA SERVER

PROGRAMMING LANGUAGES THAT ARDUINO USE

THE ARDUINO INTEGRATED DEVELOPMENT ENVIRONMENT

SOME OF THE ARDUINO PROJECTS THAT YOU CAN ATTEMPT

TROUBLESHOOTING ISSUES WITH ARDUINO

FAQS

CONCLUSION
INTRODUCTION
WHAT IS ARDUINO?
Arduino is a programmable multi-purpose electronic platform with its
hardware and software designed to run in an open-source environment. The
Arduino project started at Ivrea Interaction Design Institute in Italy, born out
of the need to have a fast and easy to use prototyping device.
The Arduino group is incharge of manufacturing and designing the single-
board microcontrollers and microcontroller kits capable of building up
various digital devices. The presence of input and output pins that can be
interfaced with various other expansions on Arduino boards provides
prototyping ability for this device.
To the non-technically oriented segments of our population, electronics and
programming may sound complicated but no cause for alarm because
Arduino was initially developed particularly for people with zero formal
knowledge in electronics and programming in mind. However, even in this
present age, the use of this indispensable gadget does not require special
skills in electronics and programming. Thus, anyone from hobbyist, artists,
designers, hackers, newbies, gamers, to technical experts can use various
architectures of Arduino that uniquely suit their individual purposes.
Arduino as a micro computer mainly comprises of hardware and software
parts, where its hardware come under a CC-BY-SA license, and the software
has the license of the GNU Lesser General Public License (LGPL). Hence, it
gives third party companies the privilege to manufacture and distribute
Arduino boards and software as long as the open-source licensing rights are
followed.
The Arduino boards are built with different serial communications interfaces
that can be connected to a computer to make programming easy on the board
using a simplified Arduino integrated development environment (IDE), as
well as a command-line tool.
Arduino board has become a useful tool to solve and manage day-to-day
tasks at various level of difficulty as a result of constant advancement and
evolution it has passed through over time. This is due in fact to how it has
distinguished its designs from the more traditional 8-bit boards. The Arduino
board has till this day been used for top-notch innovative technologies such
as 3D printing, Cloud computing, embedded environment, IoT applications
and wearable device.
Now Arduino can help us manage and control most of our complex daily
tasks such as LEDs, Motors, the internet, speakers, automated locks, cameras,
drones, GPS units, our smartphones since it is designed with the ability to
interact with them and many more.
For anyone passionate about creating an interactive environment or gadget,
the good news is that the Arduino projects are designed for this purpose for
you to exploit your world. It may interest you that there is no limitation to
what can be created, from building a personalised heating pad hand-warming
blankets to having your own fortune-telling machine. If you can dream it you
can create it with Arduino boards, virtually anything can be created.
Most of the Arduino boards are typically based on Atmel 8-bit AVR
microcontroller. In contrast, few recent boards are built using higher
configuration. They can be distinguished by how connection for
programming is carried out and the incorporation into other external circuits
with type and amount of flash memory, pins, and features, present or absent
of single roll, double roll pins or female headers.
Why is Arduino Popular?
The Arduino projects generally gain constant admiration in the global space
among its users and non-users alike. This popularity can be credited to
several distinctive factors and unique features that come with each Arduino
boards. The following reasons are some among the numerous reasons why
most users choose to stick with Arduino devices.
Easy Installation: Arduino is built with features that allow very easy
installation process. This is made possible because the Arduino boards come
with USB port onboard. It becomes a lot easier to install Arduino software
with this unique port.
The Ease of Use: The Arduino is preferred by many newbies since it can be
picked and used with other devices that do not require any special skill in
programming, and no new set of instructions in the form of code can be
passed onto the board. Also, no external hardware is required to perform
many simple activities with Arduino.
Simple Programming Language: Even though one needs to still programme
the device to carry out a particular function, the Arduino IDE is written in a
simplified C++ programming language. This programming language is one of
the easiest which makes the device a lot simple to work with.
Relatively Cheaper Access: Since Arduino projects is an open-source
platform, this made their software free and relatively cheap hardware. Thus,
many of its users feel very comfortable and honored to contribute their
knowledge of coding and programming to Arduino-based projects to enhance
better accessibility.
Good Back-up: As a matter of fact, programme loading from personal
computers are done on most models of this device. This is achieved by using
the standard API, which is referred to as the "Arduino language". Hence,
Arduino devices serve a great purpose as a system of back up for almost all
electronics equipment.
Replaceable Processor: As small as the boards are in sizes, Arduino creates
room for easy and quick replacement of its onboard processor if it is detected
to be faulty. This makes Arduino boards preferred options when considering
easy maintenance and part replacement.
Speed of Communication: In modern technology, speed is a major factor to
consider when making choices of devices. This is the main reason many users
like Arduino because its boards are known for their speed. Arduino has the
floor when it comes to fast communication speed with a personal computer.
This is to ensure a smooth exchange of information between Arduino and any
PC.
Suppose you wish to try out some simple projects with the Arduino and you
are not sure of how or where to get it, the Arduino official company website
always has the products available and from other authorised electronics
outlets.
CHAPTER ONE

WHY IS IT ADVANTAGEOUS TO USE ARDUINO


Arduino comes with several great features which make it a preferred choice
by many users, most especially beginners who usually view it as a tool that
can be employed to control most of the electronic devices. These among
others are the merits of using Arduino;
Boot loader makes loading programs: Hardware programmers
can conveniently load programs directly on Arduino devices
without the need to burn it on another storage device. This is made
possible by the boot loader onboard which dumps programs on the
circuit.

Cheaper Cost: Arduino was created to be affordable by all


comparative with other similar devices. From $50 upwards, one
can get most of the development boards in the market. With about
$30, Arduino can be bought $30 without any compromise as far as
pricing is concerned.

IDE: Arduino comes with its own custom IDE which supports
operation on Windows, Linux or Macs. This is due solely to the
fact that it is manufactured as an open-source tool and with durable
and well-supported backend. This makes porting better on it. Aside
from this, it is easier to detect bugs and fix them.
Strong IDE Community: Many users of the Arduino are
volunteer developers working selflessly to make their contribution
to enhance and improve the quality of its IDE. The quality
standard and affordability of the Arduino may be the major reason
for this.
Simple Design: Arduino comes with a simple and compact design,
unlike many previously developed similar board with a complex
design. In this complex boards, several multifaceted structures like
LEDs, buttons, LCD and other segments comes onboard with it.
This results in bulky boards as compared to Arduino.

Arduino has been created with a very simple and modest structure. This
is because several Arduino shields (ranging from Wi-Fi to LCD) are
supported that act just like use as add-ons to Arduino which users may
decide to use or not to depending on the task they wish it to perform.

Arduino Libraries Perform Several Functions: The Arduino


libraries have been configured to perform multiple tasks. These
tasks can range from performing a complex function to just
carrying out a simple task such as parsing GPS or writing to SD
cards to twiddle pins or debounce buttons.
Arduino is not a Product of any Chip Maker: Many Chip
makers are mostly interested in making their products to be
unique. Thus, they manufacture Chips with custom parts that will
distinguish them from other similar chips manufacturers.

However, Arduino is not a product of any Chip maker. Hence it has


been intentionally designed to share similarities with other
microcontrollers. Implying that whatever any microcontroller can do
can also be achieved on the Arduino.
Sensors: Arduino is a good digital sensor because it is equipped
with an analog-to-digital input. This enables Arduino to measure
temperature, pressure and light intensity using data provided by the
sensor. In this case, nearly all available sensors in the market can
be used.
Arduino is light and runs on a Metal: Although Arduino has a
sophisticated and intelligent code compiler yet it can be run
straight on bare metal. Even with its complex functionalities, it is
fast, very light and small. The codes come along with the HEX
which may be used in bulks to program fresh chips, unlike BASIC
or .NET, that needs to be interpreted.

Flaws of Arduino
Small Resolution: Arduino may not be a very good option if
higher processing power or working memory is needed to handle
an increase in the load of the device. Because the Arduino
microcontroller just has a 10 bit of resolution. Hence it will not be
able to handle compound and advanced functions.
No Debugger: One may not be able to check scripts on Arduino
because debugger does not come in-built with it. Hence, detecting
and correcting any error that might have occurred when coding
becomes a little difficult since it is almost impossible to track one's
operations and progress.
Limited Program Execution: Arduino can only execute a single
program and one task at the same time. If you like your device to
multi-task, this may get you particularly frustrating. Therefore,
Arduino usage has been limited to micro-equipment and single
task, hence, multi-task is impossible on the Arduino.
No Knowledge of AVR Microcontroller: Since an average
knowledge and understanding of the AVR microcontroller is
required, a beginner who uses Arduino may find it uneasy about
getting along with. In particular, this may affect the overall
efficiency in operating the device.

Its Programming Language: The C and C++ programming


languages are what Arduino is mainly developed in. However,
these programming languages are meant to be understood by
experienced programmers and not just some beginners.
Small RAM and Memory: Arduino can never take the place of
your PC. Arduino comes with just 2 Kb of RAM and 3 Kb of flash
memory. Therefore, there is always a limitation to what can be
done or stored on it.
It is not an all fix Board: Although, the Arduino can be used to
manage various other devices and likewise be used as PC
accessory, it also comes with the inability to adequately be
optimised for general function since it is not a fix-all device.
No Partitioning of Code: Because of the IDE used in Ardunio, a
good project environment is not supported on it. This discourages
easy learning and creates no room for other files. What most of the
users do is just go online copy and paste codes with very little
understanding of what they are doing.
Usage of 5V: Arduino still has many of its boards equipped with
the old 5V instead of the 3.3V which offers the best when speed
and accuracy are considered. This is outdated, and the older chips
on 5V are slower and too low.
Misuse of Arduino: Because many of its users lack in-depth
knowledge on how it works and they take it as an easy fix tool to
almost anything that comes to their minds. Hence, these users of
Arduino use it for such an unworthy task.
Abstracted API: Arduino APIs are latent. Hence, it prevents
normal interaction between several layers of the applications.
Therefore, little or no data transfer between the components
involved is carried out.
Port Manipulation: Most users, instead of manipulating the pins,
they easily do port manipulation on the device. This is mainly due
to the lack of basic knowledge of the programming language in
use. Unknown to most users that within the Arduino, there is C
equivalent that can be doused. Thus, it serves as a demerit to
Arduino.
CHAPTER TWO

ARDUINO BOARDS (TYPES)


Arduino boards have gained influence in various engineering fields as quick
ways to design different projects. It is sometimes used as a finishing tool in
some embedded engineers projects. These designs vary, depending on the
type and model of Arduino used, can range from a composite scientific
instrument to a simple household instrument.
The Arduino ability to be used for various different applications has been
enhanced, all of its boards are based on open-source. Arduino boards on the
market come in different types and models with common features as well as
distinctive functions, these are usually based on the specific project they are
used for. Some of the available types of Arduino boards are;
Arduino Leonardo Board: Among the first developments of Ardunio
boards, Leonardo board came as one. Usage of program libraries is easier on
this board because it can directly be connected using USB. The USB comes
in-built with the microcontroller, which makes it one of the cheapest and easy
to use among all the boards.
Leonardo boards are easy to connect with the computer keyboard, mouse,
smart devices etc, as a result of this feature. The board is fully dependent on
ATmega32u4 microcontroller with a “clock speed” of 16 MHz. This board is
equipped with 2.5 Kb SRAM memory while it sits on a 32 Kb flash memory.
Arduino Uno (R3): When looking for board among the most popular, the
Ardunio Uno comes to mind, it is reportedly used by people of diverse
professions. This board has 14 pins digital input/output (I/O), with six pins
being used as a “pulse width modulation” (PWM) output. Other features one
can find on this board are a USB port, a reset button, a power jack and 6 pins
analog input.
By upholding the microcontroller, all of these will be accessible. This board
can be attached to your PC using a USB cable. The board come with
ATmega328 processor, a clock speed of 16 MHz. The SRAM memory is 2
KB while the flash memory is 32 KB.
RedBoard Ardunio Board: The RedBoard Arduino board make use of the
Arduino IDE. Which can be subsequently programmed by using a Mini-B
USB cable. This easily goes well with Windows 8 without the need to alter
any of your security settings.
The RedBoard Arduino board can be easily controlled. It is one of the easiest
to use after it must have been successfully created. After powering the board
on with your PC or other emulators, just follow the menu and select.
LilyPad Arduino Board: This board is wearable, and can be in e-textile
technology. The design is for textiles in particular, and the board is also
washable. It can be sewed into clothes with tread. Everything on this board
like the sensor circuits, power and I/O are specifically designed to serve this
purpose. This board also consists of an Arduino bootloader with variable 2V
to 5V power supply sitting on ATMEGA328 microcontroller.
Arduino Mega (R3): The Arduino Mega operates on an ATmega2560
processor and its digital I/O pins are 54. out of these 15 pins, 4 pins are used
for the serial port of the UART hardware, 16 pins for analog inputs and 14
pins as the output for PWM. Some other components on these boards are a
power jack, connection for USB, ICSP header, RESET pin and the 16 MHz
crystal oscillator.
Arduino Shields: To connect to other types of Arduino boards, Arduino
Shields are used. They are pre-built circuit boards. These Ardunio shields
vary depending on the type of usage. Some of which include Proto Shield,
Ethernet Shield, Wireless Shield and GSM Shield.
The Arduino Shield and Arduino boards are so connected in a way that the
Arduino board is placed under the Arduino Shield. This makes room for easy
integration as the board is eventually connected to control the LCD and
monitor.
Arduino Micro Boards: As the name implies, this is a special type of
Arduino board with a very small design. The microcontroller operates on a
processor dubbed ATmega32U4. There are a total of 20 pins on this board of
which 12 are used for analog I/O and 7 for PWM. This board has its micro-
USB connection onboard the Arduino Micro board.
Other features present on the board include; ICSP header, a 16 MHz crystal
oscillator. Arduino micro commonly refers to as a shrunk form of the
Leonardo because it is small and resembles the Arduino Leonardo boards.
Arduino Due Board: The first board on Arduino series designed and
developed to use the ARM microcontroller is Arduino Due board. The ARM
core is 32-bit and 54 digital I/O pins where 12 are analog pins. This comes
with two different types of ports onboard (the programming port and the USB
port); the programming port functions as the interface for the micro side of
the USB cable.
Arduino Bluetooth Board: This has been purportedly dubbed Bluetooth
board because it is programmed through Bluetooth wireless connection.
Arduino BT boards are based on the ATmega168 microcontrollers model.
Notable features of this board are screw terminals, 16 MHz crystal oscillator,
reset button, 6 analog pins and 16 digital pins.
Arduino Esplora Board: Planning to have actuators and sensors that
interface easily, then the Arduino Esplora board is designed specifically for
you. This board is different from other types of Arduino boards as it is
embedded with microphone, accelerometer, temperature sensor, slider,
joystick and buttons. The Arduino Esplora board also come with the input
and output connections.
What Arduino Boards can be useful in the House?
Several types of Arduino boards can become very useful at home for various
kinds of task. However, the task Arduino will handle will suggest which type
of board suit the purpose, but generally, the most commonly used household
boards includes Arduino Uno, Arduino Mega, Arduino Pro and Arduino
Mini.
This is determined majorly by type of task to perform at home ranges from
scheduling upcoming events, automated door lock and switching on or off the
lights to even operating your smartphones. Beginners find these most
interesting and enjoy the best quality from the Arduino Uno in particular.

CHAPTER THREE

HOW TO CONNECT YOUR ARDUINO TO A COMPUTER


After you must have made your selection of the type of Arduino board you
need for your specific function. What follows is to try and load a set of
instructions or codes into the Arduino board usually via a computer. How
your Arduino manage a given task is determined by the instructions loaded in
it. These set of instructions or programs are, however, very specific to the
function to be performed. Nevertheless, any instructions loaded into the
Arduino board is what will get executed. Your Arduino must be connected to
a computer to enable code loading. In other to establish the necessary
connection on Windows OS, the following are the needed things:
The Arduino board
The Arduino software
The USB cable (A and B plug)
Your computer

1. Start by downloading the required software to make your computer


compatible with your Arduino.
2. Once you are done with it, unzip it into (D:/Arduino).
3. Then, the connection between your computer and Arduino board is
ready to be established by connecting one end of the USB cable to
your computer and the other end your Arduino board.
4. When your computer's Windows prompt for the driver, it can be
installed manually (location is D:/Arduino/Arduino-
0022/drivers).
5. The Arduino software environment can then be located
D:/Arduino/arduino-0022/arduino.exe.
6. After this, you choose the type of Arduino board you are using by
doing the following:
Go to Tools
Select Board
Then, choose the type of Arduino board from the drop-down lists.

7. Choose the serial port by going to Tools, serial port then COM.
8. Go to sketch example by choosing Fire, Examples, Basics and Blink.
9. Upload the code to Arduino by clicking on the upload button. When
you see "Done uploading" prompt, your Arduino has been installed
successfully.
Establishing a Connection of Arduino to your Computer
Tools Required by Arduino for easy Connection
After installing your running code successfully on the Arduino board, the
next thing you think is how to perform a specific project. Arduino can handle
several projects such as from flying a drone, moving a car, lighting a LED or
moving a simple robot to lock a door (Some of the projects you can try with
Arduino are discussed later).
For you to execute any of these projects, a specific program or set of
instructions must be run on your Arduino board (as discussed above on how
to connect your Arduino to a computer). These codes are unique to every
function assigned to a particular Arduino to perform.
However, when you are sure all these have been done, the next thing is to
carefully connect every other component parts of the Arduino to the device
you want it to manage. This is usually carried out using some simple tools or
instruments. For any successful Arduino project, some of these tools are
needed:
Wire Strippers: These are simple plier-like tools. They are usually hand-
held and used to remove the insulating covering of any electrical wire. They
can also be used to cut open any end on an electrical wire. Such ends are
usually connected to the end of other opened wire.
For the Arduino project, this tool is used to create a connection of wires from
your Arduino to the device you are working with. This enables the exchange
of necessary information that is specific to the primary function of that
project.
Precision Screw Driver Set: These set of screw drivers are usually used by
most technicians or hobbyist. They are made with different slots to suit
various kinds of screw.
Precision screw drivers are usually required when working with a minute or
small screwing because some Arduino boards are very small, complex and
complicated in nature. In this way, these drivers can have a firm hold on the
screws and at the same time, twist on the available small portions of the
devices used in the project you are doing.
Needle-nose Pliers: Needle-nose pliers come with several names. Some of
the popular ones include snipe-nose plier, pointy-nosed plier, pinch-nose plier
and log-nose plier. It performs a dual function as both holding and cutting
tool particularly suitable for the several intricate wires likely to be seen when
working on the Arduino project.
These tools are used mainly for snipping, bending or repositioning any wire
in your Arduino project to ensure tight connections that will guarante that
Arduino delivers the optimum function you want. This is because they can
reach a very tight position where other regular pliers will not function.
Flush Cutters: The main purpose of this tool is to cut your wires. Flush
cutters reaches the point where such wires are cut to be neat, flat and very
smooth. The flush cutters are to be held in a perpendicular position with
respect to any wire you may want to cut. Your Arduino project will definitely
look neat and perfect when you make use of Flush cutters.
Digital Multimeter: Primarily, a multimeter measures the quantity of
electricity passing through your circuit. This is usually measured either in
Volts (V), Ampere (A) and Ohms (Ω). This tool will measure those
parameters with good accuracy. The use of the digital multimeter help to see
the values of either the current, voltage or resistance of electricity passing
through your device to make any necessary adjustment if the need arises.
Fine Tip Straight Tweezers: This tool is used to pick up any unnecessary
debris or materials that have found its way into your project. It has two ends,
one is a pointed end used mainly for tweezing purpose while the other end is
a picking end.
Solder Sucker: This is a desoldering instrument popularly called a
desoldering pump. It is specifically used to remove any previously soldered
part of your circuit. This might either be for the repair, replacement or
troubleshooting of that part.
Soldering Iron: The soldering iron is a tool used to obtain smooth of various
wires within your project. This ensures the proper flow of electric charges
across the whole circuit in the project. It works by heating and melting the
solder on the contact point. The junctions where connections are to be made
are glued together using the soldering iron.
Panavise Jr: Another essential tool used for Arduino project is the Panavise
Jr. This helps when connecting many devices by using it to hold any part of
your project. The Arduino board or some other components of the circuits
can be held using this tool.
Doing this makes it easier for you to do anything you want to do on your
project because this tool can be twisted to any desire direction giving you the
comfort and makes your project easier to work on.
When connecting other devices and circuits with the Arduino board, certain
precautions must be followed to avert the complication of wrong connection
and to also avoid touching other parts of the board that are not needed in your
current project which may vandalise the entire board.
Preparation Work before your Project is finally Done
Once the needed code for the particular task or function has been written and
loaded into your Arduino, all that is left to do is to connect the required ports
or pins on the Arduino with the device it will work on using some tools
described above.
After this has been done, you will then confirm if all the required connections
are accurately made. Firstly, make sure the right code for the project is being
loaded. Ensure that all necessary tools and/or devices are correctly arranged
to prevent mistakes in the connection.
This has become a key step because any improper connection will definitely
alter the whole purpose of the project. The device then performs the intended
function if all the connections are perfectly made.
Testing your Connection
After ensuring everything is in order, starting from the uploading of the code
to the general coupling of various components of the project and giving it a
finishing touch. The next line of action is to test if the project will function or
not. This can easily be carried out by just executing the project.
For example, if your project is put on or off a LED light, just press on the
switch and observe if the LED light will come on or off or for a fingerprint
door, just place your fingerprint on the necessary part and see the door open
or not (more on the possible projects you can try using your Arduino later).
If the LED light turns on/off when you press the switch or the fingerprint
door open the moment your finger is placed, then your project has been
executed perfectly. Otherwise, it perhaps implies you have loaded the wrong
code, or the connections are not rightly done. Thus, further troubleshooting
may solve the problem.

CHAPTER FOUR

THE ARDUINO MEGA SERVER


The Arduino is centrally managed by an operating system known as the
Arduino Mega Server. This server has been a great tool in the hands of
many users who have discovered it to be highly user friendly. It is also multi-
platform such as web functions, hardware and network functions. Internet
browsing and some other online activities can be done using the Arduino
Mega Server. Thanks to its good graphics and great dynamic user interface
which made all these possible.
This Mega server is usually accessible through an Arduino Ethernet Shield
and a micro SD card. These unique functions help to experience a smooth use
of the web. The role of the Arduino Mega Server especially brought out by
using the Ethernet Shield. It ensures your access to the server via your
computer. By doing this, the network used by your Arduino can conveniently
be connected to any browser on your computer. This also makes sure that
you can
Use Javascripts from web portals to control hardware
Use simple HTML to read a switch state
Use HTML to read a sensor's value

You will need the followings things if you are planning to use your Arduino
to browse the internet:
An Arduino Mega Server (e.g. Arduino Mega2560 or Arduino
UNO)
A wired LAN connection with a speed of 10/100MB
An Ethernet Shield

The Ethernet Shield functions primarily to connect to the internet using the
Arduino as the source of connection. The shield can be connected to your
Arduino through the head pins. Ethernet cable is then connected to the shield.
Other hardware needed when doing this include:
Ethernet cable
Pushbutton
9 V adaptor
Wi-Fi router
Jumper wires
10 K resistors
Breadboard

In other to perform various optimal functions, these tools are used such as
receiving and sending of certain commands from the network, searching for
any available network, real-time clock, integration with smart home systems,
voltage and current control, and maintenance of sensors and measurement of
temperature.
Aside from this, your personal modules can be added as you desire. This is
because the Arduino Mega Server can distinctively compile modules, detect
compiled modules, and separate them from not yet compiled modules. It also
avails you the flexibility to disable or enable any module that has been
compiled straight from the internet.
Among the few things that have been integrated with the Arduino Mega
server is an electric module that can monitor the input and output voltage of
the Arduino. This electric module can likewise monitor the current. It is
assembled on the switchboard and can conveniently regulate the amount of
electricity consumed. The ability to track the presence of people is another
unique function that can be performed by this module.
Acting as network oscilloscope is another additional feature, this oscilloscope
display real-time network traffic within your web in the form of dynamic
signals or oscillogram. Also available is a screensaver module which
especially displays information on panels. This enables you to choose the
information that is relevant to you while getting rid of any other.
System failure can be forestall using the Arduino Mega Server by
implementing a highly efficient frequency meter. There is also a 216 block
indicator useful for 3D system status, this offers you the privilege to look
over the entire structure of the system. To use your Arduino as a web server,
you must do the following things:
Use the Ethernet configuration for the Arduino
Stipulate the address of the IP
Give the Address of the MAC you are using
Connect your Arduino to the available internet service (you can
use a Wi-Fi router for this)
Give the code required to run Arduino as a web server
Connect your computer to the Arduino using a router

Due to the ease of setting up the Arduino Mega Server, many of its users can
connect up to 32Gb SD card to it. Thus, different web content and file can be
safely saved on this SD card from the web server.
The Arduino Mega Server also allows integration with MajorDoMo. The
MajorDoMo platform behaves like an automated home system. By doing it
with the Arduino, it avails you the opportunity to send data, analyse it and
also any required status can be sent. Command control from over the network
and store data can also be obtained.
The Arduino Mega Server has always been termed to be used as a "tandem
mode". This implies that the information on the MajorDoMo server can work
perfectly in the Arduino Mega Server. The MajorDoMo is not purposed for
the tandem mode, it can, however, work independently.
The Arduino Mega Server is built on 8-bit processor capacity. This is a major
reason why it is multifunctional in nature and many other unique features.
Also, hosting multiple sites is possible when using your Arduino Mega
server. Without turning off your controller or pulling out the memory card,
you can also update contents.
Using the Arduino Mega Server, modification of many web pages can be
achieved to adjust the screen of your computer. This allows you to get
exciting experience when information is your purpose of browsing the
internet.
CHAPTER FIVE

PROGRAMMING LANGUAGES THAT ARDUINO USE


Arduino uses a programming language which is most of the time referred to
as the Arduino programming language or simply the Arduino language. The
Arduino avail its users with several choices of integrated libraries and a
programming editor. Thus, compiling and loading of these programs into the
board becomes very easy.
The Arduino is supposedly written in simplified C/C++ programming
language as described by its users who usually use it as a downloadable
online tool. They are often referred to as sketches due to the simplicity of
these programs.
Any files or texts that have been written in the Arduino language are also
called sketches. The extension ".ino" should be used as a file extension to
allow you save and load sketches to your Arduino board. The following are
the core feature of Arduino programming language:
Functions: These gives you total control of your Arduino board. Common
programming tricks such as analysing characters or executing any
mathematical operation are performed using these functions.
The function setup or loop function is sketch of the Arduino programming
language. Every time your Arduino is powered up or reset, the setup is used
for execution. The function loop is then used to power off and rest the button.
The main function does not exist in the Arduino language. Other functions
useful when handling it include:
Digital Input and Output (I/O): There are digitalRead which its parameter
is a pin number, digitalWrite which gives a digital output pin value that may
be high or low, pinMode which its input and output are set as a pin, pulseIn
reads pulse from a digital signal from low to high and back from high to low
again, shiftIn reads byte bit by bit, shiftOut writes byte bit by bit among
others.
Analog Input and Output (I/O): They include analogRead which uses an
analog pin to read values, analogReference which uses the analog input to
configure value range for inputs, analogWrite writes an analog value to a pin
etc.
Time Function: These include delay which can pause or delay a program
that has been specified as a parameter for few milliseconds,
delayMicroseconds this can pause a program that has been specified as a
parameter for a few microseconds etc.
Math Function: These include abs which specify the absolute value of a
number, constrain this to limit a number to be within a specified range, cos
which indicates an angle's cosine, sq indicates a number's square, pow which
means the value of a number which has been raised to a specific power etc.
Constant and Variables: These are Arduino values, very similar to those
used in C++ programming. These are mostly used in the conversion of type.
They enable easy data transfer within the Arduino ecosystem.
Structure: This is the last part of the Arduino programming language. Here,
small code elements like operators and others could be found. This gives the
Arduino a major edge in the ultimate execution of any written code.
You can also import external libraries using the Arduino programming
language. These libraries contain already written codes. This avails you the
ease of working; else, you may write your own code or download your
required code directly from the internet.
The C libraries may be used some times. This is very unique to the Arduino
language. The Library Manager available on the Arduino ID allows you to
install such libraries of languages. Some of the online downloadable Arduino
languages are

ArduBlock: Many of the beginners find this programming language


particularly useful. Instead of typing a code, the ArduBlock allows you to
construct your own code. It enables you to select functions to your codes. It is
especially good for visual learners.
Snap4Arduino: just like the ArduBlock, this programming language also
supports visual. It is mostly used in a drag and drop way. Although it is very
similar to the ArduBlock, it is specifically designed for users who lack basic
knowledge of the Arduino programming language. To install this language,
you will need "StandardFirmata" which comes installed on your Arduino.
C#: This makes information sharing with your computer on the Arduino a lot
easier. The usage of this programming language, allows you to code in
another language that is entirely different from the one used as a sketch by
your Arduino. The "CmdMesseger" will particularly be of help doing this.
This messenger can run well on Microsoft Visual Studio or any other third-
party alternative you can lay hands on. The C# language then creates a
smooth communication link between your computer and Arduino.
Python: Although, codes built upon the python programming language
cannot be used in the Arduino. However, communicate in this language is
made possible by using the serial input on your device. This you can do by
downloading the pySerial. This often serves as the basis of some other
advanced programming languages due to its intuitive in nature.
The Arduino software (the IDE) enhanced general programming language of
Arduino. This IDE is built upon both the wiring and processing IDEs found
in the Arduino environment. The online version of this software, however,
has a preference for most users, which is called the Arduino Web editor. This
becomes a great choice, especially when coding using the Arduino.
This gives you room to have your data directly stored into clouds which avail
you easy access to it any time and anywhere via the internet. The online
version of the Arduino software is more [referred because it does not require
any further update, unlike the offline version. However, the offline version
can always be downloaded and used by other users who prefer it.
Working with the Arduino programming language using the IDE provides
better communication since the IDE is compatible with many operating
systems such as Windows, Linux and MacOS.

CHAPTER SIX

THE ARDUINO INTEGRATED DEVELOPMENT ENVIRONMENT


The Arduino IDE is a form of code or program editor that is compatible with
various platforms such as Linux, Windows or MacOS. It is a simplified form
of C/C++ programming language of C/C++. This IDE act as a medium in
which codes or programs are written and uploaded to the Arduino boards.
The software comes with various other tools such as toolbar with buttons,
code writing text editor etc. The software is also part of an open-source and is
used on all Arduino boards.
As discussed in the previous chapter, sketches are a set of programs that have
been written using the Arduino software. The text editor is used to write these
sketches. The toolbar buttons can be used to check and load a program. It can
also be used for the opening of the serial monitor and creating, opening and
saving of sketches.

Downloading and Installing the Arduino IDE


If your Arduino is ready to do any project of your choice, then, the thing you
need to do is to install the Arduino IDE software. To do this, firstly download
the software from the Arduino official website. When you are done with the
download, then you can run any program using this Arduino IDE. To do this;

Open Arduino website (https://www.arduino.cc/en/Main/Software)


on your web browser
Click on the link to download and go to the download page
Select the "I Agree" button on the License agreement for the
Arduino
Click on the Windows link on the download page, this will
download the Arduino software for Windows
Locate the just downloaded file on your computer, then, extract the
zipped file
Copy this to a favourite location on your computer
Then, connect the computer with the Arduino by attaching your
Arduino board to the computer
Commence Windows device Manager by clicking on the Windows
Start menu button
Right-click the menu of "Computer" and select "properties" from
the lists of the drop-down menus
Click on the link of "Device Manager"
After this, the Device Manager will show "Arduino"
Update the driver software by right-clicking on the "Arduino"
A dialogue box will show, choose "Browse my computer for driver
software" from the drop-down options

After this, select the "Browse" button.


The downloaded Arduino folder now has a Driver folder, Choose this Drivers
folder. After this has been chosen, you can now click "Next"
A dialogue box will come up, choose the "Install this driver software
anyway"
After a few minutes, the installation of the driver will be completed. You will
notice that another dialogue box will come up, just note the port that has been
used to configure the Arduino. After this, you can set-up your Arduino
software. To do this:
Go to the folder that has just been downloaded
The Arduino software can now be opened by double-clicking on it
Be sure that you have chosen the right Arduino board and if not,
change from the option as necessary
Be sure also that the serial port that has been chosen is the right
one, if not, change as necessary

After you must have followed all these procedures, what is left is to test the
installation whether it is working or not. You can see if the installation is
good by loading the sketch into the Arduino. To do this, select the "Blink"
sketch and choose the button for Arduino Upload (The LED that is on the
board of the Arduino will flash to indicate loaded sketch). You may want to
run the sketch to ascertain that the Arduino software and driver has been
successfully installed.
Which Arduino IDE version to Choose
The Arduino software undergoes periodic updates to improve productivity
and to sometime fix some observed bugs, hence, there have been frequent
modifications to the version of Arduino IDE that have been released. These
modifications are necessary to meet continuous users' needs.
The Arduino IDE version 1.0.5 is the first-ever released Arduino IDE, and
the oldest used in the first generation of Arduino programming. This
particular version 1.0.5 and other subsequently released versions such as
versions 1.8.11, 1.8.10, 1.8.9, 1.8.8, 1.0.5, 1.0.4, 1.0.3, 1.0.4,0023, 0022,
0021 0020 etc are now obsolete.
The currently active released versions are version 1.8.12 and version 1.8.13.
The version 1.8.13 is the most recent version of the Arduino IDE. The
version 1.8.13 has many improved updates; hence, the best version that has
been released so far.
Recent updates for this version were released with support mainly for
Windows operating systems (e.g. 2000, XP, 7 and Vista). It was developed
by Genericom and equipped with 90.20 MB total file capacity. Other notable
features of this Arduino IDE include the ability to share information with any
other user working on an Arduino based project, ability to alter schematics
and internal layout when necessary.
Arduino IDE Online
Using the Arduino IDE online or the Arduino web editor is another way of
doing programming on the Arduino. Using this, you can access tutorials,
configure boards and most importantly write codes directly on the web as one
of the features of Arduino create. This is especially brilliant feature enjoyed
by users with constant and good internet access.
This comes with the benefit of having on the go access to the Arduino
facilities without necessarily need to download the Arduino software. Thus,
storing your sketches on the cloud and having easy access to them at your
convenient time and location. To use these online facilities on the Arduino
IDE, one needs to
Install the Arduino create plugin from
https://create.arduino.cc/getting-started to allow connection to your
board
Log in to your Arduino account by clicking on the Arduino Web
editor (You equally create a new account if you do not have an
account before).

After a successful login, you will observe that the online Arduino IDE
environment resemblance with the Arduino software version since you
always code from a compatible internet-connected device. You can easily
upload a new file with just a click on the import button right beside the "new
sketch" button. Then, you are ready to run your own code.
On the online Arduino IDE, the first column allows you to browse through
several options like sketchbook, examples, libraries, serial monitor, and help.
On the second column, you will see other options from the menu of any
chosen item while the third column is where proper programming is done.
To upload your own libraries, just go to "Libraries" then click on the "Library
Manager". With this, any library stored on your computer can easily be
uploaded. The "Help" if you need any help or face any challenge while using
the Arduino IDE online, use the "Help" button to get the essential guide.
Use the "Preference" tab to view available storage space on your online
Arduino IDE. This tab also helps you during programming by providing you
with the options to customise the appearance of your online Arduino IDE,
such as the colour theme or text size. The code area is the most used feature
of the online Arduino IDE. This is where you will write, verify and upload
your codes on your Arduino board.

CHAPTER SEVEN
SOME OF THE ARDUINO PROJECTS THAT YOU CAN ATTEMPT
Several projects can be managed with the Arduino board ranging from such
simple task as controlling LED lights to a more complex and technical project
like using the Arduino to automate most of your household devices. Few
among many projects you can lay your hands on using the Arduino is listed
below:
Arduino Mega Chess: This gives Chess lovers access to a personal digital
chessboard. In addition to your Arduino, you will need a 3D printer and TFT
LCD touchscreen to enjoy your digital Chess. This allows you to apply the
necessary adjustment to suit your desire when designing this digital
chessboard.
Robot Arm that has Controller: The Arduino UNO board permits you to
have total control over your robot, which is specially designed for this type of
purpose. You will need a robot-arm whose function can be enhanced with the
3D printer.
Making Musical Instruments: Musical instruments have been made by
many hobbyists using the Arduino board. The Arduino Uno can also be used
in this regard. The Pi supply flick charge will also be needed for this project.
After the project has been completed, all you need to do is, tap on it to see
your hand waves being converted to music.
The RFID Reader Security Access: Radio frequency identification may be
used for security purposes. This can be performed using an Adafruit NFC
card also, which is being used for security access.
Small Weather Display System: If you think of having your own miniature
weather display system, the Arduino board will help you achieve this. The
weather display system is to be programmed to display the current
temperatures in the environment both in Celcius and Fahrenheit units. This is
really an interesting project for an adventurous beginner. An OLED graphic
display is required to view the weather information.
Make a Fingerprint Scanner for your Door: This project allows you to
construct a scanning system that detects your fingerprint and then gives you
access through the door. The door will only give way at the prompt of your
fingerprint alone.
Make the Control Panel of a Computer: Things you can do with the
control panel include changing screen preference, controlling the volume,
launching of app etc. Your Arduino board is the backbone of this project, you
can control the several other parts of your computer using the USB
controllers.
Robotic Car: You can build a robotic car using the Arduino in connection
with DC motors. If you want a robot with good visual, using 3D printing for
the components of the car is the best choice. You will also get to learn the
rudiments of advanced motor control as you do this project.
Motorised Camera that follows Motion: For your home security camera,
this project becomes a better alternative. Your home security camera may be
unable to take videos of some blind spot. With this project, you are sure of a
secured home since the camera will always follow the direction of any
movement it senses.
Quality Control System for Water: The water quality sensors can be used
in combination with the Arduino UNO to make a great water quality control
system for you, especially if water hygiene is your concern.
Ultrasonic Distance Finder: This ultrasonic distance finder is another
awesome project that can be built using the Arduino Uno in combination with
a sonic ranging module and LCD readout. It is used to calculate distance
from an object. This work by detecting sonic waves reflected off an object on
its receiver, the data received as a result of this is then used to give an
approximate distance to the said object.
High-speed set of Photography: With this project, slow-motion shots of a
fast-moving object such as flying birds or falling water can now be taken
with the Arduino board. In this project, the Arduino board is used with the
right flash. If you are into photography, this is especially a good tool for you
as it enables you to produce great production contents.
GPS Tracker: With the Arduino board, you can easily design a smart GPS
tracker. This tracker becomes helpful when tracking the position of some
things, even your car. In combination with your Arduino, a GPS module,
wires, OLED display etc are needed for this project.
Alarm-clock Radio: This Arduino project equips your device with the
ability to perform a dual function, as an alarm and as well as a radio system.
This project will avail you the choice of setting the alarm for the desired time
while having the time displayed.
Plant Watering System: The beauty in this project is that it can be
assembled within a few hours compared to some other Arduino projects.
With the choice of correct source code, moisture sensor and layout
component, this automated plant watering system can be built according to
your specification to suit your desire. The location where the potted plant
may be growing does not matter, the system will just deliver as expected.
Inverter: This particular project got people amazed that the Arduino can
serve as a form of a substitute to the conventional inverter. An inverter made
from Arduino is usually cheaper when compared with an average inverter.
This is simple to build, all you need to do is get your battery, and then
configure your Arduino to function as an inverter.
Walkie-Talkie: Arduino, in combination with some other necessary
electronic components, can be used to create a Walkie-Talkie. This allows
you to easily communicate with any other person within a set frequency. The
medium of communication in this project is Bluetooth.
Oscilloscope: Your computer and an Arduino board can be used to as act as
an oscilloscope. The Arduino board is designed primarily as a portable signal
acquisition hardware. After the oscilloscope circuit has been put in place,
frequency up to 5 kHz can be reached on it. This is made possible as a result
of the in-built analog/digital converter that comes along the Arduino board.
The signals from this converter are sent directly to your computer via the
USB.

CHAPTER EIGHT

TROUBLESHOOTING ISSUES WITH ARDUINO


Although the Arduino is in general very easy to use, some users, however,
still find it a little bit hard to operate. This type of setback can usually be
fixed with a simple adjustment on the device set up. Below, we have looked
at most common issues you may come across when using your Arduino,
especially for a first time user, and how you can easily fix them.
Issues with the Serial Monitor: Sometimes, you may desire to use the IDE
serial monitor. What this does is that it enables you to send some data
through the serial port. In addition to this, it has over the time been used to
show details of a graph sensor data or an RFID tag.
Problems do arise when you begin to see some strange things (at times you
may not even see anything at all) when you view the serial monitor. This
usually occurr when the right detail setting is not being used. Using the same
value in the baud rate setting in the set-up code as the one in the serial
monitor can fix this problem.
Computer/IDE not Recognised by the Board: The Arduino board not being
able to recognise the computer or IDE is the most common issue encountered
on the Arduino set-up. This can arise as a result of two things:
1. Using the USB Cable: The USB cable you are using may not be
compatible with the Arduino. This is because some USB cables are meant for
charging of smartphones instead of data transfer. It is generally advisable to
use a USB cable that supports data transfer on the microcontroller. This will,
in fact, make powering and programming your device very easy.
2. Board Drivers: Although, board drivers are normally detected
automatically by your device. Thus, it makes automatic installation easy.
However, the drivers may not be automatically recognised at times. In this
case, there is a need to install the drivers by yourself. These drivers come in
different flavor depending on the kind of the Arduino board you are using.
3. Libraries/Header files missing: There are cases where some of the codes
copied from online sources and pasted on the Arduino IDE may not have
necessary libraries already installed on your device. This often prompts an
error message. This can easily be fixed by just simply installing the missing
libraries. This you can do by checking for the Library Manager on your
computer or just look for the library online.
Inability to Upload a Code: this may be experienced as a result of:
1. Not using the Correct Settings for your Board; When you are
programming Arduino board, and the right settings for the Arduino IDE
on that board are not being used, there is a tendency you will not be
able to upload any code to your Arduino. However, when the correct
setting is in place, the code will smoothly upload.
To fix this issue, you need to go to your Arduino IDE environment,
then go to the "Tool menus" to look for the type of board you are using.
If you are unable to find the board type here, then, go directly to "board
manager" to add the type of board you are using to list.
2. Incorrect Code: The Arduino IDE will continue to alert you
whenever your code contains an error. This will usually show at the
bottom of the IDE in a black box. This can be fixed by issuing the
correct code. Otherwise, you can simply turn on the verbose output
option in your IDE settings. Turning this on will offer you a great
suggestion as you writing your code before you upload and guide you
when uploading any code of your choice.

FAQs
Some frequently asked questions and answers about Arduino
Still not clear about some certain things you need answers to? Below, we
have tried as much as possible to give the most suitable answers to some
frequently asked questions concerning the Arduino.

1. Is the Arduino IDE different from the Arduino Web Editor (Online)?
Answer: These two platforms, the Arduino IDE and the Arduino web editor
primarily do the same thing which is providing you with an environment to
write your code. However, the Arduino IDE needs to be downloaded on your
device before you can use it, the Arduino web editor, on the other hand,
allows you to do the same thing online without the need for you to download
any Arduino software.
2. Which Board can I use if I decide to use the Arduino Web Editor?
Answer: All types and models of Arduino boards have the Arduino web
editor feature by default.
3. How do you power an Arduino?
Answer: Different types of Arduino board come with different power
requirement you can choose from. For instance, a 7-12V power adapter or a
5V USB connection can be used to power an Arduino Uno Rev3.
4. From where can I get the Arduino?
Answer: Arduino is available on Amazon online store.
5. How can I connect an LCD with an Arduino?
Answer: The input/output pins are the interfaces through which the Arduino
can be connected to an LCD. The Liquid Crystals library is used to control
the connected LCD screen. To use this library, look for it in the library
manager and install it.
6. Can Arduino control many Servo Motors?
Answer: In particular, the Arduino board known as the Arduino Mega
boards, can support around 48 Servo Motors. Whereas, a maximum of 12
Servo Motor can be supported on many other Arduino boards.
7. Does relay work well with Arduino?
Answer: Relays work quite well with most Arduinos. A relay module is
usually used to control the relay with your Arduino. For you to connect relays
to Arduino, pins on the board are used. The presence of these pins allows
easy integration of relays with the Arduino circuit.
8. How do you program using the Arduino?
Answer: The Arduino IDE language is popularly known as Processing. This
is the language in which programs are made. After the programs must have
been written, then sketches are used to save them. These sketches are what
you upload into the Arduino through the computer via the Arduino IDE.
9. What can I do with my Arduino?
Answer: The list of things you can use your Arduino for is endless.
Basically, the Arduino is used in most hardware to send and interpret signals.
This signal gives Arduino the ease to interact with the hardware, thereby
enabling it to handle various tasks depending on the nature of the project the
Arduino is to be used for.
10. Why is the Arduino IDE showing "uploading sketch" without end?
Answer: In some instances, when you are uploading a program, it may hang
or freeze. This you can easily resolve by a simple click on the upload button
again. In this way, the process will start all over so that you may be sure that
the program is uploading. It often time takes less than 10 seconds to do this.
11. Can alternative serial monitors be used with the Arduino?
Answer: Yes, you can use alternative serial monitors with your Arduino.
Because your computer can be connected with the Arduino by a USB cable
via a virtual serial port, which allows Arduino to access any application that
is on your computer. This is why you are able to write and load programs into
your Arduino.

CONCLUSION
Arduino is based on an open-source platform and can be used by any person
at any level. Hence, it has given easy access to many people to use it for the
execution of their various automated projects. As a matter of fact, many
embedded engineers have been using the Arduino to give finishing touch to
some of their projects. Even hobbyists, too, have had their fair share of using
this fantastic device to satisfy their desires.
Arduino projects have given lots of innovations as to how many interactive
devices can be built. In fact, many Arduino projects have been recognized to
be the prototype of real projects. In this way, experimenters will be able to
make necessary amendments before they produce the final product.
Arduino has also become a handy household tool to perform various simple
and complex automation processes. This is because the companies that
produce this board have several models, designs, and sizes of the boards,
which are used for different purposes.
At the Prix Ars Electronica in 2006, the Arduino project was selected as one
of the few projects with the potential to revolutionize the way things are done
when it comes to the internet of things (IoT). Recently, the Arduino
Engineering Kit shined at the Bett Awards for "Further Education or Higher
Education Digital Services" by claiming an award.
The foremost important thing about the Arduino is that it gives you absolute
control over what and when to use Arduino to perform a task. This is because
your boards will only carry out a task based on instructions provided. This is
mainly an incredible tool for beginners interested in embedded engineering or
interactive electronics as they get to construct many scientific and
engineering devices at a relatively cheaper cost.
However, some persons might find it challenging at first, hence this guide.
Having gone through this guide, you can comfortably connect Arduino to
your computer, attempt some projects, and learn more about the server. With
some troubleshooting issues addressed in this guide, you can comfortably
handle common problems you may encounter while working with Arduino.

You might also like