You are on page 1of 77

introduction:

The concept of the Adruino

If you want to control the lighting of a set of LEDs, or you


want to control the engine and the speed of its rotation, or
you want to read the value of a sensitive output and show
them on the screen to ensure the effectiveness of the sensor,
or if you simply want to learn the principles of control and
design software and electronic, The Arduino will
undoubtedly be your favorite choice.

Arduino can be seen from several angles, all of which are


true:

On the one hand, it is a programmable logic controller


(PLD): Programmable Logic Controller, so that the user can
program the board to perform a function or task.
On the other hand, it is an open-source system with both
hardware and software. All designs for the Arduino are
freely available and can be modified and developed by
developers around the world. The programming environment
is free and open. Source, can be improved and add its
extensions by programmers also around the world.
Also, the Arduino painting is simply a simple and easy
learning tool that anyone can acquire and learn from
programming and the principles of electronics through it,
through free programs and projects available on the internet,
all of which were implemented using Arduino.
All of the above is true, and for me personally, I prefer to say
that Arduino is an integrated system, consisting of a multi-
tasking electronic board + software development
environment + a developer community and a philosophy of
thinking based on the open source concept.
What is the ardwin-electron world?

The story began with a group of students at the Institute of


Interactive Design in the Italian city of Evira in 2005. Their
main objective was to design a multi-tasking, open source
electronic board. Students used the BASIC Stamp Controller
to implement their project, and the initial painting cost them
about $ 100. The initial design was considered too expensive
and work was done to develop the painting. The project was
presented and detailed in a special thesis, with all the details
related to the necessary connection. The first team worked on
developing the painting and making it lighter and less
expensive, so they managed to produce the painting of the
Arduino, which we know today. Today, Massimo Banzi,
David Caurtielles, Tom Igoe, Gianluca Martino, and David
Mellis are seen as the core of the "Arduino" project.

It is worth noting that the name of the "Arduino" back to Bar


in the city of Evira, Italy, and the founders agreed to name
the project on behalf of this bar, because they used to meet
and meet in order to develop their project!

Now, we can start talking about some details, and from the
Arduino panel and its components we will start.

Arduino Plate Bord


The Arduino is a small, integrated computer system. A
"computer system" means that it contains a core core, the
microcontroller, which performs computer functions,
receiving and processing data and data, and issuing
commands for the operation of parts and other parts
associated with the system.
It is worth mentioning here that there is no single Arduino
painting, but there are many different patterns and paintings,
which differ from each other in terms of the microcontroller
present in the painting, the number of entries, exits and
digital, and in our simplified explanation here about the
concept of Arduino paintings, In general about the basic
components we will find on any plate.

Most of the Arduino's panels rely on micro-controllers of 8-


bit resolution, which are from the Atmel AVR family, and
some panels rely on 32-bit microcontrollers from the Atmel
ARM family. There is a big difference between 8-bit
controllers and 32-bit microcontrollers, and it's up to the user
himself, in terms of his need for the board and the nature of
the projects he will implement. The main microcontrollers
used in the Arduino panels are Atmega8, Atmega168 and
Atmega328.

In addition to the microcontroller (the base unit of the


board), we also distinguish on the motherboard the power
socket required to operate the panel, where the arduino
panels operate at a standard voltage of 5 volts.

The Arduino panel must include a means of communicating


with the computer in order to load the programs on the
microcontroller of the board. The most popular means of
communication is the USB port that connects the Arduino
board directly to the computer. Some of the Arduino panels
include the serial port RS-232.

Finally, the Arduino panel includes two types of Pins that


developers will use in their projects: Digital Pins, which are
legs from the input and output of data and digital data to and
from the board. The number of these legs varies from plate to
plate, and in the Arduino UNO board there are 14 men. The
second type of legs is analogue inputs, the legs that are
responsible for reading analogue data and entering it into the
microcontroller of the arduino panel for subsequent
processing.

In addition to the capacitors and voltage regulators to


maintain a fixed and specific voltage and current value at
which most elements of the Arduino panel operate, there is
no need to delve into the details of these elements, since they
are not a primary priority For any developer who wants to
use the Arduino paintings in his technical projects.

So, as a conclusion, it can be said that any Arduino


painting must include:

1 Micro-central control of the board


2 Digital Pins - in and out
3 Analogue Pins
4 Power Connector Power Connector
5 connection socket with computer and motherboard
programming

You do not have to worry about the Arduino paintings and


the details of the legs of the elements on it. The Arduino
system provides a full explanation of all the elements placed
on any of the Arduino panels, so that the designers and
developers are fully aware of all the details of the painting
they will use. The following example is for the details of all
the legs of the Arduino UNO board and all the information
related to the electronic components and parts on the board:

With regard to the paintings of the Ardennes


itself, it is worth mentioning that any developer around the
world can install the Arduino plate himself! Arduino is one
of the open-source open source hardware, so the basic
schematic of the elements and connections between them is
available to anyone, and any developer around the world can
install the Arduino plate that he wants for himself, as long as
the basic pieces he needs are available.
Programming Arduino
What is the value of the Arduino panel and its components, if
not able to execute a useful and effective? If so, this board
must be programmed, and a program that directs the
microcontroller and all the parts and elements connected to
the Arduino panel should be executed to perform the
functionality desired by the user and the developer. This is
actually the essence of the object of the Arduino panel, that
is to make it available to any programmer to be able to write
programs and install on the board, so that the implementation
of a useful function in a field.

In order to be programmed, the IDE has been customized.


The environment has been developed based on Java to be a
software environment that supports C and C ++. The
Arduino C programming environment is called Arduino C.
The Arduino C environment is a free, open-source, open-
source environment that includes many of the effective
offices that the developer may need while working.
Moreover, there are a large number of developers involved in
the Arduino community, They periodically add projects and
applications, so they are available free and complete to
anyone who wants to implement a program or technical
project using the Arduino panel.

For people with good software background, especially in C


and C ++, they will find the Arduino C environment easy
and fun, and will have no difficulty dealing with it. For
people who do not have a good background, there is no need
to worry or fear. The environment is easy, easy to learn and
can be adopted as a first step towards understanding the
world of software, programming languages, and
communicating with hardware. Finally, as an important
feature especially for users and developers who use the AVR
family controllers, the program written in C can be installed
directly on the Arduino boards.

There is no doubt that programming is the most important


part of your project. Programming is the most important
thing in our daily life. Nowadays, programming is taking us
all the way. The computer or smartphone you read from is
now programmed. Programmer, as well as Windows or
Linux through which you can use your computer is basically
a code.

In addition, all the devices you deal with every day and the
applications in your phone are actually programs, but each is
programmed in a specific language. Therefore, there are
many programming languages, but what is important in our
article today is the Arduino C programming language.

But before we go into the details of Arduino and his


language, "Arduino C", let us put together a simple definition
of programming so that we can know how it is done, and
why many languages? Can you, as an electronics enthusiast,
program any electronic circuit?
The algorithm is called "Algorithm," which is a set of
mathematical, logical and sequential steps to solve this
problem. The algorithm is named after the world Abu Jaafar
Mohammed bin Musa Al Khwarizmi, which he invented in
the ninth century AD.

Programming language is a set of variables and functions


that allow us to formulate this solution in a computer-based
way. The process of writing the program is in a specific
programming language. The programming rules are chosen.
Each language has its own characteristics that distinguish it
from the other. It makes it suitable for varying degrees for
each type of program. the program.

We simply have a problem that we will put some of the


possibilities of the solution called input "inputs" to find
solutions called "Outputs", so you can program anything.
"Flowchart" is a graphical representation of the algorithm
"Algorithm", a flowchart is very useful in writing the
program and explaining the program to others.

Let's just make a simple example that we want to write a


program for Arduino to trigger a "LED" when we press a
button, so the first question you ask yourself is "Inputs" and
"Outputs" in our example.
The only input we have is the button on which we will press.
The button represents the input data for the Arduino panel.
The output will appear on the LED in the case of light, ie, the
LED is the output. To understand what we want, we need to
understand its language by knowing functions and variables.
We write him what we want.

What are the five steps that if followed you


will be able to program Arduino?
Step 1: Start with the Arduino Development
Environment "Arduino IDE"

The development environment, which is called "Arduino


IDE", is the tool in which the programming code is written in
"Arduino C", and then converted to an executable format and
submitted to the Micro Controller on the Arduino.

The Arduino IDE is very simple, as it has no complexity. It


has everything the programmer needs to develop programs in
the Arduino C language, and at the same time is used to
directly upgrade the program to microcontroller without the
need for a medium to upgrade the program to the port.

Initially, we will explain the Arduino IDE environment for


the Microsoft Windows operating system as the most widely
deployed operating system among users, but it is certainly
available for all operating systems.

Download the Arduino Development


Environment "Arduino IDE"

There is no doubt that the software development


environment is available for all Windows, Linux, MAC, and
you can download it from the official website of the
developers of the Arduino at the following link:
https://www.arduino.cc/en/Main/Software

After downloading the file from the site you will not find it
difficult to install it on your computer.

After you have installed the Orduino environment on your


computer, we will need to do some steps before you can
write the program.

1. Plug the USB cable into the hole and connect the other
end to the USB slot on your computer, and wait for the
device to recognize the new "Found Arduino UNO
Board" after you receive this message you can start
working on the development environment.

Step 2: Identify the graphical interface of the


development environment that is named "Sketch file"
Is the tool in which the code is written in the language of
Arduino C to be downloaded on the Arduino, and the first
step we take it is to choose the Bourda we will deal with, so
we go to the Tools menu and choose board and we choose
the Arduino UNO as in the picture:
And then we will choose the serial port of the connection
with Arduino "Choosing a Serial Port"

One of the things to focus on in the Arduino programming


process is to specify the serial port, through which to connect
to the Arduino port, from the Tools menu, select Serial Port,
then select the port on it as in the picture
To save a written project, select a file and
save ... "Save the project by choosing File
>>> Save from the menu"

Code Validation (Testing the Code)

Validate the code and make mistakes first


Before sending the code to the Arduino panel
to execute, click Sketch and Verify /
Compile.

Step 3: Identify the variables used in the


code "Variables"
"Int" is an abbreviation for Integers which is
the first type of data used in code writing in
Orduino Ono. The value of the digits is "2
Byte = 16 Bit" and is expressed as follows

"Constant" is a constant of 12 and its name is


LED. Let's ask why we have used this
constant. We used the constants here to make
it easy to define inputs and outputs pins for
the precise control on the Arduino. For
example, in the previous order we defined a
constant, Pin 12, which we might use as an
input or exit by the wind.

The letter "Char"


"Char" is the type of data that is stored in
memory with an area of "1Byte = 8Bit".
There are cases where the character can be
sad in memory in the form of numbers. This
occurs when using a type of code called
"ASCII chart" When we want to perform
arithmetic operations such as:

('A' + 1 has the value 66) In this case, the


letter A means 65, so if we write in the code

Word (Word)
The word is stored in a 16Bit space from 0 to
65535 which equals 2 ^ 0 to 2 ^ 15 For
example you can type the word in the code
like this:

Decimal number "Float"


The decimal number is stored in 4Byte area
and is usually used with analog applications
such as reading sensor values such as heat
sensor, humidity, distance, etc. It can be
expressed as follows:

Step 4: Identify the functions used in


the code "Functions"
The functions are used to break the code,
where the code is a number of functions that
allow the programmer to put his ideas, and
want to access it within the code, and we will
find the functions types, there is a function
through which to perform a specific task and
then return to the rest of the code and
implementation, and another function can
perform a part of several Times inside the
program is called here "Loop".

The code consists of two functions:


First:

The setup function is executed when running


the microcontrollers.

Execute only once


The variables are defined in them
The entries and exits used in the code are
defined as they are on the hardware.
the second:
}

Loop function "and the program continues to


revolve and re-implementation time after
time as desired until a condition is fulfilled to
get out of them, and implement what follows.
The purpose is to determine the state of the
user used on the borada, setup () is a function
used through the pinMode

In the sense that during the connection to the


circuit was connected to the form of an inlet
or outlet inside, you will take the reading and
exit, or that the Arduino will take a reading
and have a data entry

(Example)

Each side on the Arduino plate has a specific


number. When writing this function, you are
required to specify the number of the party
used, and then determine its status. Is it an
entrance or exit?
This function is understood by the Arduino as
the number 13 will be a way out of which to
take readings.

Step 5: Download the program on the


Arduino "Upload to board"

This step is done after the completion of the


writing and verification of the code, is done
by simply clicking the download button, and
wait a few seconds, until you see the flash
light RX and TX in the Arduino panel, and
you will see a message "Uploaded" in the
case of loading Successfully, then take the
Arduino plate and plug it into your project
and press Run.

In the development environment "Arduino


IDE" you will find a tab with the name
"Sketch". If you click on it you will access
the Arduino Library:
You'll find a set of ready-to-use Codes that
you'll need to build your projects, or what
Arduino will need for hardware definitions,
where you can identify code and how to write
it?

The importance of development


paintings

In order to understand the importance of the


development boards and the role played, we
must take a quick look at the stages of
development of an electronic project or
application. Let us say that we want to design
an electronic chip capable of sensing the
conditions surrounding us such as
temperature, humidity, wind speed and
intensity of light, Values arrive at thresholds.

In order to implement such a project, the


steps are usually as follows:

* Characterization of the electronic system


and its different characteristics and units
* Designing the electronic circuit of the
project and simulation of the computer to
ensure the validity of the design and ability
to measure the parameters required
* Conduct a preliminary test by connecting
the elements to each other on an electronic
workout board and record the problems
that may occur and re-test the test
* Implementation of a prototype of the
electronic chip through the design of
printed PCB that includes all elements and
parts of the project
* Examine the prototype and conduct
reliability tests to ensure that it matches
the required values, and build another
model in the event of a design error
It is easy to note that the process of designing
and implementing an effective electronic
project is not easy or simple. It requires
several phases of traffic, as well as the need
to own many testing and testing tools as well
as manufacturing tools. In other words,
project modeling and experimentation require
a long time and effort, as well as having the
same developer of diverse skills in electronics
as well as hardware programming. This has
been greatly changed by the availability of
development boards and the opportunity for
anyone to start learning the skills of
electronic design and hardware programming,
as well as provide the opportunity for
developers themselves to model and
experiment their ideas in a short time, which
reduces the time of implementation of the
project in addition to its cost.

In addition to the variety of sensors and


connectivity standards, developers can
shorten the time required to experiment and
model projects dramatically. Instead of
building different models and circuits at a
time, one panel To connect them with sensors
or display devices or communication devices,
without having to design the board at a time.
In addition, thanks to the growing open
source culture and free availability of
software support offices, the time will be
reduced further because the developer does
not need to write programs from scratch, but
will be able to use the software offices
available on the Internet and modify them as
required by the project.

Components of the development


board

As mentioned above, today there are a large


number of development boards that differ
from each other with the capabilities and
characteristics provided to developers.
However, it can be said that any development
board according to the different units it owns
and the different purpose designed for it, it
must possess the following:

* Processing Unit: This unit may be a


microprocessor connected with a set of
support circuits, memory and external, or a
microcontroller containing all the support and
memory circuits necessary to carry out its
tasks. Some advanced computer vision boards
include a GPU that may be separate from the
core processor or that may be integrated with
it to form an integrated system on the SoC
chip.
* Memory Units: If the development board is
based on a central processor, it will be
necessary to have separate memory modules.
For microcontroller development boards, the
control chip itself often contains all the
necessary memories.
* GPIO ports: These ports are general
purpose, meaning that it leaves the developer,
according to the application he wants to
implement, the freedom to program and
customize the functionality of these ports. In
general and in different projects, these ports
are used to read logical domains (one
Boolean High, zero Boolean Low) or to
generate logical fields and send them to other
devices. Also, it is possible to assign single-
pin encoders to more than one function, such
as GPIO-Pin General Slurger and at the same
time enrich read Rx serial data or read read-
out ADC-Pin signals. The developer
determines the function of these authors in
the development board work program. Also,
general-purpose gatherers are used for data
exchange in one of the serial messaging
standards, such as UART, SPI, I2C.
* Interface Ports: One of the most prominent
features of the development boards is the
ability to connect with many different devices
through standard ports, such as USB serial
port, Ethernet port, high-definition
multimedia port HDMI or even MIPI
integrated camera sensors -CSI.
* Other segments and circuit boards: The
development board may include integrated
electronic circuits, depending on the
applications to be implemented. For example,
engine driving requires driving circuits to
ensure that currents and electric currents are
in proper drive values to work properly.

Development paintings and


computers of one painting

In addition to the term Development Board,


another term, "Single-Board Computers,"
refers to a specific type of development board
that can be used as a small personal computer
that includes all the basic pieces on a single
board as well as having a processing unit
Type "system on the SoC chip" that helps it
run personal computer operating systems
such as Windows or Linux.
You may now be thinking of an important
question: Do not all development boards have
all the pieces and modules to deal with them
as a small computer? The answer is
theoretically yes, but the types of operating
systems need to be differentiated here. A
development panel such as Arduino is not
compatible with an operating system such as
Windows, and the main reason is the
structure and architecture of the
microcontroller and, more precisely, the
architecture and architecture of the
microprocessor.

The single-board computer "is actually


different from the motherboards in the
personal computers in small size that is easy
to carry as well as low energy consumption
and easy to connect with other devices.
Surely, single-board computers can not
provide the same processing power and
performance as personal computer
motherboards for many reasons, the most
important of which are the same components
used to make single-board computers, all of
which are low-power, which is reflected in
limited performance .

The Raspberry Bay is one of the most popular


and most widely used tablet PCs. It relies
mainly on the Linux operating system, as
well as the GPIO, which enables it to be
invested in various applications ranging from
reading sensor values to motor control,
Access to the applications of computer vision
and Internet IoT.

The term "microcontroller board" refers


to development boards that are primarily
intended for use in integrated electronic
systems, meaning they are not intended to
work as a small, portable computer.
Arduino is a popular example of
microcontroller boards.

summary
The development board is a printed electronic
circuit containing a microcontroller or
microprocessor in a way that allows
enthusiasts and developers to easily program
it and connect it with other electronic devices,
thus accelerating the process of modeling
designs and experimenting with project ideas,
or even using them as a project or
application. The development boards vary
according to the processing capabilities they
provide as well as the capabilities they
provide in terms of the number of devices
that can be linked to them and their support
for various connectivity and communication
standards. The big success lies in the
development boards of their small size, ease
of carrying and programming as well as their
relatively low cost and low energy
consumption.

Servo Motor
We will learn how to move the engine in
different directions, and then we will add a
variable resistor 'pot' to control its status.

Required parts
To build a project you need to provide the
following pieces
Servo Motor
10kΩ variable resistor’pot’

Half-size Breadboard
Arduino Uno R3

100µF capacitor(optional)
- Design of the test board for servo
motor movement

In this experiment, we will connect the servo


motor to the Arduino.
The servo motor has three heads, the red
color of the 5V power, the black / brown
color of the GND ground, and the latter color
is usually orange / yellow and is connected to
the 9 'digital pin' port.

There is a servo motor wiring socket that


allows the jumper wires to be attached to the
test board and the Arduino.
In the event of a defect

A servo motor may malfunction. This may


occur when the controller is connected to
"some" USB ports. This is because the engine
directs a lot of energy, especially when
starting the engine, which may reduce voltage
Voltage Arduino, it is restarted
This problem is solved by adding a capacitor
capacitor (470uF or higher) which is placed
between 5V and GND.

The capacitor works as a power supply tank,


allowing the engine to start by taking the
current stored in the condenser as well as the
current it is taking from Jordan.

The longer end of the capacitor is the positive


end, which must be connected to 5V. The
negative end usually has a '-' sign on them.

Code of the Arduino for the


servo engine
Upload the following code to the Arduino
controller and you will find that the servo
motor starts with the movement in one
direction and then the other.
Servo motor is controlled by a series of
oscillations. To make the process easy, a code
library is provided for Arduino to make it
easier for you to direct the servo motor to a
specific angle.

The commands to control the servo engine


exactly like other orders in the program, but
because we use it permanently in all projects,
so you have to call the library commands
control servo motor 'through the following
command

As usual we define and define the port that is


connected to the servo engine via the variable
'servoPin'.
Let us programmatically define a servo
engine. The programming library provided us
with a type of definition and is 'servo' exactly
like other definitions such as 'int', 'float', etc.

So using the 'servo' type definition you can


know up to 8 servo drives associated with the
Ardino. The definition is as follows

In the setup function, we have to bind the


'servo' variable to the port that will control
the servo drive, via the following command
The variable 'angle' is used to determine the
current angle of the servo engine. Inside the
loop function, we used two 'loop' rings to
increase the angle in one direction up to 180
degrees and then go back and go to the other
side.

Command

servo is required to update its position from


the angle identified for it.

Design the test panel for the


router
The next step is to place the variable resistor
and use it as a router that allows us to change
the servo motor angle by steering it.

All we have to do is put the variable resistor


'pot' and connect it to the A0 port in Arduino.

Code for the router


The code to guide the servo engine through
the handle is easier than the previous code
Another variable is called 'potPin'.
To locate the servo, we convert analog
reading 'analogRead' from port A0. This will
give us a value between 0 and 1023. Since the
servo can move up to a maximum 180 °
angle, we have to reduce the maximum read
value. By dividing the number by 6, which
will give us a value between 0 and 170 which
will be appropriate.

Servo motors 'servo motors'


The position of the servo motor depends on
the length of the oscillation. It receives a
pulse of approximately 20 parts per second. If
the pulse is a fraction of a second, the servo
angle is zero, and if it is 1.5 ppm it will be in
the middle, and if it is two parts of a second it
will be at 180 degrees angle.
Other things you have to do

Try reducing the 'delay' delay rate from 15


ppm to 5 ppm.
Note the speed difference of servo.

Try to control the servo motor via the serial


connection screen instead of the variable
resistor.
Note: In order to read the number from the
Serial Monitor screen, you can use the
Serial.parseInt () function to read the
numbers from the Serial Monitor screen.
Send an email if
motion sensor
In this section, you will learn to use the
motion sensor 'Motion PIR sesnor' and make
the e-mail as soon as it senses the movement
through a Python program with your
computer.

The Arduino controller waits for a signal


from the motion sensor 'Motion PIR sensor'.
Once a signal from the sensor is detected
indicating that there is a movement, the
controller sends the command to the
computer via a USB port to send e-mail.
Required parts

To implement this project you must die the


following pieces, as you must provide a
computer or laptop connected to the Internet
(so you can send e-mail)

PIR Sensor
Half-sized Breadboard

Arduino Uno R3
Jumper wires

Design of the test panel


As you can see, the only thing you plug in
here is the PIR Sensor sensor with the
Arduino, you can connect it directly to the
Arduino instead of using the test panel if you
want but make sure the wires are fastened.

The code for the Arduino

The Arduino controller will send a message


via the Serial Connection connected to the
computer via the USB port whenever
movement is detected.
But this means that he may send a lot of e-
mails because of the repetition of movement
either sensor. Therefore, the Eduardo
controller will send a different message if it
has already sent an email within a minute.

You can change the value recorded in


'minSecsBetweenEmails' to any values you
find appropriate.
Here we set the value to be 60 seconds, so e-
mails are not sent for a minute.

We use the 'lastSend' variable to follow when


the last email has been sent.
The number is defined as "negative" and is
taken from the variable
'minSecsBetweenEmails', and this is done to
ensure that the motion sensor is activated
immediately after running the Arduino
controller directly.

Within the loop function, the function 'millis


()' has been used to obtain the number of
parts of the second since the beginning of the
operation of Al-Ardaweeno until the
comparison between it and the last time that
the sensor was registered, where the message
"Movement" will be sent "movement" if the
period exceeded more than 60 seconds,
otherwise you will be sent the message
"Toosoon" ie "very early"

Before connecting the project to Python, try


the code by opening the Serial Monitor
screen in the Arduino IDE program.
Install Python and PySerial

If you're using Linux or Mac, Python is


already there. If you're using Windows, you
have to download and install it.
In all operating systems, you must download
and install the PySerial library to allow
communication with Arduino.
Download and install Python on Windows

To download Python on Windows, download


it from http://www.python.org/getit/

We recommend that you use the Python 2 for


better compatibility.

After installing Python on your computer, we


have to make modifications to allow
commands to be executed in the command
prompt 'command prompt', so we can
download and install PySerial>

We need to add the compiler Python


commands to the command extensions -
PATH environment variable

To do this, go to the Windows Control Panel


and find 'System Properties Control'.
Then click on 'Environment Variables', then
choose 'Path', under 'System Variables', click
on 'Edit', and with 'Variable Value', and
without any modification to existing text, add
'C: \ Python27;' Or the file you specified for
python)

Do not forget to add '; 'Before adding the text.

To make sure the process is successful, open


the Dos Prompt and enter 'python', you
should see the following result:

Python software code


Now you have to do a Python program. To do
this, copy the following code and place it in a
text file and name it 'traffic.py'.
You can do this in Linux or Mac using the
'nano' editor. For Windows, you prefer to use
the Python editor in 'IDLE' which you will
find on the Start screen after installing it.

Before you try the program, there are some


settings to modify.

We've set up Gmail account settings, so if


you do not have a Gmail account, sign it up.

Place the e-mail you miss receiving


notifications in the 'To' box.

Place your mail (Gmail account) in the value


of 'GMAIL_USER'
Set the mail password in the value
'GMAIL_PASS'

You can also edit the email address and


message text that is being sent.

You also need to configure the Serial Port


connection for Arduino by modifying the
following line:
In Windows will be like 'COM4', and in
Linux or Mac will be like
'/dev/tty.usbmodem621'. You can find out by
opening the Arduino IDE program and
watching the bottom right.

After editing the settings, you can execute the


program by typing the following command in
the command prompt

python movement.py
When you sense traffic, you should see a
tracking like this, and within a short period
you will receive an email for the mail you
entered.

Note 'Too Soon' messages, which are sent if a


movement is detected within 60 seconds of
sending the last email (so no email is sent)

Other things you have to do


Now that you have learned how to send e-
mail and use the motion sensor, you can use
other types of sensors and send readings via
e-mail (such as sending the temperature and
humidity)
10 Simple errors may destroy the
painting of the Arduino!

How can you destroy the Arduino slide? You


can try the following methods: shoot them,
put them down a tank, a, throw them in a
pond, etc. These are certain and effective
ways to destroy the Arduino segment, but in
reality this is not what we will talk about in
our article.

In this article we will show you how you can


destroy the Arduino electrically with fatal
mistakes committed by beginners and
inexperienced. You know what we're talking
about: a fire smell, black marks on the pieces,
a flash of electric sparkle on the run, or the
dreaded "programmer not in sync" error
message. Signs mean you learned the lesson
the hard way!

If you have just purchased the Arduino, you


need to read this article to learn what you
should do and what you should not do.

burnt

* First method: Palace pole went out to the


ground

How is this done?


Program the pole to be output and give it a
high value and then connect it to the ground!
I've just created the right conditions to get an
extra stream, which could cause the painting
to be destroyed.
Why was this done?
If you return to the Datasheet technical
bulletin, it shows that the current of the single
pole of the microcontroller should not exceed
40mA. When confined to the ground with an
internal impedance of about 25 ohm, a
current of up to 200 mA will be drawn,
enough to destroy and damage the control
pole.
* Method 2: Polar Palace came out with
some of them

How is this done?


Programming two poles to be Output and
give one of the value of High and the other
Low and then short. Again, adequate
conditions have been created to generate an
excess current, leading to the destruction of
the poles.
Why?
For the same reason as the first method, but
this time the current will return to the input
pole instead of the ground.

* Method 3: Apply high voltage to any


input / output pole

How do?
Apply a voltage greater than 5V on any input
/ output pole that can destroy it.
Why?
In this way we burn the protection diode in
the electrode and the current flows and
destroys it.

* Method 4: Reverse the external feeding


poles.

How do?
I chose to feed the Ardennino via a Vin
connecter pin but I reversed the input /
ground polarity, so you will destroy several
devices on the arduino.
Why?
There is no protection from polarity reversal,
which means that the current will flow
through the GND and connected to the
controller. This leads to the flow of current
through the GND pole in the controller to the
5V input in reverse and vice versa to the
voltage regulator.
* Method 5: Apply a voltage higher than
5V on the 5V pole

How do?
When applying a 6V or higher voltage on the
5V pole, many components of the drive will
be destroyed and the voltage on the USB
input may appear on the computer causing
fatigue.
Why?
There is no protection on the 5V pole. The
voltage is directly applied to the controller,
the USB interface and the voltage regulator.
All of them will be damaged if the voltage
exceeds 6V, causing the current to flow. One
misconception is that the 5V voltage
regulator will ensure that the 5V voltage stays
the same. In fact, this is not true. The only
thing the voltage regulator does is that it
controls the current coming from the USB or
from an external power source, but if the
power source is connected directly to the 5V
pole, the regulator can not do anything.

* Method 6: Apply a voltage greater than


3.3V on the 3.3 V pole

How do?
If a voltage of 3.6V or greater is applied to a
3.3V pole, any base or device operating from
this pole will be destroyed. If at least 9V is
applied, this will destroy the 3.3V voltage
regulator of the Arduino and cause a current
flow in the USB port.
Why?
The 3.3 V pole does not contain a protection
circuit. The voltage is directly applied to the
voltage regulator 3.3 of the arduino and any
related rules.

* Method 7: Limit the Vin to the GND

How do?
Run the Jordanow from the DV voltage
source and then shorten the Vin pole to the
GND. The protection diode will be destroyed
and the lines on the printed Ardino board may
melt and destroy.
Why?
There is no protection from excess current on
the Vin pole.
Method 8: Apply an external 5V
voltage with a load on the Vin pole.

How do?
If you are operating the panel with a 5V
voltage applied to the 5V pole and there is an
electrical circuit connected to the Vin pole (or
confined to the ground) the current will flow
backwards through the 5V regulator and
destroy it.
Why?
There is no protection from reversing the
polar voltage on the 5V regulator.
* Method 9: Apply a voltage greater than
13V on the reset pole.

Why?
The pole is connected directly to the
controller and a voltage greater than 13V will
completely destroy it.

* Tenth method: the flow of a total plus of


the controller

How do?
To say that you programmed ten electrodes to
function as outputs and gave them the value
of High and dragged 20mA of each of them
(lighting ten ladders, for example) This will
take a stream of greater than the control and
will lead to damage.
Why?
According to the technical bulletin, we are
not bound only by the maximum current of
each pole, but by the total currents coming
out of all poles, and therefore we must take
them into consideration in such projects.

Arduino Shields

Now let's say we want to implement a project, and we want


to implement it via the Arduino. This project is to read a
sensitive output value and show the result on an LCD screen.
We assemble the necessary parts: an electrical source of
power for the board and the screen, the sensor and the
required resistors and other elements, and finally the LCD
screen itself. Now we have to connect these pieces with each
other, make sure they are connected correctly, then install the
program, and everything will be ready to work.

If we review the project, for example, the LCD screen is one


of the important electronic pieces that we may use in many
practical and practical projects, so instead of connecting the
screen at a time, we can design a circuit for the screen, , So
that this circuit adds an added feature to the Arduino, a
feature of the show. The LCD display circuit is known as
"Shield".
The Arduino extension is simply an electronic circuit that
provides additional functionality to the Arduino panel,
making the panel more efficient and more capable. The
expansions, like the Arduino itself, are open source, and
anyone can develop a new expansion compatible with the
Arduino panel, or it can develop a pre-existing expansion.

There are many expansions of the Arduino panels, including


expansions of LCD screens, an Ethernet input, a GPS
positioning system, or a motor-control amplifier, and the list
goes on. You can find the list of devices and electronic
circuits compatible with the boards of Jordan, in addition to
the important and famous expansions

You might also like