Introduction to Engineering
Module-2: Basics of Electricity and Arduino
Basics of Electricity
1. Voltage(V):
It is the potential difference in charge between the two points in an electrical field.
One point has a higher potential and the other points have lower potential. The difference
in charge between higher potential and lower potential is called a voltage or potential
difference.
The voltage or potential difference gives the force to the electrons to flow through the
circuit. The higher the voltage, the greater the force, and hence the more electrons
flowing through the circuit.
Voltage is expressed in terms of energy(W) per unit charge(Q), i.e.,
V=W/Q or
v=dw/dq 1
Units: joule/coulomb (or) volts (or) V
One coulomb of charge will do a work of one joule while moving from higher to
lower potential
2. Electric Current (I):
It is defined as the rate of flow of charge. It is measured by the number of electrons that
flow past a point in unit time.
i=dq/dt or I=Q/t 2
Units: coulomb/sec (or) ampere (or) A
2 amps means 2 coulomb of charge will flow through a point in one second.
3. Resistance (R):
The property of a material to restrict the flow of electrons is called Resistance.
Denoted by ‘R’.
units: Ohms or Ω (symbol)
One Ohm is defined as the resistance offered by the material for the flow of 1 A
of current when 1V of voltage is applied across it.
OHM’s Law:
Statement:
“At constant temperature, the current through a conductor between two points is
directly proportional to the voltage across the two points.”
Where, ‘R’ is the proportionality constant and is resistance of the conductor.
What is Automation: Automation is the process of using technology, machines, or
systems to perform tasks with little or no human intervention.
Need for Automation:
Increase efficiency,
Reduce human error,
Save time and costs.
Types:
· Industrial automation – robots and control systems in factories.
·Home automation – smart appliances, lighting, security, IoT devices.
·Office/Process automation – software automating repetitive tasks (emails, data entry).
4. Introduction to Arduino
Arduino is a prototype platform (open-source) based on an easy-to-use hardware and
software. It consists of a circuit board, which can be programed (referred to as a
microcontroller) and a ready-made software called Arduino IDE (Integrated
Development Environment), which is used to write and upload the computer code to the
physical board.
Arduino UNO Board:
Power USB: Arduino board can be powered by using the USB cable from your
computer. All you need to do is connect the USB cable to the USB connection.
Power (Barrel Jack): Arduino boards can be powered directly from the AC mains
power supply by connecting it to the Barrel Jack
Voltage Regulator: The function of the voltage regulator is to control the voltage given
to the Arduino board and stabilize the DC voltages used by the processor and other
elements.
Crystal Oscillator:The crystal oscillator helps Arduino in dealing with time issues. The
number printed on top of the Arduino crystal is 16.000H9H. It tells us that the frequency
is 16,000,000 Hertz or 16 MHz.
Analog pins
The Arduino UNO board has six analog input pins A0 through A5. These pins can read
the signal from an analog sensor like the humidity sensor or temperature sensor and
convert it into a digital value that can be read by the microprocessor.
Microcontroller:
Each Arduino board has its own microcontroller that act as the brain of the board. The
main IC (integrated circuit) on the Arduino is slightly different from board to board. The
microcontrollers are usually of the ATMEL Company. The microcontroller used on
Arduino Uno is ATMEGA328P.
Power LED indicator
This LED should light up when you plug your Arduino into a power source to indicate
that the board is powered up correctly. If this light does not turn on, then there is
something wrong with the connection.
TX and RX LEDs
On the Arduino Uno board, there are two labels: TX (transmit) and RX (receive). They
appear in two places on the Arduino UNO board. First, at the digital pins 0 and 1, to
indicate the pins responsible for serial communication.
Analog Reference pin: Analog pins are used for general purposes like supporting 10-bit
analog-to-digital conversion (ADC) which is performed using the analogRead() function.
Analog pins are particularly helpful since they can store 0-255 bits which is not possible
using digital pins.
Digital Pins: Digital pins are used for general purposes like taking input or generating
output. The commands that are used for setting the modes of the pins are pinMode(),
digitalRead(), and digitalWrite() commands.
Reset Button: The reset button on the Arduino board is used for setting all the
components of Arduino to their default values. In case you want to stop the Arduino in
between you can use this reset button.
Power and Ground Pins: As the name suggests, power and ground pins are used to
supply the power needed for driving the Arduino board. The ground pins are usually 0V
to set a reference level for the circuit.
USB (universal serial bus): The Arduino needs certain protocols for communication
purposes and the universal serial bus is used for this purpose. It helps to connect
Arduino, microcontrollers with other raspberry pi.
Analog Signal: Analog signals can take any value in a given continuous range of
values. Generally, analog signals used in Arduino are around 0V to 5V. The analog pins
can take data up to 8-bit resolution therefore, they are used for taking large values as
input in the Arduino.
Digital Signal: Digital signals can only take discrete values which are, high('1') and
low('0'). These signals are usually used to Arduino on or off which requires only two
values. The collection of two values (0 and 1) can be used to generate a sequence
known as the binary sequence which is a collection of zeroes and ones. This is how data
is transmitted without much memory requirement but this can lead to certain errors like
quantization errors.
Arduino Technical parameters:
Operating Voltages 5V and 3.3V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory KB (ATmega328) of which 0.5 KB used
by Boot loader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
Microcontroller ATmega328
Arduino Integrated Development Environment (IDE):
Software structure consist of two main functions – Setup() and Loop()
Setup():This function is called when a sketch starts. Use it to initialize the variables, pin
modes, start using libraries, etc. The setup function will only run once, after each power
up or reset of the Arduino board.
Loop():this function does precisely what its name suggests, and loops consecutively,
allowing your program to change and respond. Use it to actively control the Arduino
board.