Arduino ebook

Arduino Workshop for



Arduino Workshop, where you'll be able to follow our guided course which covers everything you'll need to know in order to create your own Arduino projects and become a leveled up maker. My name is Prateek and along with being a maker myself, I also enjoy teaching others how to use different technology and create amazing projects. Along with the course videos themselves, you can find all of the related course material such as code examples, circuit diagrams, images, and other resources.

We'll be working with Arduino so you'll need an Arduino board to follow this course. We'll be introducing many different concepts including working with various types of hardware such as sensors, displays, and general electronics components, and the kit .

Course Goals:

  • Understand what an Arduino is and how it works
  • Learn how to use an Arduino safely
  • Program your Arduino using code that you've written in the Arduino IDE        (Integrated  Development Environment)
  • Learn programming concepts using C and C++ along with Arduino                specific   programming
  • Understand best practice concepts for programming and prototyping
  • Use a wide variety of hardware and components and prototype your              projects using a breadboard
  • Build your own innovative project with Arduino

In this chapter you'll learn about:
  • What is Arduino
  • Different types of Arduino boards
  • How does the Arduino Uno board work and why it's so popular
  • What is a microcontroller
  • How to use the Arduino IDE (Integrated Development Environment)
  • Powering and connecting your Arduino to your computer
  • Uploading programs to your Arduino board

Introducing the Arduino           

The Arduino is a small computer that you can program to read information from the world around you and send commands to the outside world. All of this is possible because you can connect several devices and components to the Arduino to do what you want.

You can do amazing projects with it, there is no limit for what you can do, and using your imagination everything is possible!

What is an Arduino?

The Arduino is the board shown in the figure below.

Basically, it is a small development board with a brain (also known as a microcontroller) that you can connect to electrical circuits. This makes it easy to read inputs – read data from the outside – and control outputs - send a command to the outside. The brain of this board (Arduino Uno) is an ATmega328p chip where you can store your programs that will tell your Arduino what to do.

Exploring the Arduino Uno Board

In the figure below you can see an Arduino board labeled. Let’s see what each part does.

·         Microcontroller: the ATmega328p is the Arduino brain. Everything on the Arduino board is meant to support this microcontroller. This is where you store your programs to tell the Arduino what to do.
·         Digital pins: Arduino has 14 digital pins, labeled from 0 to 13 that can act as inputs or outputs.
o   When set as inputs, these pins can read voltage. They can only read two states: HIGH or LOW.
o   When set as outputs, these pins can apply voltage. They can only apply 5V (HIGH) or 0V (LOW).
·         PWM pins: These are digital pins marked with a ~ (pins 11, 10, 9, 6, 5 and 3). PWM stands for “pulse width modulation” and allows the digital pins output “fake” varying amounts of voltage. You’ll learn more about PWM later.
·         TX and RX pins: digital pins 0 and 1. The T stands for “transmit” and the R for “receive”. The Arduino uses these pins to communicate with other electronics via Serial. Arduino also uses these pins to communicate with your computer when uploading new code. Avoid using these pins for other tasks other than serial communication, unless you’re running out of pins.
·         LED attached to digital pin 13: This is useful for an easy debugging of the Arduino sketches.
·         TX and RX LEDs: these leds blink when there are information being sent between the computer and the Arduino.
·         Analog pins: the analog pins are labeled from A0 to A5 and are often used to read analog sensors. They can read different amounts of voltage between 0 and 5V. Additionally, they can also be used as digital output/input pins like the digital pins.
·         Power pins: the Arduino provides 3.3V or 5V through these pins. This is really useful since most components require 3.3V or 5V to operate. The pins labelled as “GND” are the ground pins.
·         Reset button: when you press that button, the program that is currently being run in your Arduino restarts. You also have a Reset pin next to the power pins that acts as reset button. When you apply a small voltage to that pin, it will reset the Arduino.
·         Power ON LED: will be on since power is applied to the Arduino.
·         USB jack: you need a male USB A to male USB B cable (shown in figure below) to upload programs from your computer to your Arduino board. This cable also powers your Arduino.
·         Power jack: you can power the Arduino through the power jack. The recommended input voltage is 7V to 12V. There are several ways to power up your Arduino: rechargeable batteries, disposable batteries, wall-warts and solar panel, for example. For more information about this subject you can read this blog post on Random Nerd Tutorials Arduino – 5 Ways to Power Up your Arduino.

Downloading the Arduino IDE

The Arduino IDE (Integrated Development Environment) is where you develop your programs that will tell the Arduino what to do.
You can load new programs onto the main chip, the ATmega328p, via USB using the Arduino IDE. To download the Arduino IDE, please click on the following link: Select which Operating System you’re using and download it. Then, simply follow the installation wizard to install the Arduino IDE.
When you first open the Arduino IDE, you should see something similar to the figure below:

Connecting your Arduino

Connect your Arduino UNO to your computer via USB.
After connecting your Arduino with a USB cable, you need to make sure that the Arduino IDE has selected the right board.
In our case, we’re using Arduino Uno, so we should go to Tools 4 Board: 4

Arduino/Genuino Uno.

Then, you should select the serial port where your Arduino is connected to. Go to

Tools 4 Port and select the right port.

Uploading an Arduino Sketch

To show you how to upload code to your Arduino board, we’ll show you a simple example. This is one of the most basic examples – it consists in blinking the on-board LED or digital pin 13 every second.

1.    Open your Arduino IDE.

2.    Go to File 4Examples 4 01.Basics 4 Blink

By default, the Arduino IDE comes pre-configured for the Arduino UNO. Click the

Upload button and wait a few seconds.

After a few seconds, you should see a Done uploading message.

This code simply blinks the on-board LED on your Arduino UNO (highlighted with red color). You should see the little LED turn on for one second, and turn off for another second repeatedly.

Control an Output and Read an Input

An Arduino board contains digital pins, analog pins and PWM pins.

Difference between digital, analog and PWM

In digital pins, you have just two possible states, which are on or off. These can also be referred as High or Low, 1 or 0 and 5V or 0V.

For example, if an LED is on, then, its state is High or 1 or 5V. If it is off, you’ll have Low, or 0 or 0V.

In analog pins, you have unlimited possible states between 0 and 1023. This allows you to read sensor values. For example, with a light sensor, if it is very dark, you’ll read 1023, if it is very bright you’ll read 0 If there is a brightness between dark and very bright you’ll read a value between 0 and 1023.

PWM pins are digital pins, so they output either 0 or 5V. However these pins can output “fake” intermediate voltage values between 0 and 5V, because they can perform “Pulse Width Modulation” (PWM). PWM allows to “simulate” varying levels of power by oscillating the output voltage of the Arduino.

Controlling an output

To control a digital output you use the digitalWrite() function and between  brackets you write, the pin you want to control, and then HIGH or LOW.
To control a PWM pin you use the analogWrite() function and between brackets  you write the pin you want to control and a number between 0 and 255.

Reading an input

To read an analog input you use the function analogRead() and for a digital input you use digitalRead().
The best way for you to learn Arduino is practising. So, choose a project and start building something.

The features of Arduino Uno ATmega328 includes the following.

  • The operating voltage is 5V.
  • The recommended input voltage will range from 7v to 12V.
  • The input voltage ranges from 6v to 20V.
  • Digital input/output pins are 14.
  • Analog i/p pins are 6.
  • DC Current for each input/output pin is 40 mA.
  • DC Current for 3.3V Pin is 50 mA.

All you need is an Arduino board and some basic electronics supplies.

  • ESP8266 Wireless Web Server. ...
  • Digital IC Tester With Embedded Truth Table. ...
  • Arduino Based Audio Meter. ...
  • Arduino Based RF Controlled Robot. ...
  • Home Automation System. ...
  • Making Arduino Shields. ...
  • Fancy Lights Controller. ...
  • Android controlled robot.


  1. I am G DHEEPAK from Villupuram.I like ROBOTICS.Your projects gave me some inspiration.Thanks for that sir.I am also tryingbto do some project in ARDUINO