Digital Control System (BVM)
Digital Control System (BVM)
Representation
Digital signals fulfilled the necessity of storing and retrieving the signals. But in order to listen
or see the stored signal, the digitized signal had to be converted into analog signals. This is the
reason we use analog-to-digital and digital-to-analog converters in many of our daily used
apparatus like phones, TV, iPod, etc.
Analog-to-Digital Converter
ADC is an Analog-to-Digital converter. Continuous varying signal data is converted to discreet
values at discreet time intervals using an ADC device. Like the highest peak of a sound wave
is represented as the highest discreet value in the digital scale. Similarly, the analog value
captured at the selected time interval is converted to the appropriate value on the digital scale.
These rounding off values to the appropriate discreet value on the digital scale injects
conversion errors. But if the discreet values are selected properly, these deviation errors can be
minimized.
While talking on our mobiles, the ADC in the phone converts what we speak from analog-to-
digital signals. At the other end, in order to listen to the voice reaching the other microphone,
DAC converts the digitized talk to analog signals for the person to listen.
ADC Method:
The Pulse Code Modulation (PCM) method is used to convert analog-to-digital signals.
Basically, Analog signal conversion has main 3 steps – Sampling, Quantizing,
Encoding.
Multiple discreet sample values are taken and a continuous signal stream is generated.
A good sample rate (or sampling frequency) is required for good quality conversion.
The sampling rate is the number of samples per unit (sec) taken from an analog signal
that is continuous to convert it to a digital signal, which is captured at discreet time
intervals.
The sample rate differs from medium to medium. The sample rate of 8KHz for
telephones, for VoIP rate of 16KHz, for CD and MP3 rate of 44KHz is considered good.
Sampling gathers the variation of data into discreet time signals.
The step of quantizing rounds of the amplitude of the sample gathered to a manageable
number of levels that can be represented in binary orbit form.
Encoding is done next to convert each value level at the specified discreet time
intervals.
The accuracy of the digital sample depends on the sampled analog signal. The sampling
rate is a very important parameter that impacts the quality during the conversion of the
analog-to-digital signals.
Digital values take only discreet values, unlike analog signals. There can be a difference
when the actual value has to be modified to the closest discreet value allowed in digital
mode. This round-off done results in some deviation from the actual value and is
referred to as the quantization error.
So, the converted sample is always not the exact copy of the original signal.
Digital-to-Analog Converter
The key factors impacting the conversion are the resolution, conversion time, and reference
value.
The resolution of DAC is the smallest output increment that it can produce.
DAC settling time or conversion time is the time from the input code application until
the output comes and is stable around the final value. A deviation from the final value
within the allowed error band is accepted.
The reference voltage (Vref) is the highest voltage value that the DAC can reach. The
DAC chosen for audio output requires low frequency but a high resolution. Low
resolution and high-frequency DAC are required for image, video, visual output.
Let us take a real-life example to explain the Analog and Digital application in the system.
Original technology used in TV and Radio was analog. The brightness, volume, color were all
represented by the value of the frequency, amplitude, and phase of the analog signal. Noise and
interference made the signal weak and the final picture was snowy and the sound was very
erratic. Digital signals paved the way to improving the quality.
In the debate, Analog vs digital Audio and Analog vs Digital television, the digital signals have
made an impeccable inroad. Digital signals have improved the quality of audio and videos in
the new apparatus like mobile, computers, IPAD, Television, etc.
TV relay–The starting point is the camera where pictures are shot to be relayed. The lights
captured by the sensors are analog. These are then converted to digital values. So, now the
picture captured is represented as streams 0 and 1. Now the next step is to transmit the image
from the TV station to our home TV.
The transmission is over cable if the connection in the case is of cable else it is transmitted
through the air. For this transmission, the digitized signals are converted to analog. After the
analog signal reaches our home, it is converted to digital for the home TV set to display the
picture on the screen. To reach us it is converted to analog so that the light can reach us to view
the image.
In real-life applications, this basic inter looping between digital and analog happens for us to
get the message in our computers, HD television, digital phones, camera, etc. All the discussed
phenomenon of signal distortion impacting the image and sound and their restoration is applied
in these apparatuses.
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 and
to design additional boards, called shields that fit neatly on top of your Arduino
board . 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 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 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 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. 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.