Root Locus Method For The Control System
Root Locus Method For The Control System
About Arduino
The Arduino Uno is a general purpose microcontroller programming and
prototyping platform that you can easily program to react to things going on in
the real world. You can also link between the real world and the virtual world by
connecting up your Arduino to the Internet, either sending data to the Internet or
responding to data on the Internet, or both. You can use it to sense almost
anything you can find an electronic sensor for, including light, temperature,
pressure, sound, even smell — if you consider environmental pollution to be a
smell. You can even build your own sensors. You can use its output capabilities
to sound alarms, open doors and windows, activate lights or motors — the
possibilities are almost endless. Arduino is used for prototyping ideas — getting
them half built and then trying out what works.
Header sockets
The microcontroller socket connects all the legs of the ATmega328
microcontroller chip to other sockets, referred to as header sockets, which are
arranged around the edge of the board and are labelled for ease of use. These
black sockets are divided into three main groups: digital pins, analog input pins,
and power pins.
All these pins transfer a voltage, which can be either sent as output or received as
an input. Why are these pins important? They allow you to connect additional
circuitry to the board quickly and easily when prototyping with a breadboard
(described in Chapter 6) and to design additional boards, called shields that fit
neatly on top of your Arduino board (see Chapter 12 for more on shields). This
same process of sending and receiving electrical signals is going on inside
modern computers. But because they are so advanced and refined compared to a
humble Arduino, it is difficult to directly link a computer accustomed to digital
signals (0s and 1s) to an electronic circuit that deals with a range of voltages (0v
to 5v in the ATmega328P’s case).
The Arduino (see the sketch in Figure 2-4) is special because it can interpret these
electric signals and convert them to digital signals that your computer can
understand and vice versa. It also enables you to write a program using software
on a conventional computer that the Arduino IDE (integrated development
environment) converts or compiles to electrical signals that your circuit can
understand. By bridging this gap, it is possible to use a conventional computer’s
benefits ease of use, user-friendly interfaces, and code that is easy for humans to
understand to control a wide range of electronic circuits and even give them
complex behaviours with relative ease.
Digital pins
You use digital pins (refer to Figure 2-4) to send and receive digital signals.
Digital implies that the pins have two states: off or on. In electrical terms, these
states translate to a value of 0 or 5 volts, but no values in between.
Analog in pins
You use analog in pins (refer to Figure 2-4) to receive an analog value. An analog
value is taken from a range of values. In this case, the range is the same 0V to 5V
as with the digital pins, but the value can be at any point — 0.1, 0.2, 0.3, and so
on.
What about analog out?
The shrewd ones among you may have noticed that there seem to be no analog
out pins. In fact, the analog out pins are there, but they’re hidden among the digital
pins marked as PWM using the ~ symbol. PWM stands for pulse-width
modulation, which is a technique you can use to give the impression of an analog
output using digital pins. I explain how PWM works in Chapter 6. The ~ symbol
appears next to digital pins 3, 5, 6, 9, 10, and 11, showing that you have six pins
that are capable of PWM.
Power pins
You use the power pins to distribute power to inputs and outputs wherever power
is needed. Vin, which stands for voltage in, can be used to supply a voltage (V)
equal to the one supplied by the external supply jack (for example, 12V). You
can also use this pin to supply power to the Arduino from another source. GND
marks the ground pins, which are essential to complete circuits. There is also a
third ground by pin 13. All these pins are linked and share the same (called
common) ground. You can use 5V or 3.3V to supply a 5-volt or 3.3-volt power
supply, respectively, to components or circuits.
USB socket
To tell the microcontroller on the Arduino board what to do, you need to send a
program to it. On the Uno, you send programs primarily by a USB connection.
The large, metallic socket is a USB port for a USB A-B cable. This cable is similar
to the one used on your home printer or scanner, so you may find a few around
the house that can serve as handy spares. The Arduino uses the USB both for
power and to transfer data. Using a USB cable is perfect for low-power
applications and when data is being sent to or received from a computer.
Power socket
Next to the USB socket is another socket; this one is for power. This socket allows
you to power your Arduino from an external power supply. The supply could be
from an AC-to-DC adaptor (similar to those used on other consumer electronics),
a battery, or even a solar panel. The connector needed is a 2.1 mm center positive
plug. Center positive simply means that the plug has an outside and an inside that
fit the socket and that the inside of the plug must be positive. You should be able
to find this plug among the standard connectors that come with most power
supplies; otherwise, you can buy the connector and attach it to bare wires. If you
connect a power supply that is the opposite (center negative), it is known as
having a reverse polarity. Components on the Arduino Uno will resist your
attempts to send voltage the wrong way around the board, but those components
can melt in the process of saving your board, depending on how much power
you’re sending and how long it takes you to notice the burning smell! If you
reverse the polarity when using the Vin, 5V, or 3.3V pins, you bypass this
protection and almost instantly destroy several parts of your board and the
ATmega328P chip. The recommended voltage for the Uno board is 7–12V. If
you supply too little power, your board might not function correctly. Or if you
provide too much power, your board might overheat and potentially be damaged.
LEDs
LEDs come in a variety of shapes and sizes and are found in almost every modern
piece of consumer electronics, from bike lights to TVs to washing machines. You
see a lot more of them in numerous examples throughout the book. The
components described in this section are tiny. The Uno board has four LEDs
(light-emitting diodes) labeled L, RX, TX, and ON. An LED is a component that
produces light when electrical current flows through it.
Reset button
The Uno board also has a button next to the USB socket called the reset button.
It resets the program on the Arduino or stops it completely when held down for a
time. Connecting a wire between GND and the reset pin, which is located next to
the 3.3V, achieves the same results. The board has many other components, all
of which perform important jobs, but the ones described in this section are the
key ones for you to know for now.
Arduino Mini R5
Despite what the names suggest, the Arduino Mini R5 is smaller than the Nano.
This board also uses the same ATmega328 microcontroller chip but is condensed
further, removing all header pins and the Mini-USB connector of the Nano. The
Mini board is great if space is at a premium, but it does require great care when
connecting because an incorrect connection can easily destroy the board.
Arduino 101
The Arduino 101 uses the Intel Curie module to provide a board that’s as easy to
use as Arduino but with the latest Bluetooth low energy technology. It also
features a six-axis accelerometer to detect movement, making it a great
companion for any wearable technology projects or for talking to other Bluetooth
devices.
Arduino MKR1000
The Arduino MKR1000 is a simple but powerful board, combining a 32-bit
processor with a Wi-Fi module. It’s perfect for linking sensors and actuators to
the Internet or prototyping your next Internet of Things (IoT) project. Along with
its small form factor, it has a handy battery connector to allow you to take your
project on the move.
Arduino Pro
The Arduino Pro is a minimal and super skinny Arduino, by SparkFun
Electronics, based on the same microcontroller as those used in the Uno. It comes
without any of the normal headers or sockets but has all the same capabilities of
an Uno. It’s ideal when height is at a short supply. In addition, it has a battery
socket, which allows you to easily make your project portable.
Arduino Uno: This is the board you know and love. USB A-B cable: This cable
is essential to make use of your Arduino. It can also be found on printers and
scanners. LEDs: Light-emitting diodes in various colors are great for providing
visual feedback for your project as well as for testing lighting projects on a small
scale. Resistors: Also referred to as fixed resistors, these are fundamental
electrical components used to resist the flow of current through a circuit. Resistors
are essential for the smooth running of most circuits. Each resistor has a fixed
value, which is indicated by a colored band on the side of the resistor. These bands
help you to quickly identify a resistor’s resistance visually.
Variable resistors: Also known as potentiometers or pots, variable resistors
resist current in the same way as fixed-value resistors, but they can change their
resistance. They are most commonly used in radios and hi-fi equipment for tuning
and volume control dials, and are available also in other housings to detect other
inputs such as force or flex on a surface.
Diodes: Also known as rectifier diodes, diodes are similar to LEDs but without
the light. They have an extremely high resistance to the flow of current in one
direction and an extremely low (ideally zero) resistance in the other, which is the
same reason that an LED works in only one direction. Instead of emitting light
like LEDs, diodes control the flow of current throughout your circuit.
Photo diodes: Also known as photo resistors or light-dependent resistors (LDRs),
photo diodes change their resistance when light falls on them. They can have a
variety of different uses depending on how they’re placed relative to the light
source.
Pushbuttons: These components are found behind the scenes in many bits of
consumer electronics such as game console controllers and stereos. They’re used
to either connect or disconnect parts of a circuit so that your Arduino can monitor
human inputs.
Temperature sensors: These sensors tell you what the ambient temperature is
wherever they are placed. They are great for observing changes in your
environment. Piezo buzzer: A piezo buzzer is technically described as a discrete
sounding device. These simple components can be supplied with a voltage to
produce simple notes or music. They can also be attached to surfaces to measure
vibrations.
Relays: These electrically operated switches are used to switch higher power
circuits using your low-voltage Arduino. Half of a relay is an electromagnet, and
the other half is a magnetic switch. The electromagnet can be activated by the 5V
of the Arduino, which moves the contact of the switch. Relays are essential for
bigger lighting and motor-based projects.
Transistors: These components are the basis for all modern computers.
Transistors are electrically operated switches, similar to relays, but the switch
happens on a chemical level rather than a physical level. This means that the
switching can be super-fast, making transistors perfect for high-frequency
operations such as animating LED lighting or controlling the speed of motors.
DC motors: These motors are simple electric motors. When electric current is
passed through a motor, it spins in one direction; when that direction is reversed,
it spins in the other. Electric motors come in great variety, from those in your
phone that vibrate to those in electric drills.
Servo motors: These motors have on-board circuitry that monitors their rotation.
Servo motors are commonly used for precision operations such as the controlled
opening of valves or moving the joints of robots.
SL Raspberry Pi Arduino
It is a mini computer with Raspbian Arduino is a microcontroller, which is
1 OS.It can run multiple programs at a part of the computer. It runs only one
a time. program again and again.
Raspberry Pi has 4 USB ports to Arduino has only one USB port to
7
connect different devices. connect to the computer.
The processor used is from ARM Processor used in Arduino is from
8
family. AVR family Atmega328P
This is a just plug and play device. If
This should be properly shutdown
power is connected it starts running the
9 otherwise there is a risk of files
program and if disconnected it simply
corruption and software problems.
stops.